Commit Graph

7207 Commits

Author SHA1 Message Date
Dan Williams
e39449caef settings: fix leaked connection when deleting secrets 2011-09-20 23:01:35 -05:00
Dan Williams
512a0f827a settings: fix refcounting when deleting a default wired connection (lp:797868)
When a default wired connection is saved, it gets deleted first since it
has to be re-created using a settings plugin.  But with the settings
rework in 0.9, default wired refcounting changed and the default
wired connection wasn't kept alive in default_wired_try_update()
over the removal/readd.  This caused a use-after-free.
2011-09-20 22:44:10 -05:00
Dan Williams
f082e243c6 ifcfg-rh: fix crash when system bus isn't around 2011-09-19 17:38:58 -05:00
Dan Williams
4ac8b1cf8e wimax: more verbose interface add/remove logging 2011-09-19 16:44:06 -05:00
Jiří Klimeš
60ed3839fb core: print textual description for reason codes on device deactivation too 2011-09-19 14:22:00 +02:00
Evan Broder
1e2984a5c2 supplicant: Don't leak secrets, even if they're probably invalid 2011-09-15 10:17:30 -05:00
Jiří Klimeš
53b85b13be core: storing timestamps also for VPN connections (rh #725353) 2011-09-15 14:24:41 +02:00
Dan Williams
91b93c1352 wifi: remove some dead code 2011-09-14 17:30:04 -05:00
Gerald
61568bc513 ppp: pass novj through to pppd 2011-09-14 12:31:54 -05:00
Thomas Graf
271fce0267 monitor: Use nl_socket_alloc() instead of nl_socket_alloc_cb()
We are using the default cb set anyways. This allows running NM with
the NLCB=debug environment variable set to get some debug messages
out of libnl related to netlink communication.

NLCB=debug won't print received netlink messages as the MSG_IN
handler is in use by NM to verify message origins. It's probably
best to introduce new handlers in libnl for debugging purpose
so both use of MSG_IN and enable debugging is possible.
2011-09-14 12:26:33 -05:00
Thomas Graf
d6864d7cf5 core: Fix check for failure in translating link name to ifindex
rtnl_link_name2i() returns 0 (unspecified ifindex) if translation
did not succeed.
2011-09-14 12:25:35 -05:00
Alfredo Matos
d2069c56e8 netlink: fix flags use in nm_netlink_route_add
Flags are not getting set when a route is added (e.g. NLM_F_REPLACE).
Apparently this was fixed in Ubuntu, but I didn't see a patch here, so
here it is.
2011-09-13 10:40:30 -05:00
Dan Williams
43a6f8a003 netlink: alias nlmsg_datalen() for libnl1 2011-09-13 00:08:30 -05:00
Thomas Graf
74349dcdc3 core: Fix leaks if address parsing fails while setting mac
Both 'old' and 'new' are leaked if nl_addr_build() fails to parse
the mac address.
2011-09-13 00:08:30 -05:00
Thomas Graf
360143e42f core: fix leaked address structure after parsing mac address 2011-09-13 00:08:30 -05:00
Thomas Graf
1134eee1e6 ip6: Perform sanity check before processing prefix messages
Verifies that the provided message consists of at least the prefix header.
2011-09-13 00:08:30 -05:00
Thomas Graf
3f3a63084c ip6: Perform sanity checks before processing nduseropt messages
Verifies that the provided message consists of the nduseropt header
followed by an array of options as specified in the header.
2011-09-13 00:08:30 -05:00
Thomas Graf
205c4c52d8 ip6: Perform sanity check before processing NEWLINK messages
Verifies that provided message consists of at least the link message
header. nlmsg_parse() does this so it needs to be called prior to
accessing the message contents.
2011-09-13 00:08:30 -05:00
Thomas Graf
c297cb8f70 ip6: fix leak in process_addr()
rtnladdr is leaked if nm_ip6_manager_get_device() returns NULL.
2011-09-13 00:08:30 -05:00
Thomas Graf
cc2c2baee6 ip6: fix leak in process_route()
rtnlroute is leaked if nm_ip6_manager_get_device returns NULL
2011-09-13 00:08:30 -05:00
Jiří Klimeš
f3d4cd385e keyfile: fix two bugs for updating/writting a keyfile
* When a connection name (ID) was changed via nm-connection-editor, a new file
  path was created, but the old one was not removed. That resulted in two files
  and in turn in duplicated connections.
* When two connections with the same name (ID) were present, e.g. files ABC and
  ABC-70656842-98ac-4221-aa8b-0d4174770, and nm-connection-editor was used to
  edit ABC-70656842-98ac-4221-aa8b-0d4174770, the operation failed.
2011-09-12 18:41:59 +02:00
Dan Williams
3d898d1b66 wimax: fix connect-during-scan after d4ff43bc1e
Oops; mark prepare_done during stage1 not stage2 since stage1 is Prepare
and stage2 isn't.
2011-09-07 17:20:42 -05:00
Dan Williams
d4ff43bc1e wimax: fix Active NSP notification issue
A race condition meant that sometimes, if the wimax device finished
scanning while stage1 (Prepare) was scheduled but hadn't executed yet:

NetworkManager[8700]: <info> (wmx0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
NetworkManager[8700]: <info> Activation (wmx0) Stage 1 of 5 (Device Prepare) scheduled...
NetworkManager[8700]: <info> (wmx0): wimax state change scanning -> ready (reason 0)

the code would schedule stage2 which meant that stage1 was completely
skipped.  But that's where the active-nsp property was set, which
meant clients would not be notified of the new active NSP.  This
caused nm-applet to show a zero-signal-strength icon for WiMAX
because libnm-glib didn't know there was an active NSP, even though
NM was connected.
2011-09-07 14:20:30 -05:00
Dan Williams
420fbb599f sharing: fix handling of rule negation (debian #638995)
! after the option is deprecated at least as far back as iptables
1.4.12 on 2.6.32.  ! should be before the option instead.

Reported-by: Ralf Jung <ralfjung-e@gmx.de>
2011-09-06 18:31:40 -05:00
Jiří Klimeš
4bb50e4380 ifnet: add testcase for incorrect config
Missing config_<name> line (containing method, i.e. dhcp, ...) should
fail with error 'Unknown config for <name>'.
2011-09-01 11:29:32 +02:00
Jiří Klimeš
9f026283c6 ifnet: fix tests 2011-08-31 19:05:21 +02:00
Jiří Klimeš
379d9044fb ifnet: fix GError handling in ifnet_update_connection_from_config_block() 2011-08-31 17:27:27 +02:00
Michael Stapelberg
de38843828 dnsmasq: use '@interface' for link-local DNS servers in the dnsmasq config
inet_ntop() either returns 'address%interface' or just 'address'. In the first
case, we replace '%' with '@' since dnsmasq supports '%' only since version
2.58. In the second case, we append '@interface' to make it work.

(small fixes by dcbw)
2011-08-25 15:49:41 -05:00
Dan Williams
b3ca1e56c1 Merge remote-tracking branch 'origin/agent-secrets' 2011-08-23 09:34:55 -05:00
Dan Williams
0fe8c80fae Merge branch 'libnl3' 2011-08-23 09:30:50 -05:00
Evan Broder
0b8097a26a supplicant: incorporate subject_match and altsubject_matches into supplicant config (bgo #341323) 2011-08-19 18:20:49 -05:00
Evan Broder
ca968105da supplicant: add new separator option to ADD_STRING_LIST_VAL macro 2011-08-19 18:20:49 -05:00
Dan Williams
770548ac04 dbus: ensure NM can talk to newly installed VPN plugins (fdo #39463)
When new services are installed and the daemon reloads bus policy
(like when installing new VPN plugins with rpm or dpkg) it appears
the rules don't get loaded into NetworkManager's policy space.
Thus any D-Bus message NM sends to the newly installed VPN plugin
gets denied until a restart of NM or the machine.  Work around
this dbus bug by letting NM talk to all known VPN services in the
NM policy file which will always exist when NM is around.
2011-08-19 16:55:16 -05:00
Dan Williams
66281b4ec3 Merge remote-tracking branch 'origin/master' into agent-secrets 2011-08-16 18:00:32 -05:00
Alfredo Matos
07cc83fbdb libnl: Move to common route add function interface 2011-08-16 17:16:02 -05:00
Alfredo Matos
a73039c0ec libnl: Create a common netlink route add function 2011-08-16 17:11:52 -05:00
Alfredo Matos
83b1b1660f libnl: route delete can return ERANGE in libnl-1 2011-08-16 17:10:30 -05:00
Alfredo Matos
638d3beb01 libnl: Use compat return for nl_route_add() 2011-08-16 17:08:57 -05:00
Alfredo Matos
2e32003fd2 libnl3: Fix ESRCH return types
ESRCH becomes NLE_OBJ_NOTFOUND. Includes workaround for libnl
  aliased return value where ESRCH is being converted to a generic
  unspecified error by libnl [1].

  [1] http://git.kernel.org/?p=libs/netlink/libnl.git;a=commit;h=7e9d5f
2011-08-16 16:58:19 -05:00
Alfredo Matos
790c16c9f2 libnl3: Add ESRCH to compat error translation 2011-08-16 16:48:30 -05:00
Dan Williams
7addf3009a Merge remote-tracking branch 'origin/master' into libnl3 2011-08-16 16:45:41 -05:00
Daniel Gnoutcheff
f14d8b18ee modem: fix race with nm_modem_set_mm_enabled
Once we've sent a method call over DBus requesting that the modem be
disabled, we should assume that the modem is disabled unless we hear
otherwise.  Otherwise, code that checks the modem state immediately
after it gets disabled might think that it's enabled when it almost
certainly is not.
2011-08-16 16:37:01 -05:00
Daniel Gnoutcheff
ac27e33f0c policy: don't autoconnect disabled modems
Normally, a device disabled via nm_device_interface_set_enabled() will
shift into the UNAVAILABLE state.  Modems, however, don't do that.
Rather, they pretend that they are in the DISCONNECTED state, presumably
to make it easier to re-enable them.  To avoid accidentally re-enabling
and autoconnecting a disabled modem, we need to explicitly make
nm_device_interface_get_enabled() == true a prerequisite for
autoconnecting.
2011-08-16 16:34:21 -05:00
Dan Williams
2b2404bbef settings: preserve agent secrets the right way
What we want to do here is keep separate caches of system and
agent secrets.  For system secrets, we cache them because NM
periodically clears secrets using nm_connection_clear_secrets() to
ensure they don't stay around in memory, and that transient secrets
get requested again when they are needed.  For agent secrets, we
only want them during activation, but a connection read from disk
will not include agent secrets becuase by definition they aren't
stored in system settings along with the connection.  Thus we need
to keep the agent/transient secrets somewhere for the duration of
the activation to ensure they don't get deleted.

This removes the copy-back hack in update_auth_cb() which copied
agent/transient secrets back into the connection over top of the
transient secrets that had been copied back in
nm_settings_connection_replace_settings().  No reason to copy
them twice if we keep an agent/transient secrets hash and do
the right thing with it.
2011-08-16 16:19:23 -05:00
Dan Williams
e2d88f59e6 settings: preserve agent secrets over Update operation
The core problem was that the Update would trigger a write to
disk to save the connection's new settings, which called
nm_settings_connection_replace_settings().  Which saved existing
transient (agent/unsaved) secrets, replaced settings with the
new ones from Update(), then copied back the old transient
secrets.  This was to ensure that changes triggered from getting
agent secrets during activation (which might write the connection
out to disk if new system secrets were provided, which triggered
an inotify read-back of the connection, which blew away the
transient secrets just returned from the agent) didn't blow away
transient secrets.  Unfortunately that fix was too general.

As a quick hack for now, copy the new secrets and re-apply them
after nm_connection_replace_settings() has run.  We'll do the
actual fix later, but it's more involved and needs more testing
so we don't want to apply it this close to release.
2011-08-16 15:48:38 -05:00
Jiří Klimeš
adc7ec170d ifcfg-rh: make NM_CONTROLLED changes function properly (rh #727501)
Changing NM_CONTROLED from "no" to "yes" worked just the first time.
Fix that by storing unmanaged spec when interface becomes unmanaged
and adjust condition identifying "no-change" updates to the ifcfg
file.
2011-08-02 12:18:52 +02:00
Jiří Klimeš
312c7c952c ifcfg-rh: emit "updated" signal when connection file is changed (rh #727501)
Chain up to parent's commit_changes() even if in-memory and on-disk data are the
same; they are the same when another process changes the on-disk file. Just make
sure not to write out the data needlessly when same.

This fixes a regression caused by 9cba854fa0.
It exhibits e.g. by not auto-activating connection when ONBOOT is changed from
"no" to "yes". Connection "updated" signal was not emitted and listeners like
NMPolicy was not prodded.
2011-08-02 12:18:43 +02:00
Dan Williams
76ecc09989 core: don't warn if loopback address already exists 2011-07-30 16:53:42 -05:00
Dan Williams
7c06436822 Merge remote-tracking branch 'origin/master' into libnl3 2011-07-30 16:48:46 -05:00
Dan Williams
b562839df8 core: misc style fixes to libnl compat code 2011-07-30 15:47:39 -05:00