Commit Graph

7207 Commits

Author SHA1 Message Date
Dan Williams
92babdb658 core: work around dbus-glib property access bug (CVE-2010-1172) (rh #585394)
More info:
https://bugzilla.redhat.com/show_bug.cgi?id=585394
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-1172

dbus-glib was not properly enforcing the 'access' permissions on
object properties exported using its API.  There were 2 specific bugs:

1) dbus-glib did not enforce the introspection read/write property
permissions, so if the GObject property definition allowed write
access (which is sometimes desirable), D-Bus clients could modify
that value even if the introspection said it was read-only

2) dbus-glib was not filtering out GObject properties that were
not listed in the introspection XML.  Thus, if the GObject defined
more properties than were listed in the introspection XML (which is
also often useful, and NM uses this quite a bit) those properties
would also be exposed to D-Bus clients.

To fix this completely, you need to:

1) get dbus-glib master when the patch is commited, OR grab the
patch from https://bugzilla.redhat.com/show_bug.cgi?id=585394 and
build a new dbus-glib

2) rebuild NetworkManager against the new dbus-glib
2010-08-11 15:54:08 -05:00
Dan Williams
96a9ce41fb core: ensure dhcp_manager exists before trying to unref it (bgo #626610)
If a new device wasn't supported, it gets destroyed by the
NMDevice constructor() method.  But in the constructor paths
the DHCP manager isn't created yet, and so we attempt to unref
a non-existent DHCP manager.  Usually just a harmless warning,
but apparently a crash sometimes.
2010-08-11 13:12:19 -05:00
Dan Williams
17f630d433 ip6: handle DHCPv6 initial routing better
DHCPv6 doesn't really use broadcast; instead clients use reserved
multicast addresses to talk to the server.  ff02::1:2 (link scope)
and ff05::1:3 (site scope) are used.  This means the routing table
has to have a route that can handle outgoing traffic to these
addresses, which is ff00::/8.  The kernel sometimes adds one for us,
so we need to (a) make sure we don't tear that route down, and
(b) that if it's not there before we start DHCPv6, that we add it.

Otherwise dhclient complains about not being able to send outgoing
traffic from it's send_packet6() function with "no route to host".
It will then use an expired lease, which causes NM to assign that
leases IP address to the interface, whcih causes the kernel to
assign the required ff00::/8 route, and then dhclient performs a
renew (since the expired lease has expired of course) and then
everything works out in the end.  But the latency sucks.

So make DHCPv6 faster by ensuring that dhclient has the routes
it needs before we start the DHCP session.
2010-08-10 21:37:47 -05:00
Dan Williams
41804010d6 build: fix compilation with glib >= 2.25.12
WOrk around glib API breakage.
2010-08-10 13:46:18 -05:00
Dan Williams
11ed2f737f core: don't select s390 subchannel-locked connections on non-s390 devices
The autoactivation code wasn't excluding subchannel-locked connections
when matching for devices that don't have subchannels.  This only
produced a warning message though as the connection activation would
be failed by the check_connection_compatible hook.
2010-08-10 00:31:46 -05:00
Dan Williams
1a3381df3e core: ensure we recheck autoactivation on new system connections
Otherwise the policy could miss the fact that a new usable system
connection showed up and might fail to activate it.
2010-08-10 00:31:39 -05:00
Dan Williams
c72fbd6b87 policy: add short hostname to /etc/hosts too (rh #621910)
If your hostname is 'foo.bar.baz' and your DNS server doesn't
actually reply to queries for 'foo.bar.baz' you can't just 'ping foo'
currently.  While that may be somewhat of a misconfigured setup,
since we're already adding the domain part of the hostname to
/etc/resolv.conf we might as well add the short hostname to /etc/hosts
too so that ping works.
2010-08-09 14:37:54 -05:00
Dan Williams
47e859fb66 core: better debugging for IPv4LL and avahi-autoipd 2010-08-08 01:38:52 -05:00
Dan Williams
b9a919784e logging: add accessor for log level 2010-08-08 01:38:52 -05:00
Daniel Gnoutcheff
f98e2528a6 NetworkMangerSettings -> NetworkManager.Settings
Just for consistency, make settings related stuff live under the
org.freedesktop.NetworkManager namespace, rather than its own
org.freedesktop.NetworkManagerSettings namespace. Renames are done for
DBus interface names, DBus object paths, and polkit actions.
2010-08-07 01:19:46 -04:00
Daniel Gnoutcheff
fb96309899 DBus: merge NetworkManger{,SystemSettings}
Remove the org.freedesktop.NetworkManagerSystemSettings bus name and
have everybody talk to org.freedesktop.NetworkManager. Now that we have
a single settings service that's embedded in the main daemon, we don't
need separate names anymore.
2010-08-07 01:19:46 -04:00
Daniel Gnoutcheff
f8a92d44cb nm-sysconfig-settings: remove "bus" property
NMSysconfigSettings inherited the "bus" property from NMSettingsService.
The property was originally created to allow us to specify what DBus
connection to use, which was important in the days of user settings
services. Now, however, the daemon is the only thing that has a settings
service, and so we can trim a bit of clutter by removing this property
and using NMDBusManager directly.
2010-08-07 01:18:57 -04: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
5f0b5091b4 nm-sysconfig-connection: flatten DBus handlers
NMExportedConnection originally implemented its DBus method call
handlers as virtual functions, primarily so that system and user
settings services could implement them differently.
NMIfupdownConnection also depended on GetSecrets being virtual, so this
was retained when NMExportedConnection was flattened into
NMSysconfigConnection.

However, it turns out that NMIfupdownConnection doesn't really need
these functions to be virtual; it's more appropriate to override the
methods of NMSettingsConnectionInterface (which are used by the DBus
handlers).  Indeed, we really don't want settings plugins to override
the DBus handlers, as we must authorize the caller before doing anything
else.  So we can save a bunch of code and devirtualize these handlers.
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
Daniel Gnoutcheff
da6816a03b nm-glib/DBus: merge nm-settings{,-system} iface
Much as with nm-remote-settings and nm-remote-settings-system, the
removal of user settings services means there is no more need for
separate interfaces for user and system settings services.

In libnm-glib, this commit merges everything in
nm-settings-system-interface into nm-settings-interface.  Alongside with
that, we merge everything in the
org.freedesktop.NetworkManagerSettings.System DBus interface into
org.freedesktop.NetworkManagerSettings.
2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
215640c590 libnm-glib: remove nm-settings-service
Now that we have only one settings service, there is no more need to
have common settings service code in libnm-glib. So we can simplify
things somewhat my moving everything from nm-settings-service into
nm-sysconfig-settings.
2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
67ba32cd29 Remove use-user-connections polkit action 2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
d503c09466 DBus API: removing user settings support
Remove bits from the external DBus API that were once needed for user
settings support.
2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
fa8c9304b5 libnm-*: remove user settings support
Remove code related to "connection scope" and such. Later, we will also
do lots of code flattening and simplification that's possible now that
user settings are gone.
2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
5fda5283b9 core: remove internal API refs. to user settings
Remove all references to connection scope and user-settings services
from the various internal APIs of the daemon. The external DBus API
remains unchanged, albeit in stub form for scope stuff.
2010-08-06 13:05:46 -04:00
Daniel Gnoutcheff
443c95a6b9 nm-manager: start removing user settings services
It turns out that user settings services are strange and complicated
beasts. We will remove support for them, and we will later implement
security mechanisms on the system settings service that will do what
user settings services were intended to do.

This commit is a bulk removal of nm-manager's internal support code for
user settings services. The external API is largely unchanged, but
errors are returned if anyone ties to do something with user settings.

Work remaining includes some possible flattening of nm-manager's
internal code, along with code removal and API changes in other modules.
2010-08-06 13:05:46 -04:00
Dan Williams
c050e036c3 dhcp: make sure disabled DHCP clients aren't used (gentoo #330319)
If the client was disabled with --with-dhclient=no or
--with-dhcpcd=no, then it's corresponding _PATH will be an empty
string.  In that case we want to ignore that client completely
since it was disabled at build time.
2010-08-05 15:29:23 -05:00
Dan Williams
4e1eb09fed core: quiet annoying libnl error about route deletion (rh #612991) 2010-08-03 17:07:38 -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
b9c1404769 debian: don't require ifup for enabling loopback (bgo #625427)
But use it if it's installed.
2010-08-03 11:36:59 -07:00
Dan Williams
3dcf858c04 Merge remote branch 'origin/master' into zvm 2010-07-28 08:59:47 -07:00
Daniel Drake
64182e27d7 wifi: ensure scanning property is updated on supplicant interface state changes
The wifi device is considered to be 'scanning' if the supplicant emits
the scanning signal or if it's in the scanning state; but the code
didn't correctly handle notifications when the supplicant was in the
scanning state.
2010-07-28 02:09:26 -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
af2be00b8c Revert "core: fail connections if IP configuration expires" (rh #616084) (rh #590874)
This reverts commit b172519045.

When something like NTP updates the system clock, that can cause
dhclient to expire the lease, and at that point we just want NM
to let dhclient re-aquire the lease instead of failing the
whole connection.
2010-07-27 20:31:27 -07:00
Dan Williams
0a700de047 core: read nm-system-settings.conf first (rh #606160)
Even though we prefer NetworkManager.conf, we need to check the
old nm-system-settings.conf first to preserve compat with older
setups.  In package managed systems dropping a NetworkManager.conf
onto the system would make NM use it instead of nm-system-settings.conf,
changing behavior during an upgrade.  We don't want that.
2010-07-21 16:47:31 -07:00
Dan Williams
81f030fe5b core: don't require PPP setting for PPPoE connections (bgo #623744)
The PPP setting will usually be all defaults anyway, so lets just
created it when needed if it doesn't yet exist.  Fixes an error
where the connection editor couldn't edit system DSL connections
because it tried to request secrets for the PPP setting that didn't
actually exist in the connection because the 'keyfile' plugin
wouldn't save all-default settings, thus that setting wouldn't
exist when read back in.
2010-07-21 15:55:33 -07:00
Dan Williams
d533c807e6 system-settings: return InvalidSetting when secrets setting doesn't exist (bgo #623744)
So that clients can handle the error intelligently; it's not
really a fatal error.
2010-07-21 15:54:44 -07:00
Bin Li
ce7d37ad80 dns: fix race waiting for netconfig 2010-07-16 12:54:39 -07:00
Dan Williams
786ac623ab dns: send NIS servers and domain to SUSE's netconfig 2010-07-16 12:44:50 -07:00
Dan Williams
e780145a8f dhcp4: handle NIS servers and domains 2010-07-16 11:28:39 -07:00
Dan Williams
4880cc68b2 wifi: work around wl.o frequency reporting for active AP matching
Some proprietary drivers (wl.o) report tuned frequency (like when
scanning) instead of the associated AP's frequency.  This is a great
example of how WEXT is underspecified.  We use frequency to find the
active AP in the scan list because some configurations use the same
SSID/BSSID on the 2GHz and 5GHz bands simultaneously, and we need to
make sure we get the right AP in the right band.  This configuration
is uncommon though, and the frequency check penalizes closed drivers we
can't fix.  Because we're not total dicks, ignore the frequency condition
if the associated BSSID/SSID exists only in one band since that's most
likely the AP we want.
2010-07-15 00:00:42 -07:00
Dan Williams
8ee43c76f0 Merge remote branch 'origin/master' into zvm 2010-07-12 18:23:02 -07:00
Dan Williams
a1174a683e core: fix compilation on glib < 2.23.4
Where G_FILE_MONITOR_EVENT_MOVED isn't defined yet.
2010-07-12 18:21:27 -07:00
Dan Williams
664ccd4464 Revert "core: fix compilation on glib < 2.23.4"
This reverts commit 8a1fe31b31.

This commit was not intended to be pushed, as it's not ready yet
and isn't even my commit (thus attribution is wrong).
2010-07-12 18:20:09 -07:00
Dan Williams
ecb6c69d2b Merge remote branch 'origin/master' into zvm 2010-07-12 17:49:59 -07:00
Michael Biebl
c8c161780a dhcp: use ISC DHCPv4 paths now that v4 is nominally required 2010-07-09 11:33:27 -07:00
Dan Williams
8a1fe31b31 core: fix compilation on glib < 2.23.4
Where G_FILE_MONITOR_EVENT_MOVED isn't defined yet.
2010-07-02 10:42:32 -07:00
Dan Williams
62d03cf33e core: better missing firmware handling when firmware appears (rh #609587)
Monitor the kernel firmware directory (set at configure-time with
--with-kernel-firmware-dir=<path>) for changes, and if there
are any, try bringing up devices that are missing firmware.
2010-07-01 10:32:11 -07:00
Dan Williams
e1b46b870a Merge remote branch 'origin/master' into zvm 2010-06-30 15:00:42 -07:00
Dan Williams
c38d1c28ff core: fix potential use-after-free resetting IPv6 accept_ra value 2010-06-30 13:37:34 -07:00