Commit Graph

8762 Commits

Author SHA1 Message Date
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
b04d9e4675 libnm-util: assume VPN connections need secrets
Because most of the time they will.  They need special handling all
around anyway because only the VPN plugin itself knows whether the
connection needs secrets.
2011-02-09 00:52:47 -06:00
Dan Williams
d7a86ffd04 libnm-util: fix VPN update_one_secret()
The old function took a string value, which wasn't really correct as
the property type is a GHashTable of string:string.  For whatever
reason this is how nm-applet passed VPN secrets back to NM in the return
from the GetSecrets() D-Bus call.  This was probably easier or
something but it was a special case that's magic and quite unclear.

Since we use nm_connection_update_secrets() more these days, and we
depend on the GValue types we pass into it matching the property
types of the setting property the secret is for, we need to fix that
up for VPN connections.  But keep the old code for backwards
compatibility.

In the future secret agents should pass back VPN secrets in the same
form as the VPN setting specifies them for the "secrets" property:
a GHashTable of string:string.  But the old mechanism of just dumping
the key/value pairs into the returned VPN hash as string:string will
still work.
2011-02-08 20:12:55 -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
bad3377131 libnm-util: update CDMA, GSM, and PPPoE settings for NOT_REQUIRED secrets 2011-02-07 19:16:54 -06:00
Dan Williams
99766efbdc ifcfg-rh: read and write connection permissions 2011-02-07 18:58:19 -06:00
Dan Williams
007ca5bf1f settings: use new NMSettingConnection permissions helpers 2011-02-07 18:43:08 -06:00
Dan Williams
1c97de837a libnm-util: rework permissions helpers to be more useful
Add add/remove helpers, and make get more useful by actually breaking
down the specifics for us.
2011-02-07 18:35:48 -06:00
Dan Williams
75a1ab9a43 libnm-util: add utility functions for adding/removing permissions 2011-02-07 17:24:50 -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
ac208cafbd libnm-util: add NM_SETTING_SECRET_FLAG_NOT_REQUIRED
Not all connections will require every secret, and sometimes we
can't automatically figure out whether we need the secret.  For
vpnc sometimes the group password isn't used, and sometimes PPP
providers require a username but don't want a password, etc.
2011-02-07 13:50:40 -06:00
Dan Williams
ad56cfa914 libnm-util: don't return empty hashes from nm_setting_to_hash() 2011-02-07 13:44:28 -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
382cdfaf1e keyfile: namespace potentially conflicting symbols
Just in case.
2011-02-04 15:59:45 -06:00
Dan Williams
0ba142690a build: make sure nm-secret-agent.xml gets into the tarball 2011-02-02 21:39:03 -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
2e0fb2ae4e libnm-util: private keys are now required for TLS connections to verify
Since private keys are no longer secret, they must be given in the
connection itself.
2011-02-02 19:32:30 -06:00
Dan Williams
a5103bf234 libnm-util: silently ignore non-secrets when updating connection secrets 2011-02-02 17:25:56 -06:00
Dan Williams
c36c81e2b9 libnm-util: fix updating secrets
Broken by 5dd4f1ea01
2011-02-02 17:18:50 -06:00
Dan Williams
da47a2add4 ifcfg-rh: recognize WEP connections even if they dont have WEP keys yet
Just because the key isn't saved (ie, the user hasn't entered it yet,
or the user want to type it in every time) doesn't mean the setting isn't
WEP, so recognize it as WEP if DEFAULTKEY or SECURITYMODE is set.
2011-02-02 16:50:58 -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
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