Commit Graph

7207 Commits

Author SHA1 Message Date
Alfredo Matos
daeb181fa2 core: add libnl-3 API compatibility 2011-07-30 15:47:33 -05:00
Alfredo Matos
a6c6556831 core: add libnl-2 support with libnl-1 compatibility 2011-07-30 15:47:26 -05:00
Daniel Gnoutcheff
1a98391dc4 supplicant: fix DBus signal signatures
The DBus signatures registered (via dbus_g_proxy_add_signal) for the
fi.w1.wpa_supplicant.Interface.{BSSAdded,ScanDone} signals were
incorrect.  That prevented us from receiving wifi ap scan results, at
least in the case where wpa_supplicant has DBus introspection disabled.
2011-07-29 16:34:03 -05:00
Dan Williams
f742b06304 wifi: handle a few more possible D-Bus activation errors
There's two possibilities for errors from D-Bus when trying to
activate the supplicant; either we ignore the error and wait
for the supplicant to restart or be started, or it's a hard
error and we can't continue without risking worse behavior (ie
out of memory, supplicant spawns but exits immediately, etc).
This adds a few more harmless errors to the first category
which can happen if the supplicant's .service file exists
but the supplicant does not, in which case we just wait for
it to magically show up later.
2011-07-28 09:54:06 -05:00
Dan Williams
73ddc1e307 core: move route creation to nm-netlink-utils.c 2011-07-22 18:10:28 -05:00
Dan Williams
11c2824ef1 core: remove dead libnl code 2011-07-22 18:09:37 -05:00
Dan Williams
abb89a7d2a core: move route iteration to nm-netlink-utils.c 2011-07-22 18:09:32 -05:00
Dan Williams
7461e33ce1 core: move route logging to nm-netlink-utils.c 2011-07-22 16:17:10 -05:00
Dan Williams
8b075fcdf2 core: move route deletion to nm-netlink-utils.c 2011-07-22 16:12:44 -05:00
Dan Williams
3a86b5ae34 core: move address checking functionality into separate file
Start to consolidate netlink stuff so we can eventually keep all
the API changes for libnl1 vs. libnl3 in fewer places.
2011-07-22 15:28:35 -05:00
Dan Williams
2fabdbff15 core: finish conversion of nm-system functions to ifindex not iface name 2011-07-22 14:24:18 -05:00
Dan Williams
efb5735ad1 core: more conversion to ifindex instead of iface 2011-07-22 14:09:16 -05:00
Dan Williams
c742cc83fd core: convert up/down check to netlink and use interface index not iface 2011-07-22 13:49:49 -05:00
Dan Williams
d2d1f2e9e0 core: use interface indexes more 2011-07-22 13:37:29 -05:00
Dan Williams
88cd34feef core: remove unused includes 2011-07-22 12:50:54 -05:00
Dan Williams
9cdc5021ab keyfile: fix integer list SSID parsing after 30c41a4b80
The regex was capturing integers larger than 3 digits, which aren't
valid SSID integer list items because each byte of the SSID cannot be
larger than 255.  Add an explicit testcase for intlist SSIDs too.
The previous regex was causing a testcase failure with an SSID of
'1337' which it was interpreting as a single element intlist, but
should have been interpreted as a string since it's clear > 255.
2011-07-20 17:44:14 -05:00
Dan Williams
ba390d2430 ifcfg-rh: add testcase for PEAP anonymous identity (rh #708436) 2011-07-18 22:40:45 -05:00
Jiří Klimeš
3c0bf572c4 ifcfg-rh: read IEEE_8021X_ANON_IDENTITY for PEAP too (rh #708436) 2011-07-15 11:28:27 +02:00
Jiří Klimeš
c3893b5325 dns: append %interface to link-local IPv6 addresses in resolv.conf (rh #720001) 2011-07-12 16:09:01 +02:00
Jiří Klimeš
6272052f9d policy: fix setting hostname from DHCP options (rh #719100) 2011-07-12 14:47:33 +02:00
Jiří Klimeš
30c41a4b80 keyfile: distinguish better between string x int list formats (bgo #649422)
This commit enhances get_uchar_array() to better differentiate between string
ad integer list formats. This allows using ';' character in SSIDs.
2011-07-07 15:25:11 +02:00
Jiří Klimeš
2f421bc779 keyfile: correct a warning message 2011-07-07 14:50:35 +02:00
Jiří Klimeš
730da1090e wifi: instead of asserting just return for NULL AP in update_seen_bssids_cache() 2011-07-07 13:18:59 +02:00
Jiří Klimeš
5b650f9ae3 settings: do not crash on GetSecrets() in case of missing secrets
When secrets are flagged as agent-owned in a connection configuration file, but
actually not available, we have to return an empty hash (nm_connection_to_hash()
returns NULL).
2011-07-07 12:51:22 +02:00
Dan Williams
8e929b1e1b ifcfg-rh: fix for three-digit prefixes
The regex only caught prefixes up to 99; anything over that was
truncated to two digits.
2011-07-05 23:27:50 -05:00
Dan Williams
50867cc461 ifcfg-rh: don't try to set a prefix of 0
It's not a valid prefix since NM determines the default routes
automatically, and thus routes and addresses with a prefix of
zero should not be used in config files.
2011-07-05 23:17:14 -05:00
Dan Williams
5459d9db8c policy: don't auto-activate shared wifi if user is not authorized (CVE-2011-2176) (rh #715492)
If a shared wifi connection is restricted to a certain set of users
and none of those users have authorization to start shared wifi
connections, don't auto-start the connection.
2011-07-01 15:41:00 -05:00
Dan Williams
669de165ca core: request authorization for shared wifi connections (CVE-2011-2176) (rh #715492)
Ensure the user is authorized to start shared wifi connections.
2011-07-01 15:41:00 -05:00
Dan Williams
f9aa019ba8 settings: add function for validating connection's active user permissions
Returns TRUE if any user the connection is visible too is active and
has the given permission.
2011-07-01 15:41:00 -05:00
Dan Williams
5cf1addbdf core: add utility function to get a connection's shared wifi permission
If the connection is a shared wifi connection, return the appropriate
permission the user must obtain to use the connection.
2011-07-01 15:41:00 -05:00
Dan Williams
2420c37e24 agents: add nm_agent_manager_get_agent_by_user()
Return any registered agent for a given username.
2011-07-01 15:41:00 -05:00
Dan Williams
ded905ceb1 agents: track agent wifi permissions
When an agent registers, request wifi sharing permissions for that
agent's user and only register the agent when the permissions are
known.
2011-07-01 15:41:00 -05:00
Dan Williams
85708fa5d7 agents: store agent permissions for later
Let something else do the actual checking but provide an
interface to let that something else track the permissions
of the user that owns the agent.
2011-07-01 15:38:38 -05:00
Dan Williams
3b226980c7 agents: track agent username
Look up the username of the user whose session the agent is
part of andkeep that around for later.
2011-07-01 15:38:38 -05:00
Dan Williams
c08279dff4 core: add nm_auth_chain_steal_data()
New function for removing data from the auth chain without
destroying it.
2011-07-01 15:38:38 -05:00
Dan Williams
937970f60c core: allow multiple authority changed callbacks
We'll need this later; just keep all registered callbacks
in a list and track them by func/data.
2011-07-01 15:38:38 -05:00
Dan Williams
db6638623b core: don't schedule authentication requests twice
If an error occurred, or PolicyKit is disabled, we don't want to
schedule two idle handlers to return the result of an authentication
request.  We'll soon be queuing up multiple requests at the same
time so we don't want this to happen.
2011-07-01 15:38:38 -05:00
Jiří Klimeš
69b767bbf0 core: connections failed due to missing secrets are re-tried when an secret agent registers (rh #706204)
Use case:
A user has an auto-activatable connection with secrets in a keyring. While
booting NM starts and tries to activate the connection, but it fails because of
missing secrets. Then the user logs in, but the connection is marked as invalid
and is not tried again.

This commit solves the issue by removing invalid flag and activating the
connection when a secret agent registers.

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2011-07-01 09:14:05 +02:00
Jiří Klimeš
18b81930ce ifcfg-rh: change MACADDR_BLACKLIST to HWADDR_BLACKLIST (to correspond to HWADDR key) 2011-06-30 17:58:31 +02:00
Jiří Klimeš
b1afd46f65 ifcfg-rh: support "mac-address-blacklist" property in ifcfg-rh plugin
ifcfg-rh plugin now reads/writes the property as MACADDR_BLACKLIST variable.
The variable is space-separated list of MAC addresses in the standard
hex-digits-and-colons notation.
E.g. MACADDR_BLACKLIST="7e:d8:c0:85:58:7f 00:1e:65:30:d5:c7"
2011-06-30 16:46:33 +02:00
Jiří Klimeš
a6733c8b4f core: add MAC address blacklisting feature for WiFi and ethernet connections
"mac-address-blacklist" property is added to the ethernet and WiFi connections.
It is the MAC addresses list of devices on which the connection won't be
activated.

Original patch (NM_0_8 branch) from Thomas Bechtold <thomasbechtold@jpberlin.de>
2011-06-30 16:46:26 +02:00
Jiří Klimeš
f340c44fed ifcfg-rh: fix an assertion failure and read-after-free error for invalid MACs 2011-06-30 14:52:49 +02:00
Dan Williams
6187b85052 wifi: immediately request new 802.1x 'always-ask' passwords if they fail
Instead of retrying the password a number of times, immediately fail the
connection and ask for a new pasword if (1) the request fails during the
802.1x authentication and (2) the password is an 'always-ask' 802.1x
password.  The password is bad anyway, and in the case of RSA/OTP tokens
the code may have already changed, so it's pointless to keep retrying
the same password when it's already stale.
2011-06-29 18:19:56 -05:00
Dan Williams
a27cd8e5d9 wifi: allow supplicant disconnect request more often
Use a broader range of supplicant interface states to determine
when to tell the supplicant to idle; we want to allow the
disconnect in all of these states, not just some of them.

Second, allow the active network to be removed from the supplicant's
list in most of these states, even when the supplicant interface is
inactive or disconnected.
2011-06-29 18:19:55 -05:00
Jiří Klimeš
fdfbe00aac policy: remove "invalid mark" for failed connections after 5 mins
If there is a temporary connection failure (e.g. due to unavailable DHCP), the
connection is marked as invalid after several retries. Reset the flag after
5 mins to allow next auto-reconnection.
2011-06-23 11:45:16 +02:00
Dan Williams
a5850e82bc ifcfg-rh: fix distcheck after c2dbd1f836
IPV6_FAILURE_FATAL is now read and defaults to TRUE for ifcfg files
even if IPv6 is turned off.  That means that if we write a connection
for which NM_SETTING_IP6_CONFIG_MAY_FAIL is FALSE but IPv6 is disabled,
ifcfg-rh won't write out IPV6_FAILURE_FATAL (because IPv6 is disabled
so why bother writing out IPv6-related settings) but on re-read it will
treat the absence of IPV6_FAILURE_FATAL as TRUE/yes.  This leads to
a mismatch between the connection that was written out (which will
have NM_SETTING_IP6_CONFIG_MAY_FAIL=FALSE and no IPV6_FAILURE_FATAL)
and the re-read connection (which will have
NM_SETTING_IP6_CONFIG_MAY_FAIL=TRUE since a missing IPV6_FAILURE_FATAL
is treated as NM_SETTING_IP6_CONFIG_MAY_FAIL=TRUE).
2011-06-20 18:41:56 -05:00
Jiří Klimeš
502548b6ca ifcfg-rh: fix IPV4_FAILURE_FATAL handling and memory leaks, when IPv4 is disabled 2011-06-16 12:30:38 +02:00
Jiří Klimeš
c2dbd1f836 ifcfg-rh: read some more IPv6-related values as well even if IPV6INIT=no
We need to read IPV6_FAILURE_FATAL and other values, even if IPv6 is disabled.
Else the variables would use default values, which may not be right. Then
switching between methods "Ignore" and "Automatic" in a GUI would change value of
IPV6_FAILURE_FATAL property, even if it's not touched explicitly.
2011-06-16 11:14:52 +02:00
Dan Williams
fb62f395ea vpn: fix handling of connections with only system secrets
The core problem was the nm_connection_need_secrets() call in
nm-agent-manager.c's get_start() function; for VPN settings this
always returns TRUE.  Thus if a VPN connection had only system
secrets, when the agent manager checked if additional secrets
were required, they would be, and agents would be asked for
secrets they didn't have and couldn't provide.  Thus the
connection would fail.  nm_connection_need_secrets() simply
can't know if VPN secrets are really required because it
doesn't know anything about the internal VPN private data;
only the plugin itself can tell us if secrets are required.

If the system secrets are sufficient we shouldn't be asking any
agents for secrets at all.  So implement a three-step secrets
path for VPN connections.  First we retrieve existing system
secrets, and ask the plugin if these are sufficient.  Second we
request both existing system secrets and existing agent secrets
and again ask the plugin if these are sufficient.  If both those
fail, we ask agents for new secrets.
2011-06-15 12:19:47 -05:00
Jiří Klimeš
acc3025dfc core: socket() returns -1 on failure 2011-06-15 11:03:29 +02:00