Commit graph

2071 commits

Author SHA1 Message Date
Dan Williams
44cfbf201f wifi: allow proactive_key_caching through the supplicant settings filter (rh #615032) (rh #636877)
This makes 596cf1a232 actually work.
2010-09-28 14:18:34 -05:00
Pat Suwalski
db3f91deae system-settings: allow glob (*) in no-auto-default config file option
When * is used instead of MAC addresses' list, no-auto-default option
is valid for all interfaces.
2010-09-27 11:08:03 +02:00
Jiří Klimeš
facf6b176f core: add Version property to org.freedesktop.NetworkManager interface 2010-09-27 10:34:56 +02:00
Jiří Klimeš
358261ccd9 core: read initial MAC address on startup; reset to this MAC when disconnecting
Previously, NM reset permanent MAC to an interface while disconnecting. That
basically ignored MAC addresses set before NM started managing the interface.
Now, the initial MAC address is remembered and set back to the interface when
disconnecting.
2010-09-27 09:53:51 +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
9e2ec0b7a1 system-settings: fix use-after-free causing crashes when hostname is empty
Should be returning NULL here since the actual hostname is returned in the
for() loop if the plugin supports hostnames.  But if the plugin for some
reason returns an empty string (which they aren't supposed to do) then
hostname would be left assigned to an already-freed value, which was then
returned to higher layers.

==12331== Invalid free() / delete / delete[]
==12331==    at 0x4024B3A: free (vg_replace_malloc.c:366)
==12331==    by 0x448BFC5: g_free (gmem.c:191)
==12331==    by 0x43E0E05: value_free_string (gvaluetypes.c:268)
==12331==    by 0x43DC587: g_value_unset (gvalue.c:276)
==12331==    by 0x80B297F: notify (nm-sysconfig-settings.c:229)
==12331==    by 0x43C64E7: g_cclosure_marshal_VOID__PARAM (gmarshal.c:531)
==12331==    by 0x43B78B8: g_type_class_meta_marshal (gclosure.c:878)
==12331==    by 0x43B9251: g_closure_invoke (gclosure.c:767)
==12331==    by 0x43CD239: signal_emit_unlocked_R (gsignal.c:3178)
==12331==    by 0x43CEDB3: g_signal_emit_valist (gsignal.c:2981)
==12331==    by 0x43CF255: g_signal_emit (gsignal.c:3038)
==12331==    by 0x43BD630: g_object_dispatch_properties_changed (gobject.c:801)
==12331==  Address 0x479f208 is 0 bytes inside a block of size 1 free'd
==12331==    at 0x4024B3A: free (vg_replace_malloc.c:366)
==12331==    by 0x448BFC5: g_free (gmem.c:191)
==12331==    by 0x80B1A08: nm_sysconfig_settings_get_hostname (nm-sysconfig-settings.c:280)
==12331==    by 0x80B27C7: get_property (nm-sysconfig-settings.c:1415)
==12331==    by 0x43BC707: g_object_get_property (gobject.c:935)
==12331==    by 0x80B288D: notify (nm-sysconfig-settings.c:225)
==12331==    by 0x43C64E7: g_cclosure_marshal_VOID__PARAM (gmarshal.c:531)
==12331==    by 0x43B78B8: g_type_class_meta_marshal (gclosure.c:878)
==12331==    by 0x43B9251: g_closure_invoke (gclosure.c:767)
==12331==    by 0x43CD239: signal_emit_unlocked_R (gsignal.c:3178)
==12331==    by 0x43CEDB3: g_signal_emit_valist (gsignal.c:2981)
==12331==    by 0x43CF255: g_signal_emit (gsignal.c:3038)
2010-09-24 18:25:45 -05:00
Dan Williams
596cf1a232 wifi: use PMKSA caching with PEAP-GTC (rh #615032) (rh #636877)
We don't want to require a full 802.1x reauth when using OTP tokens
and roaming between APs in the same ESS, since that takes a long time
(user has to find the token and type in the code).
2010-09-24 14:12:58 -05:00
Dan Williams
8199c7275b dns: warn that the BIND plugin is experimental
It's still got a bunch of issues that need debugging, like when VPN
nameservers exist but no domain and thus not doing split DNS, sometimes
hosts outside the VPN don't resolve correctly, which was previously
masked by having the non-VPN nameservers in /etc/resolv.conf where
glibc would erroneously use them instead of asking BIND.  To be fixed
in a subsequent patch.

The dnsmasq plugin seems to work great though.
2010-09-22 16:32:00 -05:00
Dan Williams
a211fadce0 Merge remote branch 'origin/cachingdns'
Caching DNS with dnsmasq works well enough to merge for now.  THere
are still some issues with the BIND plugin because BIND is god-awful
unecessarily complex so we'll disable that in a further commit.
2010-09-22 16:19:28 -05:00
Dan Williams
06bd99f617 dns: write only 127.0.0.1 to resolv.conf when caching
If all nameservers are listed in resolv.conf, glibc apparently
tries them all (even if 'options rotate' isn't specified??).  Leading
to queries for internet hosts being directed to VPN-specific DNS
servers in split-DNS situations.  I've verified this with wireshark;
I see queries going out over the tunnel to VPN nameservers for
non-internal addresses, while BIND itself never logs anything about
queries to VPN nameservers for that same address.  Thus the only
thing left is to blame glibc...
2010-09-21 00:18:15 -05:00
Dan Williams
20acb482c5 dns: allow random source ports for BIND caching DNS
Despite most guides saying that without restricting to port 53 queries
won't get through a firewall, I cannot make it work with this option.
DNS queries through a WRT54G just time out even when the WRT54G isn't
caching anything itself (ie, explicit upstream nameservers are the
forwarders in the bind config).
2010-09-21 00:08:01 -05:00
Dan Williams
14a358f604 core: be more robust to config file syntax issues
Clearly we should be stripping spaces off plugin names if that's what
the user happened to type.
2010-09-20 14:27:06 -05:00
Dan Williams
e0a2aeaa7c dns: add BIND9 local caching nameserver support
For some reason split DNS doesn't work yet (all queries are directed
to the VPN nameserver if a VPN is active) but it otherwise works.
2010-09-16 15:31:47 -05:00
Dan Williams
1e33d1e906 dns: remove unused Chromium bits
This was supposed to hook up to the bits Adam Langley did last year
for his local-dns-cache DBus service, but I misunderstood the
architecture.  It was a separate service, not Chromium itself.  But
it's unclear what happened to his local-dns-cache since the project
doesn't seem to have any commits in a year and I'm unsure if it's
actually being used.  So remove this stuff for now.
2010-09-15 10:25:11 -05:00
Dan Williams
1da4a11ce5 dns: (dnsmasq) fix handling of multiple DNS servers in non-split configs 2010-09-14 23:55:41 -05:00
Dan Williams
57f6feb102 dns: only write out new DNS config if it really changed
Use a pseudo-hash to quickly check whether the DNS config has really
changed or not.  This is certainly better than the 500 line patch I
did then scrapped in favor of this approach... yay.  This helps ensure
that we don't kill then respawn caching DNS servers more often than
we have to.
2010-09-14 23:41:33 -05:00
Dan Williams
958024cb68 bluetooth: requery default adapter when Bluez actually starts 2010-09-13 11:02:26 -05:00
Dan Williams
9d0775448c dns: use VPN nameservers first even if no domain was given
If the VPN client didn't provide a domain we still want to use the
VPN nameservers first, we just can't do split DNS.  Also use
--strict-order to ensure VPN nameservers are always chosen first.
2010-09-12 23:16:25 -05:00
Dan Williams
a2982b5f7b dns: hook plugins into DNS updates and make dnsmasq plugin actually work 2010-09-12 22:25:30 -05:00
Dan Williams
4da443dc69 dns: first cut of a dnsmasq local caching plugin 2010-09-10 18:02:40 -05:00
Dan Williams
64b6cd1ebc core: add DNS plugin config options 2010-09-09 17:14:20 -05:00
Dan Williams
9b2b809aae core: rename NMNamedManager -> NMDnsManager 2010-09-07 22:08:18 -05:00
Dan Williams
e86ef05d84 wifi: ensure Enabled state is preserved regardless of rfkill (bgo #624479)
Previously the "Enable Wireless" state was somewhat tied to rfkill state,
in that when NM started up, rfkill state would take precedence over what
was listed in the state file, and if you rmmodded your wifi driver and
then modprobed it again after disabling wifi from the menu, wifi would
magically become re-enabled becuase rfkill state changed.

Fix that by creating a third wifi/wwan enable state that tracks the
actual user preference instead of just the rfkill state so that when
the user disables wifi it stays disabled, regardless of what happens
with rfkill.
2010-09-01 17:09:59 -05:00
Dan Williams
d9c2755cfc core: clean up avahi-autiopd D-Bus proxy on exit 2010-08-31 15:47:16 -05:00
Dan Williams
a33843ac3d core: listen to UPower for suspend/resume signals
This means you don't need pm-utils anymore, and that gnome-power-manager
doesn't need to poke NM explicitly for suspend/resume operations.
The old explicit sleep/wake request is still around for pm-utils or
gpm to use, but NM will listen for UPower events and act on them
regardless of what pm-utils or gpm do.
2010-08-31 15:45:55 -05:00
Patrik Martinsson
9b54cb1ec6 dispatcher: add dhcp4-change and dhcp6-change events (bgo #563654)
New dispatcher events on DHCP lease changes.
2010-08-26 17:39:44 -05:00
Dan Williams
f917852de3 core: validate Enable/Disable WiFi and WWAN requests (rh #626337)
Since these were properties they are harder to validate the caller as
dbus-glib doesn't have any hooks before the property is set.  So we
install a low-level dbus filter function to catch property Set
requests before they get to dbus-glib and handle the property access
there.
2010-08-25 15:12:32 -05:00
Dan Williams
46afadc02c vpn: handle VPN service installation/removal dynamically (rh #489114) (lp:458595)
Use inotify to watch /etc/NetworkManager/VPN for new .name files and handle
their installation and removal on-the-fly instead of just at startup.
2010-08-17 15:05:00 -05:00
Dan Williams
c4db66c7ed vpn: fix refcounting of the VPN manager 2010-08-17 15:04:54 -05:00
Dan Williams
a5c15a2ca3 vpn: don't try to do stuff with a VPN connection that may not exist
If the activation of the VPN connection failed (like if its service
was not installed), it'll be NULL here.  Don't try to use it.
2010-08-17 15:04:50 -05:00
Dan Williams
6e7f9b4670 core: really fix polkit >= 0.97 this time 2010-08-17 09:36:14 -05:00
Dan Williams
f0e8055cf9 core: fix builds with polkit >= 0.97
polkit_authority_get() is deprecated, should use
polkit_authority_get_sync() instead.
2010-08-13 13:18:58 -05:00
Zephaniah E. Loss-Cutler-Hull
d5468c8527 vpn: let plugins forbid VPN connections from getting the default route (bgo #621698)
Minor fixes and cleanups by dcbw.
2010-08-12 23:53:42 -05:00
Mathieu Trudel-Lapierre
d39fda7722 dhcp: don't fail with dhclient v3 2010-08-12 17:52:20 -05:00
Dan Williams
37c578a2a2 core: fix unmanaging of devices when quitting
When NM quits, we don't want to unmanage a device that has
an active connection and can take that connection over again when
NM starts back up.  This makes '/etc/init.d/NetworkManager restart'
work seamlessly.  All other devices get unmanaged so their
connection (and any dependent VPN connections or wpa_supplicant
processes) get terminated.  This bug caused active VPN connections
over wifi to be left running even when they didn't have IP
connectivity.

There were two bugs:

1) the NMDevice class implemented connection_match_config() for
all device subclasses, but only Ethernet devices can assume
connections at startup.  Thus the quit-time check passed for
active wifi devices too, and they weren't properly cleaned up

2) The logic for figuring out which devices to clean up after when
quitting was somewhat flawed; we want to default to unmanaging
devices and then skip that step for ones that meet specific
criteria.  Instead the code defaulted to leaving all devices active
at shutdown.
2010-08-11 17:31:25 -05:00
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
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