Commit Graph

389 Commits

Author SHA1 Message Date
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
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
cba20a98ca keyfile: use defines instead of strings for Removed signal 2011-02-11 22:26:09 -06:00
Dan Williams
67051f6445 keyfile: don't write not-saved or not-required VPN secrets
VPN secrets need special handling here since they are in a 3rd
level hash.
2011-02-10 18:43:20 -06:00
Dan Williams
d871512467 ifcfg-rh: handle different connections with the same ID
Since ifcfg-rh uses the connection's ID as the filename by default,
we could run into a situation where two connections with the same
ID are visible to different users.  We don't want one connection
overwriting the other in that case, so we need to pick a new name
for the one we're about to write.
2011-02-09 20:44:27 -06:00
Dan Williams
275e5c5e62 keyfile: handle different connections with the same ID
Since keyfile uses the connection's ID as the filename by default,
we could run into a situation where two connections with the same
ID are visible to different users.  We don't want one connection
overwriting the other in that case, so we need to pick a new name
for one of them.  Append the connection's UUID to the end to
minimize the risk of further conflicts for that name.
2011-02-09 18:09:47 -06:00
Dan Williams
eddc66e36d keyfile: split nm_keyfile_plugin_write_connection()
The non-test function doesn't need to take as many arguments, which
makes the code a lot cleaner to look at in the plugin and connection
subclass.
2011-02-09 17:23:10 -06:00
Dan Williams
f1d0293517 keyfile: trivial code simplification 2011-02-09 17:11:13 -06:00
Dan Williams
d654836c6f keyfile: require a UUID in the connection settings
The connection needs a UUID, period.
2011-02-09 17:07:43 -06:00
Dan Williams
a96b4c5082 keyfile: use nm_connection_get_id() more 2011-02-09 17:07:24 -06:00
Dan Williams
3ea9458016 keyfile: use nm_connection_get_id() and nm_connection_get_uuid() 2011-02-09 16:41:33 -06:00
Dan Williams
99766efbdc ifcfg-rh: read and write connection permissions 2011-02-07 18:58:19 -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
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
5bc105e139 ifcfg-rh: don't save agent-owned or always-ask secrets 2011-01-31 20:35:37 -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
b3959aefa3 core: rename NMSysconfigConnection -> NMSettingsConnection 2011-01-26 11:38:12 -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
b7259fd2a8 Merge remote branch 'origin/master' into rm-userset 2011-01-25 15:41:03 -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
Dan Williams
519b1ea61d keyfile: namespace commonly-named functions (bgo #639537)
Now that keyfile is built in, we may have symbol naming conflicts
with the other plugins where code was copied & pasted around.  Fix
that by namespacing common function names in the keyfile plugin.

Thanks to Giovanni Campagna for pinpointing the issue.
2011-01-18 13:22:00 -06:00
Dan Williams
e041fabcfd ifcfg-rh: don't try to parse non-ifcfg files at startup 2011-01-17 23:12:24 -06:00
Dan Williams
3e8547ff1b ifcfg-rh: fix crash on ignored file change
Don't crash when a file we don't care about changes.
2011-01-17 23:11:51 -06:00
Dan Williams
b38f39cfc6 core: build keyfile plugin into NetworkManager
Since settings storage is now handled by NetworkManager, we must
have the ability to read/write all connection types at all times.
Since the 'keyfile' plugin is the only plugin that can handle all
connection types, build it into NetworkManager.
2011-01-12 18:12:23 -06:00
Dan Williams
f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Mu Qiao
aaa54c65a8 ifnet: fix memory leak; handle file format changes 2011-01-11 12:33:37 -06:00
Radek Vykydal
b46cf443c0 ifcfg-rh: respect GATEWAYDEV for ibft/iSCSI configs too (rh #665027) 2011-01-11 09:54:29 -06:00
Dan Williams
16a8a951e9 ifcfg-rh: PSK isn't necessary for valid WPA connection
We'll ask secret agents for it if it's not stored in the connection.
2010-12-14 15:26:40 -06:00
Dan Williams
ff101f4946 settings: remove callback from nm_sysconfig_connection_get_secrets()
No reason it needs to use the callback pattern anymore.
2010-12-12 21:17:34 -06:00
Michael Biebl
898e08eef1 ifupdown: Allow to mark bridge ports as unmanaged (debian #530335)
Parse bridge configurations in /etc/network/interfaces and add
interfaces defined via bridge_ports to well_known_interfaces. This
allows to mark those interfaces as unmanaged if managed=false.
The "all" keyword and regexes are not supported and simply skipped.

Example:
iface br0 inet manual
	bridge_ports eth0 eth1 (→ eth0/1 will be marked as unmanaged)

See also:
http://manpages.ubuntu.com/manpages/maverick/man5/bridge-utils-interfaces.5.html

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530335
2010-12-09 00:15:17 -06:00
Michael Biebl
1939209759 ifupdown: Correctly mark unmanaged devices (debian #569215)
If we find a "iface ..." line, add the interface to
well_known_interfaces no matter if there is a connection for it or not.

Otherwise we fail to mark devices as unmageded in cases like

iface wlan0 inet manual
	wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

as NM does not know how to parse such a interface configuration.

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569215
2010-12-09 00:13:37 -06:00
Andrey Borzenkov
bfbf5ef374 ifcfg-rh: fix missing connections when an unmanaged interface was present
Don't emit "unmanaged-specs-changed" signal in read_one_connection(),
because it causes that next connections are not listed (get_connections() is
called prematurely and only connections read so far are available).
Steps to reproduce the bug:
1) create ifcfg-fake
DEVICE=loremipsum
HWADDR=01:02:03:04:05:06
NM_CONTROLLED=no
2) restart NetworkManager
3) only connections read *before* ifcfg-fake are available

Thanks to Robert Vogelgesang <vogel@users.sourceforge.net> for updating
the patch and analysis!
2010-12-06 15:55:48 +01:00
Jiří Klimeš
6903571160 ifcfg-rh: allow missing and 0.0.0.0 GATEWAYn lines in ifcfg-routes (rh #647992)
GATEWAY0=0.0.0.0 was erroneously denied. Also, missing GATEWAY0 entry caused
ifcfg-rh plugin to regard the connection as invalid. The commit fixes that and
makes it behave in accordance with initscripts.
2010-11-24 17:24:28 +01:00
Jiří Klimeš
8c9a124e72 keyfile: allow uppercase MAC addresses in unmanaged-devices in config file (rh #654714) 2010-11-23 16:33:11 +01:00
Dan Williams
3391a00354 core: fix up merge damage 2010-11-16 18:23:27 -06:00
Dan Williams
cfaa80b261 Merge remote branch 'origin/master' into rm-userset 2010-11-16 18:08:48 -06:00
Jiří Klimeš
d32a29ec52 ifcfg-rh: quiet ifcfg-rh plugin when re-read connection is the same as in-memory one
It occurs, for example, when NM updates connection's timestamp.
2010-11-10 17:28:36 +01:00
Jiří Klimeš
0376f6b1ce keyfile: ignore temporary files (bgo #602868)
Ignore temporary files created by vim editor and temporary files created
internally by g_file_set_contents() (mkstemp()) when writing connections.
2010-11-10 16:21:25 +01:00
Dan Williams
c580444fd7 keyfile: quiet keyfile plugin when re-read connection is the same as in-memory one
It occurs, for example, when NM updates connection's timestamp.
2010-11-10 16:14:51 +01:00
Dan Williams
e8da63889b keyfile: create keyfile data directory during install
So distributions don't have to do it.
2010-11-08 09:07:08 -06:00
Jiří Klimeš
579ec4e026 ifcfg-rh: remove unused D-Bus calls from ifcfg-rh tests 2010-11-08 11:34:26 +01:00
Ozan Çağlayan
6fd3c0d576 keyfile: remove unused D-Bus calls from test-keyfile.c 2010-11-08 11:26:51 +01:00
Jiří Klimeš
6e067a9d2b ifcfg-rh: ignore temporary files with ';[a-fA-F0-9]{8}' suffix created by rpm (rh #598203) 2010-11-02 12:15:54 +01:00
Dan Williams
b93cad0149 keyfile: propagate errors from updating new connection settings 2010-10-29 23:16:04 -05:00
Dan Williams
d3e640eacf ifcfg-rh: propagate errors from updating new connection settings 2010-10-29 23:15:38 -05:00
Dan Williams
034aee641a ifcfg-rh: fix possible warning
'added' won't always be valid, and thus the GObject typecast could fail.
Use a C typecast instead.
2010-10-29 23:14:42 -05:00
Dan Williams
c2ca4298fa ifcfg-rh: ensure connection is still alive for the removal signal 2010-10-29 16:58:07 -05:00