Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Williams
dc78aa19c9 wifi: don't need secrets if the connection says we don't 2011-02-02 16:17:10 -06:00
Dan Williams
76aabe4b72 settings: ensure an agent is authorized before overwriting system-owned secrets
If the agent returns system-owned secrets, like when activating a new
connection which was created with no secrets, make sure the agent is
authorized to modify network settings before saving or using the
new secrets.
2011-02-02 12:17:58 -06:00
Dan Williams
4ff0b5f0b7 core: add method to start authentication with a D-Bus sender 2011-02-02 12:17:26 -06:00
Dan Williams
fb033b0f05 libnm-util: fix setting property iteration when getting secret flags
g_object_class_find_property() needs the object's class, not the
object itself.
2011-02-02 11:58:19 -06:00
Dan Williams
f9147ec369 settings: don't pass all secrets to agents when requesting secrets
The agent can and will get the secrets it needs itself, since it's providing
secrets anyway.
2011-02-01 12:19:58 -06:00
Jiří Klimeš
9f28308460 libnm-util: make NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME property TRUE by default (rh #488975)
That lets NM send a hostname to DHCP server without requiring the user
editing the parameter manually (there no GUI for this either).
2011-02-01 16:47:04 +01:00
Dan Williams
570c0eb2df settings: implement deleting secrets from agents when connection is deleted 2011-01-31 23:33:46 -06:00
Dan Williams
393bcf8d12 settings: implement saving secrets to agents on Update() 2011-01-31 23:10:33 -06:00
Dan Williams
c4ada67108 libnm-util: simplify nm_connection_for_each_setting_value()
And use less memory as a bonus.
2011-01-31 21:53:16 -06:00
Dan Williams
ac757766e6 settings: fix plugin capabilities max value
It's a bitfield, not a single value.
2011-01-31 21:11:18 -06:00
Dan Williams
1f7143b5df settings: remove obsolete comment 2011-01-31 20:52:18 -06:00
Dan Williams
5bc105e139 ifcfg-rh: don't save agent-owned or always-ask secrets 2011-01-31 20:35:37 -06:00
Dan Williams
93cbc77154 libnm-util: handle get_secret_flags/set_secret_flags for WirelessSecurity setting
Becuase there's only one 'flags' property for WEP keys (because it's pretty
dumb to have different flags for all 4 WEP keys) we need to do some tap dancing
with the secret name, so that requests for "wep-keyX" look up the "wep-key-flags"
property.
2011-01-31 19:57:48 -06:00
Dan Williams
d95280756f keyfile: fix flags check for writing secrets
Duh, AND-ing flags with 0 (which is NM_SETTING_SECRET_FLAG_SYSTEM_OWNED)
is always going to be FALSE...  NM_SETTING_SECRET_FLAG_SYSTEM_OWNED is
special; because it's the default value if the key isn't present,
and at this point it's exclusive of all other flags.  So (at least for
now) it's OK that it's 0 but we might want to change it later so that
NM_SETTING_SECRET_FLAG_SYSTEM_OWNED can actually be used as a flag.
2011-01-31 19:20:16 -06:00
Dan Williams
d391e1fac3 keyfile: don't save agent-owned or always-ask secrets 2011-01-31 14:06:18 -06:00
Dan Williams
092a6535e0 libnm-util: add generic functions for getting/setting secret flags
And remove the VPN-specific ones.  It's useful to have this stuff be
generic and the functionality wasn't really VPN-specific anyway.
2011-01-31 12:41:54 -06:00
Dan Williams
562246cb80 libnm-util: fix handling of secrets flags
It's a bitfield, not a single value.  Update GObject property
max accordingly.
2011-01-31 12:36:53 -06:00
Gabor Kelemen
626943887d po: update Hungarian translation (bgo #640946) 2011-01-31 16:13:13 +01:00
Jiří Klimeš
d4b79f8b04 examples: add update secrets example 2011-01-31 14:04:04 +01:00
Dan Williams
f130089735 settings: use less memory in error handling of GetSecrets 2011-01-30 13:53:37 -06:00
Dan Williams
b285c6467a settings: simplify GetSecrets handling of sender UID
We've already gotten the UI when doing the PK auth checks, so
it's pointless to get it again.  Just pass the known UID through.
2011-01-30 13:49:56 -06:00
Dan Williams
3a97939525 settings: move agent code into settings directory
Since that's where it's used, and it doesn't need to be exposed
to any other code.
2011-01-30 11:00:33 -06:00
Dan Williams
5a7cf39a62 libnm-util: add secret flags for each secret describing how the secret is stored
This allows the necessary flexibility when handling secrets; otherwise
it wouldn't be known when NM should save secrets returned from agents
to backing storage, or when the agents should store the secrets. We
can't simply use lack of a secret in persistent storage as the indicator
of this, as (for example) when creating a new connection without
secrets the storage method would be abmiguous.

At the same time, fold in "always ask" functionality for OTP tokens
so user agents don't have to store that attribute themselves out-of-band.
2011-01-29 13:34:24 -06:00
Dan Williams
12908c8a1a docs: update libnm-glib docs for WiMAX 2011-01-28 17:41:59 -06:00
Dan Williams
5a14d17792 libnm-util: remove 802.1x PSK functions and defines
There was never a property for it anyway, so it never got serialized
across D-Bus, because it was folded into the "password" property in
wpa_supplicant between 0.5 and 0.6.
2011-01-28 13:48:54 -06:00
Dan Williams
d2329ef5f7 libnm-util: remove deprecated 802.1x cert blob functions 2011-01-27 18:45:21 -06:00
Dan Williams
89fcc757a4 libnm-util: remove deprecated GSM bits 2011-01-27 18:38:45 -06:00
Dan Williams
0e6a5365d4 core: move secrets handling to NMSettingsConnection
It's the thing that owns the secrets anyway, and it simplifies things to
have the secrets handling there instead of half in NMActRequest and
half in NMManager.  It also means we can get rid of the ugly signals
that NMSettingsConnection had to emit to get agent's secrets, and
we can consolidate the requests for the persistent secrets that the
NMSettingsConnection owned into NMSettingsConnection itself instead
of also in NMAgentManager.

Since the NMActRequest and the NMVPNConnection classes already tracked
the underlying NMSettingsConnection representing the activation, its
trivial to just have them ask the NMSettingsConnection for secrets
instead of talking to the NMAgentManager.  Thus, only the
NMSettingsConnection now has to know about the agent manager, and it
presents a cleaner interface to other objects further up the chain,
instead of having bits of the secrets request splattered around the
activation request, the VPN connection, the NMManager, etc.
2011-01-27 10:41:02 -06:00
Dan Williams
37a9303c2e libnm-util: fix hashing connections and settings
The first-level hash table key should be the setting name itself,
not the GType name of the setting's GObject.  There's probably a
better way to do this to reduce that confusion.
2011-01-27 10:37:01 -06:00
Dan Williams
4427774d57 agents: filter agents by UID for user-requested connections
When a user makes an explicit request for secrets via GetSecrets
or activates a device, don't ask other users' agents for secrets.
Restrict secrets request to agents owned by the user that made the
initial activate or GetSecrets request.

Automatic activations still request secrets from any available agent.
2011-01-26 18:36:08 -06:00
Dan Williams
68812f61d9 settings: request secrets from agents when clients call GetSecrets
A client calling GetSecrets on the connection should also request
secrets from agents in that client's session.  ie, a connection
editor should be able to call GetSecrets, and get the secrets
stored by the agent in that session (the applet).
2011-01-26 17:13:15 -06:00
Dan Williams
75af6105b7 settings: update signal prototypes
No functional change, but makes the internal API clearer.
2011-01-26 15:24:41 -06:00
Dan Williams
e68e27aa75 libnm-util: add 'flags' argument to nm_connection_to_hash() and nm_setting_to_hash()
Simplifies code internally, and makes it easier for clients as well in
some cases where they want to control what ends up in the resulting
hash and what does not.
2011-01-26 14:14:37 -06:00
Dan Williams
6fc469d74a agent: pass setting name back in secrets callback 2011-01-26 13:32:25 -06:00
Dan Williams
b3959aefa3 core: rename NMSysconfigConnection -> NMSettingsConnection 2011-01-26 11:38:12 -06:00
Dan Williams
b92e3cca6e build: fix distcheck with gobject introspection enabled 2011-01-26 11:26:08 -06:00
Dan Williams
d1979ba63e secrets: simplify GetSecrets call flow
The Settings.Connection interface is now only provided by NetworkManager
itself since there is only one settings service.  NM can validate
requests for secrets internally and thus there's no need to lock down
GetSecrets using a separate D-Bus interface, since PolicyKit provides
that functionality on systems where this is desirable (ie multi-user).
Single-user systems that do not have PolicyKit will inherently trust
the user already, or if not D-Bus auth is flexible enough to lock
down the GetSecrets method individually even if it's not on a separate
D-Bus interface.

Second, since only clients like connection editors or applets will be
calling the GetSecrets method, there's no need for 'hints' or
'request_new' arguments here since this  method should never trigger
an interactive secrets request.  Only NM should send those requests
when it knows it needs to ask the user, either during connection or
after validating the incoming GetSecrets request.  A connection editor
type application should never be able to trigger the normal
"What's your passphrase" dialog thats provided by the secret agent
for that user's session.
2011-01-26 10:17:07 -06:00
Dan Williams
4b6a86d748 dbus: remove obsolete interfaces from permissions 2011-01-26 09:58:22 -06:00
Jiří Klimeš
1f004c1122 ifcfg-rh: read/write IPv6 gateway in manual mode (rh #604334, rh #666078)
We only use IPV6_DEFAULTGW at the moment. That means we just support the
gateway for the first IPv6 address/subnet. That should be changed later
after we figure out what variables should be used.
2011-01-26 16:27:32 +01:00
Dan Williams
9806a92eaa trivial: fix some possible uninitialized variable usage in error cases 2011-01-25 15:41:14 -06:00
Dan Williams
b7259fd2a8 Merge remote branch 'origin/master' into rm-userset 2011-01-25 15:41:03 -06:00
Dan Williams
bc6fc7b910 vpn: fix VPN active connection D-Bus API handling (bgo #569294)
Due to limitations in dbus-glib, where one GObject cannot have more
than one introspection XML object attached to it, we used to include
more than one <interface> in the VPNConnection object introspection
XML.  This was suboptimal for two reasons:

1) it duplicated the Connection.Active introspection XML which
made it harder for clients to use the introspection data in a
dynamic fashion, besides looking ugly in the docs

2) not many other programs use this feature of dbus-glib, which
means it didn't get a lot of testing, and broke, which sucks
for NM.

To fix this issue, create a base class for NMVpnConnection that
handles the Connection.Active API, and make NMVpnConnection itself
handle just the VPN pieces that it layers on top.  This  makes
dbus-glib happy because we aren't using two <interface> blocks
in the same introspection XML, and it makes the NM code more
robust because we can re-use the existing Connection.Active
introspection XML in the NMVpnConnectionBase class.
2011-01-25 12:41:03 -06:00
Dan Williams
d884aadc3d doc: fix distcheck by cleaning generated files
Today, for some reason, the generated files are no longer cleaned up
or ignored during distcheck, so clean them up ourselves.  Not sure what
changed.
2011-01-25 12:40:18 -06:00
Dan Williams
398993e2f4 build: turn off set-but-not-used variable warnings in new GCC 2011-01-24 15:57:33 -06:00
Dan Williams
1e3a6c1311 ifcfg-rh: fix possible uninitialized variable usage 2011-01-24 15:55:10 -06:00
Dan Williams
a74189fd04 ifcfg-rh: fix possible uninitialized variable usage 2011-01-24 15:48:35 -06:00
Joan Duran
60ef505a70 po: update Catalan translation (bgo #640350) 2011-01-24 16:47:39 +01:00
Giovanni Campagna
3ebecd2a29 introspection: add GObject introspection support (bgo #637032)
Add the necessary annotations (the mininum required, that is those
on return values. NULL parameters or container types may require
more), and the Autotools stuff to get a NetworkManager GIR for
libnm-util and a NMClient for libnm-glib.
2011-01-21 14:46:09 -06:00
Giovanni Campagna
9067356856 core: fix policy handling of connections-loaded signal 2011-01-21 14:20:38 -06:00
Giovanni Campagna
c6bfe8edb6 libnm-glib: update symbol visibility list 2011-01-21 14:15:38 -06:00