Commit Graph

7207 Commits

Author SHA1 Message Date
Jiří Klimeš
6fb021d5ea core: log the error when nm_settings_new() fails 2011-02-14 17:18:13 +01:00
Dan Williams
6d344a43e9 Merge remote-tracking branch 'origin/rm-userset'
There; it's merged.  Yay!
2011-02-12 22:51:12 -06:00
Dan Williams
f82f0aa654 settings: fix NewConnection signal emission 2011-02-11 22:26:14 -06:00
Dan Williams
4d2957b3ae settings: fix NMSettingsConnection D-Bus Remove signal emission
We can't unregister the object with the bus during the remove signal,
because dbus-glib doesn't send the signal out over the bus until late
in the signal emission process, after we've unregisterd the object.
Thus the signal doesn't go out.  Fix that.
2011-02-11 22:26:12 -06:00
Dan Williams
76147fc5e1 settings: use the right permission for connection updates that change visibility
Make sure to use modify.system if the Update request changes the
visibility of the connection, since that update request would
affect more users than just the caller.
2011-02-11 22:26:08 -06:00
Dan Williams
a21c01a243 settings: check harder for system-owned secrets when validating agents
Can't just check whether we have existing system secrets, because
that doesn't catch the case for a completely new connection where
there may not be any secrets yet, but any that we do get should
be system-owned.
2011-02-11 22:26:07 -06:00
Dan Williams
dede4d3948 settings: fix warnings when no existing secrets are present
Since the hash table will be NULL in that case, don't try to do
anything with it.
2011-02-11 22:26:06 -06:00
Dan Williams
562dc6e0b6 settings: check modify 'own' not 'system' for personal connections
When a connection is visible only to one user, check 'own' instead
of 'system', allowing 'own' to be less restrictive since the change
won't affect any other users.
2011-02-11 22:26:05 -06:00
Dan Williams
2e2b4373eb core: add ulong data helpers to NMAuthChain
Otherwise callers would have to do the work themselves to ensure that
the top 32 bits of the ulong didn't get chopped off on 32-bit
platorms.
2011-02-11 16:43:03 -06:00
Dan Williams
016c56078d policy: rename HOSTNAME_MODIFY -> MODIFY_HOSTNAME for consistency 2011-02-11 11:32:57 -06:00
Dan Williams
ba8f562836 policy: add a "modify own" permission for single-user-visible connections
This policy will allow users to modify their personal connections (ie
maybe VPN connections, etc) distinctly from system-wide connections that
affect more than just their user.  It makes sense to be more lenient when
making changes to settings that don't affect other users.
2011-02-11 11:31:14 -06:00
Dan Williams
f2c317e3d2 policy: rename "modfiy" permission to "modify system"
Meaning stays the same, but this will allow us to differentiate
in the future between personal connections (ie, just visible to
one user) and system connections (visible to more than one user).
2011-02-11 11:19:02 -06:00
Dan Williams
e42e392418 settings: ensure not-saved or not-required VPN secrets don't propagate
We don't want these secrets in the NMSettingsConnection's internal
secrets cache since they shoulnd't ever be read off-disk, and they
should be discarded immedaitely after use.  Similarly, we want to
remove any of these secrets that do come through from a secrets
request that doesn't allow user-interaction, since not-saved secrets
aren't allowed there.
2011-02-10 18:45:13 -06:00
Dan Williams
2ec115bb64 vpn: clear secrets after successful activation
We're already connected; shouldn't need secrets again but
if we do, we'll ask for them again.  Fixes an issue where
reconnect would use an old one-time-password.
2011-02-10 18:07:04 -06:00
Dan Williams
ee2c19a64f agents: correctly handle VPN secrets when marking them as not required
We need to iterate through each item in the VPN's 'secrets' property
and mark it as not required, instead of just marking the 'secrets'
property itself as not required.  Yeah, VPN secrets are a bit
annoying.
2011-02-10 11:36:00 -06:00
Dan Williams
9d2889a4a7 agents: send available secrets to the agents
The caller has already taken care of making sure that the
agent is privileged enough to have secrets, so send them along
if the caller gave them to us.
2011-02-10 11:34:35 -06:00
Dan Williams
a6edda0b13 vpn: more logging during secrets requests 2011-02-10 11:34:13 -06:00
Dan Williams
1f313f36f0 settings: do some basic validate in AddConnection
Like making sure the connection verifies, and making sure the
new connection's UUID is indeed unique.
2011-02-09 18:41:48 -06:00
Dan Williams
db41fe3cf2 settings: add error for already existing UUID 2011-02-09 18:41:17 -06:00
Ozan Çağlayan
e9c8ba4e3d trivial: fix RFKILL log domain manpage and help text 2011-02-09 10:56:14 -06:00
Ozan Çağlayan
9049358579 logging: don't print extraneous newline in syslog 2011-02-09 10:52:28 -06:00
Dan Williams
aafe74ee34 vpn: get existing secrets before asking VPN service if we need more
This allows administrators to define VPN connections that use all
or partial system-owned secrets that users aren't allowed to modify.
2011-02-09 00:54:00 -06:00
Dan Williams
b94fb03197 settings: mark secrets as not required if they aren't sent to an agent
If the agent doesn't have privileges for secrets, mark them as not
required to help any UI validation the agent might have to do.
2011-02-07 23:45:19 -06:00
Dan Williams
007ca5bf1f settings: use new NMSettingConnection permissions helpers 2011-02-07 18:43:08 -06:00
Dan Williams
d8cbecec8b settings: streamline system-owned secret handling during agent requests
Do the check for system-owned secrets once, before kicking off the
request, instead of each time we ask an agent.  As a bonus, this
change ensures priv->secrets doesn't store anything except
system-owned secrets too, simplifying some checks later on.
2011-02-07 13:58:05 -06:00
Dan Williams
899b8a40dc libnm-util: NM_SETTING_SECRET_FLAG_SYSTEM_OWNED -> NM_SETTING_SECRET_FLAG_NONE
Make it a bit clearer that this value is not actually a value that
can be used as a flag, since its 0x00.
2011-02-06 23:37:39 -06:00
Dan Williams
e2d297e5ff settings: fix loading of keyfile connections
Updating unmanaged specs may cause load_connections() to be called,
and the keyfile plugin needs to be registered before that.
2011-02-02 20:32:15 -06:00
Dan Williams
77239854f4 agents: send system-owned secrets to the agent if it has 'modify' permission
If we can authenticate the agent for 'modify' permission, then send
any existing system secrets to it as the user has permission to change
those secrets.  This means the agent doesn't have to call GetSecrets()
itself, which means simpler code on the agent side for a slight LoC
hit in NM itself.

This also moves the permissions checking into the NMAgentManager to
check each agent, which is sub-optimal since now the agent manager
has to do PolicyKit stuff, but hey that's life.  Agents need secrets,
and we do need to authenticate every agent before we send secrets to
them, and the NMSettingsConnection doesn't know about individual
agents at all.
2011-02-02 16:19:15 -06:00
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
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
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
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
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
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
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
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
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