Commit Graph

352 Commits

Author SHA1 Message Date
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
Dan Williams
37845af954 settings: return new connection object path from AddConnection
Finally.
2010-10-29 14:34:33 -05:00
Dan Williams
856a1c6b2c ifnet: fix memory leak 2010-10-29 14:01:22 -05:00
Dan Williams
28b17c8b4f ifnet: trivial cleanups 2010-10-29 13:58:23 -05:00
Dan Williams
8a6e2b6560 ifnet: constify tons of stuff
Use 'const char *' where appropriate.
2010-10-29 13:56:23 -05:00
Dan Williams
090329d0be ifnet: fix include name broken by 3f64bf5e36 2010-10-29 11:02:56 -05:00
Dan Williams
d1faa496d0 ifcfg-rh: remove unused UDI stuff 2010-10-28 09:29:16 -05:00
Dan Williams
3f64bf5e36 settings: rename NM_SYSCONFIG_SETTINGS_ERROR -> NM_SETTINGS_ERROR 2010-10-27 20:38:26 -05:00
Dan Williams
83ab4ec2ee settings: system-settings -> settings 2010-10-27 20:22:14 -05:00
Dan Williams
8f7aedc7e0 Merge remote branch 'origin/master' into rm-userset 2010-10-18 19:02:27 -05:00
Dan Williams
be97e7f104 build: include <config.h> for kill(2), isblank(3), and isascii(3)
config.h defines _GNU_SOURCE, which in turn defines the bits necessary
for kill, isblank, and isascii.  So wherever we use those, we need
to make sure config.h is included.
2010-10-08 22:46:55 -05:00
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
8b41f70dd5 Merge remote branch 'origin/master' into rm-userset 2010-09-27 10:30:46 -05: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
6e287e4179 Merge remote branch 'origin/master' into rm-userset 2010-09-16 17:10:49 -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
Dan Williams
f58f2d7f39 ifnet: update for settings rework 2010-08-26 15:10:29 -05:00
Dan Williams
022d8e665c Merge remote branch 'origin/master' into gsoc 2010-08-26 09:18:37 -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
Daniel Gnoutcheff
7f8dc06dff remove nm-settings-connection-interface
NMSettingsConnectionInterface was created to allow the daemon and NM
clients to have common code that handled both system and user
connections. It's no longer needed now that user settings services are
gone.

This concludes the flattening of libnm-glib.
2010-08-06 20:53:37 -04:00
Daniel Gnoutcheff
bbd4c23213 split nm_sysconfig_connection_update
The various "update" functions implemented by NMSysconfigConnection have
become confusing.  Depending on how you count, we've wound up with about
4 functions that all share the name "update" but nonetheless do
different things.  These functions used to be distributed over several
interfaces implemented by NMSysconfigConnection, but now that we've
removed NMExportedConnection and are about to remove
NMSettingsConnectionInterface, they will be all crammed into a single
interface and will be even more confusing than before.  It's time to
give better names to these guys.

The renames planned are:

- nm_settings_connection_interface_update() -->
    nm_sysconfig_connection_commit_changes()

- nm_sysconfig_connection_update() with signal_update==FALSE -->
    nm_sysconfig_connection_replace_settings()

- nm_sysconfig_connection_update() with signal_update==TRUE -->
    nm_sysconfig_connection_replace_and_commit()

This commit performs the last two renames.  The first will be performed
when removing NMSettingsConnectionInterface.

We also have nm_sysconfig_connection_replace_and_commit() have an
async-ish API that accepts a callback. This fits nicely with the
async-ish API of nm_settings_connection_interface_update(), and it lets
us clean up pk_update_cb() a bit.
2010-08-06 13:05:47 -04:00
Daniel Gnoutcheff
a4af7967c9 ifupdown: get_secrets: don't override DBus handler
ifupdown only supports secrets for wireless connections, so attempts to
get non-wireless secrets need to fail. Previously, this was accomplished
by overriding NMSysconfigSettingsClass->get_secrets, the handler for
DBus GetSecrets() method calls. This had some problems:

- It created an information leak. The first thing the
  NMSysconfigConnection implementation does is verify that the caller is
  authorized to get secrets information, but nm-ifupdown-connection ends
  up performing its additional check before authorization happens. Thus,
  unauthorized users are able to determine that some connections don't
  have secrets.  This will become more significant when secrets handling
  is revamped.

- We'd really like to devirtualize these DBus method call handlers.
  They were inherited from from NMRemoteConnection, where we needed
  these functions to be virtual so that user and system settings
  services could implement them differently.  That is no longer needed.
  ifupdown was the last place were we actually "needed" these functions
  to be virtual.

With this commit, we fix these problems by overriding
nm_settings_connection_interface_get_secrets instead.
2010-08-06 13:05:47 -04:00
Daniel Gnoutcheff
c2f4b10ab5 libnm-glib: remove NMSettingsInterface
NMSettingsInterface was created to allow code to operate on a settings
service without caring about what kind of settings service it was. Now
that we have just one settings service, this is no longer needed.

More work needs to be done in order to handle errors and permission
settings in an appropriate manner.
2010-08-06 13:05:47 -04:00
Daniel Gnoutcheff
aee48901f4 Merged NM{Exported,Sysconfig}Connection
In continuation of the theme, the removal of user settings services
means that the distinction between NMSysconfigConnection and
NMExportedConnection is no longer needed. Merge NMExportedConnection
into NMSysconfigConnection.
2010-08-06 13:05:46 -04:00