Commit Graph

353 Commits

Author SHA1 Message Date
Jiří Klimeš
088454fcab ifcfg-rh: fix assertion failure when IP4 setting is missing while writing connection 2010-09-30 15:13:39 +02:00
Dan Williams
b80f31e191 trivial: typo fixes
Sent by a Debian user to Michael Biebl.  No other attribution
information available.  Thanks Debian user!
2010-09-25 00:34:10 -05:00
Dan Williams
6f2aa8a817 ifupdown: return NULL hostname, not a zero-length string 2010-09-24 18:54:37 -05:00
Dan Williams
da3d920d97 keyfile: read and write SSIDs as strings by default
Keep compat with old format if the SSID includes unprintable
characters.  But having to type an int list for an SSID is just silly
and it's about damn time we fix that.
2010-09-16 18:27:19 -05:00
Dan Williams
7f4a7a62c4 keyfile: clean up directory structure
The IO library was in io/ because I was too lazy to find autotools'
SUBDIRS rules at the time and that you could use '.' for the current
directory.  Fix that and use its own error defines instead of
the system settings service.  Clean up a for more things for good
measure too (like KEYFILE_DIR, etc).
2010-09-16 17:39:06 -05:00
Dan Williams
c40d79ae97 keyfile: be chattier, especially about parsing errors
This should help people debug issues with keyfile not recognizing
files since it'll actually print out something when it fails to
parse stuff.  Also logs changes, new connections, and deletions.
2010-09-16 15:44:06 -05:00
Mu Qiao
38f3e5ca61 ifnet: add Gentoo system settings plugin 2010-08-24 12:09:30 -05:00
Dan Williams
ba355b6a7e ifupdown: make testcase parsing quiet
Removes messages about invalid ENI formatting when running the
testcases.
2010-08-12 22:44:07 -05:00
Peter Marschall
a5b77939fb ifupdown: make parser for /etc/network/interfaces more robust
The previous implementation of the parser for /etc/network/interfaces had
quite a few drawbacks:
- it expected the lines to be terminated with "\n", even the last line
- it ignored line wraps with "\\" followed by "\n"
- it expected over-long lines to be shorter than 510 characters
- it ignored line wraps on over-long lines
- it treated spaces and tabs differently
- it did not make sure to really tokenize on word boundaries
- it treated the equivalent stanzas "auto" and "allow-auto" differently
- it ignored the fact that the "allow-*" stanzas can take multiple arguments
  that need to be separated to be recognized NetworkManager's processing later
- it allowed "non-block" stanzas to appear before a block

This patch is a rewrite of the parser to fix the issues mentioned:
- it accepts the last line even if it is not terminated by "\n"
- it skips over-long lines, emits a warning and even takes into account
  that over-long lines may be wrapped to next lines
- it un-wraps wrapped lines
- it uses spaces and tabs equivalently to tokenize the input
- it treats "allow-auto" as a synonym to "auto"
- it splits multi-argument "auto"/"allow-*" into multiple
  single-argument stanzas of the same type
- it warns on data stanzas before the first block stanza
2010-08-12 22:41:05 -05:00
Dan Williams
4397f4463a ifupdown: add ifparser testcases
ENI snippets from Peter Marschall <peter@adpm.de>
2010-08-12 22:35:13 -05:00
Dan Williams
e386548132 ifupdown: split parsers into convenience library for easier testcase creation 2010-08-12 18:15:21 -05:00
Dan Williams
d500eaa33b ifcfg-rh: add testcase for DHCPv6 only mode 2010-08-10 16:35:19 -05:00
Dan Williams
9bed26b856 ifcfg-rh: unmanaged connections should be invisible to ifup too (rh #619863)
The plugin does not expose them to NM, and it shouldn't expose them to
ifup either.  The world should be consistent :)
2010-08-10 00:31:33 -05:00
Dan Williams
7ed22185dd ifcfg-rh: bridge components are now expected to provide a valid connection
They aren't ignored if they have HWADDR due to commit
46696c22ca32999ec09d1ac395e8f043522fdf2d
(ifcfg-rh: correct handling of BRIDGE and VLAN unmanaged connections (rh #619863))
2010-08-09 13:48:01 -05:00
Dan Williams
a4a554a51b Revert "ifcfg-rh: testcases for unmanaged BRIDGE and VLAN"
This reverts commit 007e134594.
2010-08-09 13:47:52 -05:00
Dan Williams
3e48229208 ifcfg-rh: correct handling of BRIDGE and VLAN unmanaged connections (rh #619863)
For those ifcfg files that do have HWADDR and thus can have their
device be unmanaged, we want to read in a much of the connection as
possible since unmanaged devices are tracked via internal NMIfcfgConnection
objects.  For BRIDGE/VLAN ifcfg files that don't have HWADDR, we do
want to ignore them completely, but also return a useful error
message.
2010-08-09 13:23:01 -05:00
Dan Williams
c009759f9b ifcfg-rh: emit the right message when ignored connections are deleted
Previously the code would assume that if the ifcfg file had no backing
connection that we should try to read it in regardless of what the
inotify event was.  But if the event was DELETED, there's no point in
trying to read a deleted file in; it's gone.  Don't print bogus
warnings about failure to read the long-gone ifcfg file.
2010-08-09 13:22:56 -05:00
Dan Williams
97199ae3e3 ifcfg-rh: ignore .augnew and .augtmp files used by netcf 2010-08-09 13:22:51 -05:00
Dan Williams
0ebeaaf1cb ifcfg-rh: clarify comment about unmanaged connections 2010-08-04 16:59:24 -05:00
Dan Williams
4cdf7468d3 ifcfg-rh: ensure BRIDGE and VLAN connections get completely ignored
Unlike NM_CONTROLLED=no connections we don't even want to both with
these when their devices aren't supposed to be managed.
2010-08-04 16:55:52 -05:00
Dan Williams
007e134594 ifcfg-rh: testcases for unmanaged BRIDGE and VLAN 2010-08-04 16:42:38 -05:00
Dan Williams
5e88c45925 ifcfg-rh: use IFCFG_PLUGIN_ERROR instead of ifcfg_plugin_error_quark ()
Trivial cleanup.
2010-08-04 16:27:34 -05:00
Dan Williams
b103cd34fa ifcfg-rh: be more careful about rewriting ifcfg files
Kind of a hack for now, would be better to push down a flag about
whether the update request came in from D-Bus, internally, or from
inotify, but that's a lot more invasive.
2010-08-04 16:23:36 -05:00
Dan Williams
49103db979 ifcfg-rh: require fewer parameters to connection_from_file() 2010-08-04 16:23:18 -05:00
Dan Williams
b66d5dd3e6 ifcfg-rh: treat BRIDGE and VLAN connections as unmanaged (rh #619863)
Treat them as unmanaged for now so that they dont' need NM_CONTROLLEd=no
which would require further configuration when NM does start to support
these configs.
2010-08-04 16:01:01 -05:00
Daniel Gnoutcheff
75822319bd ifupdown: fix connection class inheritance
NMIfupdownConnection really is a subclass of NMSysconfigConnection (as
declared via the G_DEFINE_TYPE macro in nm-ifconfig-connection.c), but
the header incorrectly used NMExportedConnection* in the class and
instance structs. We got away with it because NMSysconfigConnection*
didn't contain anything other than the stuff inherited from
NMExportedConnection*, but it would have caused much trouble if we did
add something.
2010-08-04 01:54:10 -05:00
Dan Williams
43c6800b35 ifcfg-rh: ignore BRIDGE and VLAN configs until we support them (rh #619863) 2010-08-03 16:17:45 -07:00
Dan Williams
4898f8cd3d Merge remote branch 'origin/zvm' 2010-08-03 15:49:31 -07:00
Pablo Castellano
ce5c0d5ac6 build: enable AM_SILENT_RULES (bgo #625263) 2010-08-03 12:58:46 -07:00
Dan Williams
3dcf858c04 Merge remote branch 'origin/master' into zvm 2010-07-28 08:59:47 -07:00
Daniel Gnoutcheff
2ffa6a830e keyfile: correctly send the 'update' signal
For exported connections, nm_settings_connection_interface_update() is
supposed to cause the emission of a
NM_SETTINGS_CONNECTION_INTERFACE_UPDATED signal.  This is usually done
by chaining up to the NMExportedConnection implementation of this
method, which actually emits the signal.  However, the
NMKeyfileConnection implementation usually forgot to do this.  Rewrite
so that we always chain up after successfully saving settings.
2010-07-28 02:28:45 -07:00
Dan Williams
4d43ce8fa0 Merge remote branch 'origin/master' into zvm 2010-07-27 23:24:10 -07:00
Dan Williams
bebf8d48b0 Revert "ip6: remove standalone DHCP method since DHCPv6 can't provide gateways" (rh #612445)
This reverts commit a729d2f649.

Turns out this is a valid IP config method that some sites use.
2010-07-27 21:43:42 -07:00
Dan Williams
fbdb963f04 ifcfg-rh: fix testcase format string
From Andrey Borzenkov <arvidjaar@gmail.com>
2010-07-22 16:26:34 -07:00
Dan Williams
16bccfd672 core: handle s390 options more cleanly
There are so many... so handle them as a table of key/value pairs
instead of having separate functions for each one.  At the moment
nothing but subchannels is used internally, but this allows plugins
to preserve options that NM doesn't care about when reading/writing
system configuration.
2010-06-29 00:37:14 -07:00
Dan Williams
cdf8c079ef ifcfg-rh: read and write various s390 settings 2010-06-25 23:46:47 -07:00
Dan Williams
ac9d2804bd Merge remote branch 'origin/master' into zvm 2010-06-25 19:57:30 -07:00
Dan Williams
91ab673b5c ifcfg-rh: ensure SSIDs don't get double-quoted when written out (rh #606518) 2010-06-25 09:56:53 -07:00
Jiří Klimeš
1b49f941a6 core: MAC address spoofing/cloning (rh #447827) (bgo #553771)
This commit implements MAC cloning feature in NetworkManager. To support that,
'PermHwAddress' property is added into *.Device.Wired and *.Device.Wireless
interfaces. The permanent MAC address is obtained when creating the device, and
is used for 'locking' connections to the device. If a cloned MAC is specified
in connection to be activated, the MAC is set to the interface in stage1. While
disconecting, the permanent MAC is set back to the interface.
2010-06-22 14:21:25 +02:00
Jiří Klimeš
a8e0c2637b ifcfg-rh: test case for WEP ASCII keys 2010-06-22 12:51:02 +02:00
Dan Williams
0b41797b49 s390: replace 'zvm' with s390
ZVM isn't the right terminology here.  s390 is.
2010-06-17 21:24:14 -07:00
Dan Williams
a5d8872c3e Merge remote branch 'origin/master' into zvm 2010-06-17 21:14:09 -07:00
Jiří Klimeš
4e02c67a94 ifcfg-rh: fix reading/writing ASCII WEP keys
ifcfg-rh plugin didn't prepend 's:' prefix when writing out ASCII WEP
keys. That rendered the keys file invalid. Moreover, the reading part
was incorrect too not having recognized correct ASCII keys.
2010-06-17 14:57:25 +02:00
Dan Williams
e22346b9d0 ifcfg-rh: handle z/VM subchannels (rh #591533) 2010-05-26 17:35:57 -07:00
Dan Williams
c9ee78f238 keyfile: add testcases for plain GSM connections 2010-05-26 01:19:21 -07:00
Dan Williams
11d63b63f2 keyfile: fixups for msising settings for mobile broadband 2010-05-26 01:03:38 -07:00
Dan Williams
d422ce42c4 keyfile: add testcase for BT DUN connection 2010-05-26 00:39:58 -07:00
Dan Williams
23736bc73c keyfile: add required PPP setting for serial-based connections 2010-05-26 00:34:12 -07:00
Dan Williams
7b6a898967 keyfile: ensure wired setting gets added if it's all default values
If the wired setting isn't modified at all from the default values
it won't get written out anymore after 12dcc07b74,
so make sure we include it when necessary.
2010-05-26 00:10:42 -07:00
Dan Williams
12dcc07b74 keyfile: don't write out default values 2010-05-25 23:34:39 -07:00