Commit Graph

1021 Commits

Author SHA1 Message Date
Dan Williams
4475c79b00 libnm-util: bump soname to indicate ABI break 2011-02-12 23:24:30 -06: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
e08db5cae5 libnm-util: warn if trying to set NULL VPN secrets 2011-02-12 22:37:33 -06:00
Dan Williams
d61a312ca2 libnm-util: make sure NULL secrets don't slip in via g_object_set()
We already do this for nm_setting_vpn_add_secret()
2011-02-12 22:26:48 -06:00
Dan Williams
2ef55166c8 libnm-util: fix parsing permission if it includes detail 2011-02-11 23:05:53 -06:00
Dan Williams
c5235f87db libnm-util: add connection helpers for ID and UUID
Shortcuts.  Getting the ID and UUID is used in a ton of places
and this helps cut down on code.
2011-02-09 16:34:42 -06:00
Dan Williams
09d608b99c trivial: more spacing cleanups 2011-02-09 16:30:30 -06:00
Dan Williams
be628d9f9b trivial: spacing cleanups 2011-02-09 16:28:57 -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
bad3377131 libnm-util: update CDMA, GSM, and PPPoE settings for NOT_REQUIRED secrets 2011-02-07 19:16:54 -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
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
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
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
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
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
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
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
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
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
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
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
b92e3cca6e build: fix distcheck with gobject introspection enabled 2011-01-26 11:26:08 -06: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
Dan Williams
5dd4f1ea01 libnm-util: fix possible crash in nm_setting_update_secrets()
If a pointer to a valid GError was not passed the function could
crash.  Make it simpler and fix the possible crash by just converting
to hash table iters instead.
2011-01-19 18:17:40 -06:00
Dan Williams
2b65dcdf92 libnm-util: WiMAX setting requires a non-zero-length NSP name 2011-01-12 15:54:56 -06:00
Dan Williams
f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Dan Williams
694571a5c6 libnm-util: add defines for wifi modes 2011-01-09 02:00:29 -06:00
Dan Williams
0587ef1179 Merge remote branch 'origin/master' into wimax 2011-01-02 17:24:23 -06:00
Jiří Klimeš
b3800183b4 libnm-util: fix nm_utils_security_valid() checks for Ad-Hoc APs (rh #632123)
Without the fix fake Ad-Hoc APs created by nm-applet's "Create New Wireless
Network..." don't pass the check and nm-applet can crash.
2010-12-16 14:03:04 +01:00
Jiří Klimeš
d4ac3cd593 libnm-util: fix a memory leaks in nm_setting_to_string() 2010-12-13 20:55:02 +01:00
Dan Williams
09a6f45ead libnm-util: fix symbol visibility of nm_setting_connection_permissions_user_allowed 2010-11-18 12:29:50 -06:00
Dan Williams
ca063e4d0c libnm-util: add nm_setting_connection_permissions_has_user()
Utility function to determine whether a given username is in the ACL.
2010-11-18 10:36:18 -06:00
Dan Williams
cfaa80b261 Merge remote branch 'origin/master' into rm-userset 2010-11-16 18:08:48 -06:00
Dan Williams
389a297571 libnm-util: silence warning 2010-11-03 14:58:22 -05:00
Dan Williams
3d8b6acaba core: revert API parts of fe493ec91e
And add a default autoconnect retries value.
2010-11-03 13:23:09 -05:00
Jiří Klimeš
fe493ec91e core: add configurable auto connection retries (bgo #628825)
Presently, when automatic connecting fails, the connection is marked
as invalid and is not retried again. This commit adds a configuration
parameter to specify how many times the connection should be re-tried.
2010-11-03 16:22:55 +01:00
Dan Williams
8f699a77f2 libnm-util: check all valid permissions property types 2010-10-29 23:19:41 -05:00
Dan Williams
947efa3080 libnm-util: verify permissions property type
Connections are normally created from hashes using g_object_set()
which calls that object's set_property handler.  But GObject does
not allow errors to be returned from property handlers, so if the
type doesn't match what it should be, the property does not get
set, and error is printed to stdout, and life goes on.

But that's not what we want for the permissions property since the
client might expect that property to be set, but the connection now
is available to everyone.  So validate the permissions property
type (its really the only one we need to be so paranoid about)
and return an error when the incoming property type is wrong.
2010-10-29 22:31:23 -05:00
Dan Williams
8f7aedc7e0 Merge remote branch 'origin/master' into rm-userset 2010-10-18 19:02:27 -05:00
Dan Williams
82772191a9 libnm-util: simplify permissions somewhat; remove groups
Groups may come later, but they are also quite a bit more complicated
because getting the groups a user is in may require network access
if that user is backed by LDAP.  And it gets worse because you have
no idea that the glibc calls like getgrouplist(3) are backed by
the network and may take an arbitrary amount of time to complete.
Punt that.
2010-10-12 17:55:08 -05:00