Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Williams
8afce8590a libnm-glib: handle NULL object paths generically
Since D-Bus doesn't allow NULL or zero-length object paths, NM
uses "/" as a placeholder here.  Make sure the generic marshalling
code handles that so we don't have to do it in multiple places and
simplify handling of NULL objects somewhat.
2011-05-26 19:19:32 -05:00
Dan Williams
459e7b9518 api/core: add ActiveConnection property to device objects
Enables easier traversal of the object hierarchy; if a client is
watching signals on a device they can easily get back to the
parent NMActiveConnection object to grab connection details or
status.
2011-05-26 19:19:32 -05:00
Dan Williams
e56f0ea18f api: update some documentation for Connection.Active 2011-05-26 19:19:32 -05:00
Dan Williams
dcffe66c28 trivial: update gitignore 2011-05-26 12:51:54 -05:00
Jiří Klimeš
ce05bdb62e core: fix copying SSID from the connection to the hidden AP 2011-05-26 14:08:10 +02:00
Dan Williams
e75f5bc862 settings: only update transient secrets if they exist
Otherwise here the transient_secrets GHashTable will be NULL, and
g_hash_table_iter_init() doesn't like that much.
2011-05-25 18:52:55 -05:00
Dan Williams
a2dcf524bb core: silence error if ConsoleKit database isn't found the first time (rh #695617)
Ignore the first error if the CK database isn't there yet.
2011-05-25 15:14:12 -05:00
Dan Williams
730f10d707 settings: ensure connection changes don't overwrite transient secrets
Here's the problem:

- NM requests secrets
- secret agent returns secrets including some that are agent-owned or
  not-saved (ie, transient secrets)
- for whatever reason (other secrets are system-owned, whatever) the
  connection gets written back out to disk
- at some point later inotify triggers a connection re-read from disk
- the connection is read from disk, but doesn't contain the agent-owned
  or not-saved secrets, because they obviously don't get saved
- nm_settings_connection_replace_and_commit() blows away the agent-owned
  or not-saved secrets that the agent originally returned
- device activation no longer has the transient secrets

Re-reading connection data from disk shouldn't change transient secrets;
instead we need to merge the just-read system-owned secrets with whatever
transient secrets an agent sent.  Transient secrets should only be cleared
by nm_connection_clear_secrets() to ensure that they stick around for as
long as we need them.
2011-05-25 11:44:28 -05:00
Dan Williams
6d175478ef todo: update VPN IP Method item with more details 2011-05-25 07:48:21 -05:00
Dan Williams
bb954bd5f3 todo: add initial notes about bridging and bonding 2011-05-24 17:21:15 -05:00
Dan Williams
0b5ab39dbf wifi: always fix up Ad-Hoc frequency when connecting (rh #699203)
This used to only happen for user-created APs, but the supplicant
always wants a frequency no matter what, and the kernel drivers will
normally merge with any other IBSS with the same SSID no matter what
frequency is used, so we might as well just pass something since
it doesn't really matter in the end anyway.

As a bonus we get to remove the user_created stuff since it doesn't
really matter much anymore.
2011-05-24 12:37:55 -05:00
Dan Williams
cb883b2977 todo: update with proxy handling thoughts 2011-05-23 19:44:32 -05:00
Dan Williams
1c3400b8f2 todo: add note about drivers that don't support AP mode 2011-05-23 19:13:55 -05:00
David Woodhouse
1951029908 core: complete the openconnect migration hack; add flags for the saved secrets too (bgo #650383)
Commit e083cd5c63 stopped openconnect from
saving its secrets. It'd been working for a whole three minutes since my
previous commit.

We need to have at least one secret with an *extant* flags setting of
NM_SETTING_SECRET_FLAG_NONE, in order to trigger a write-out of the new
set of secrets. And we might as well list all the secrets we *know* the
auth-dialog is going to use, although we know there will be some secrets
that we cannot predict in advance (the form entry boxes).
2011-05-23 13:54:03 -05:00
Dan Williams
c0387ffbc5 core: treat VPN secrets without flags as system-owned
All non-VPN secrets are considered system-owned if they do not
have any explicitly set secret flags, and this makes VPN secrets
treated the same way.  As part of the import process plugins and
the applet already update secret flags.  This ensures that VPN
secrets are treated consistently throughout the codebase.
2011-05-23 13:45:51 -05:00
Dan Williams
ef71c5cca1 libnm-util: make VPN secret and data iterators change-safe
Let callbacks add/remove data items and secrets during iteration.
2011-05-20 18:58:35 -05:00
Dan Williams
987a132c12 core: clean up auth handling after polkit enable/disable changes
Slash and burn the #ifdef jungle so that the flow and blocks are
cleaner and less confusing to follow.
2011-05-20 11:35:24 -05:00
Dan Williams
82d83af5ae core: rename PolkitCall to AuthCall 2011-05-20 10:55:24 -05:00
Jiří Klimeš
29a4239f43 policy: make auto-activation retries really work for RETRIES_DEFAULT attempts
Retries counter was not initialized when connections were loaded. That forced
the counter to start from -1 and continue decreasing on connection failures.
And connection attempts never stopped.
2011-05-20 13:01:04 +02:00
Philip Balister
0e45771126 core: yet more consistent usage of libnl CFLAGS and LIBS
This patch has been used in OpenEmbedded [1] since commit b167a9a9 [2][3].

[1] http://www.openembedded.org/
[2] http://cgit.openembedded.org/cgit.cgi/openembedded/commit/recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager-vpn-manager-.patch?id=b167a9a9e55a7a493a7ee565cec9c7dd463362ff
[3] http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=b167a9a9e55a7a493a7ee565cec9c7dd463362ff

Signed-off-by: Philip Balister <philip@balister.org>
2011-05-19 15:40:07 -05:00
Martin Jansa
a23f3da669 core: use libnl CFLAGS and LIBS consistently
This patch is used in OpenEmbedded [1] since commit 154bd72b [2][3].

[1] http://www.openembedded.org/
[2] http://cgit.openembedded.org/cgit.cgi/openembedded/log/recipes/networkmanager/networkmanager/0001-respect-libnl-flags-also-in-backends-ip6-manager.patch
[3] http://cgit.openembedded.org/cgit.cgi/openembedded/commit/?id=154bd72b1ca859afcae5ed4fe99ed611a13a475c

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2011-05-19 15:31:02 -05:00
Dan Williams
6dae3c2f33 ppp: enable pppd debug logging when PPP log domain is enabled for debuggin
Instead of just with the old environment variable.  This means we'll
log pppd debug output when the log level is changed via the D-Bus
interface now too.
2011-05-19 13:31:52 -05:00
Dan Williams
e083cd5c63 settings: when checking for system-owned secrets ignore NOT_SAVED
Previously a secret marked NOT_SAVED or NOT_REQUIRED would be
treated as a system secret when checking returned secrets.  That's
incorrect since unsaved or not required secrets aren't stored
by system settings.
2011-05-19 13:14:51 -05:00
David Woodhouse
05a959d1d6 settings: fix VPN secret flag handling in secrets returned from agents
We need to push one more level down into VPN secrets when checking
the secret flags on VPN settings.
2011-05-19 13:11:49 -05:00
Dan Williams
304d0b869b core: openconnect migration hack
Evil hack; but the problem is that before this commit anyone who
migrated connections wouldn't have the right secrets flag set in
their openconnect connections.  Figuring out some way of updating
those connections now is harder and we don't want people to have
to go through the delete-connection-file-change-applet-stamp-rerun
dance.  So we'll live with this for now...
2011-05-18 22:45:24 -05:00
Dan Williams
b6a63ff025 core: allow build-time enable/disable of PolicyKit
When PK is turned off, everything is authorized.
2011-05-18 22:38:39 -05:00
Dan Williams
f79dcb9560 core: consolidate PolicyKit code
Use one global PolkitAuthority object; we only really need to use it
in one place anyway.  So consolidate the code that uses polkit into
nm-manager-auth.c.
2011-05-18 22:20:24 -05:00
Dan Williams
487cd8a301 libnm-util: fix possible crash passing in NULL secret flags 2011-05-18 17:47:03 -05:00
Dan Williams
9c2cce5ac9 trivial: remove unused prototype 2011-05-18 11:13:34 -05:00
Dan Williams
4d38c1a23a trivial: add missing curly brace 2011-05-18 11:10:50 -05:00
Dan Williams
a2cd94f83f wifi: ignore zero-length SSIDs in internal wifi code
Should never get these, and if we do, we should ignore them by
leaving the SSID as NULL.
2011-05-18 10:32:03 -05:00
Dan Williams
5f073ece4b wifi: return error for AddAndActivate requests for hidden APs
If there's no SSID, we can't connect at all.  So if a client passes
in a hidden AP, and doesn't send the SSID in the partial connection
info, we can't make a connection with it.  Return an error instead
of crashing.
2011-05-18 10:22:25 -05:00
Dan Williams
60c1870674 Revert "core: fix crash while connecting with AddAndActivateConnection() and SSID is missing"
This reverts commit 2b12825faa.

Fixes the problem, but the real issue was clients passing AP objects
that don't have an SSID; we need to reject connection creation
requests where the SSID can't be found.
2011-05-18 10:21:10 -05:00
Jiří Klimeš
2b12825faa core: fix crash while connecting with AddAndActivateConnection() and SSID is missing
A network with hidden SSID can appear in gnome-shell indicator applet as
<unknown> entry. Clicking it can make NM crash if there is no SSID in wireless
setting nor in AP.
2011-05-18 14:53:57 +02:00
Dan Williams
7b41be489c libnm-util: allow _ as a valid character for GSM APNs
The ETSI specs state that valid characters are only ASCII alphanumeric
characters, but then state that APNs should generally follow DNS
naming rules.  Well, that means a lot more characters are allowed,
but modems don't like many of them.  So let's slowly allow more
characters as people find ones that actually are used.  The restriction
was originally put in place to disallow spaces, because they
certainly aren't allowed APN characters and modems and the
network puke when they see spaces.
2011-05-17 10:49:44 -05:00
Dan Williams
5deb993ff6 libnm-util: recognize PKCS#8 private keys and check passwords (bgo #649326)
Neither gnutls nor NSS fully support PKCS#8 so we don't have complete
support here, but at least recognize the keys and make an attempt to
check the private key if we can.
2011-05-13 14:22:06 -05:00
Jiří Klimeš
5737573314 dhclient: only send hostname without domain as host-name option (rh #694758) 2011-05-13 11:44:22 +02:00
Thomas Bechtold
cecc0621ce core: recognize platform 'gadget' devices too 2011-05-12 12:14:09 -05:00
Dan Williams
74d798b6dd dispatcher: pass DHCP options as string:string hash
This is what was originally intended, but the NM-side code wasn't
doing this due to an oversight...
2011-05-11 16:01:12 -05:00
Dan Williams
6109388df2 Revert "dispatcher: handle DHCP Options property correctly"
This reverts commit e5e3dbf415.

The patch fixes the issue but it should really be resolved by the
NM dispatcher code in NetworkManagerUtils.c flattening the DHCP
Options property instead, keeping the dispatcher code simpler.
2011-05-11 15:24:40 -05:00
Dan Williams
bcba83592e wimax: make sure current NSP is cleared when appropriate
When removing all NSPs in the scan list clearly we should be clearing
out the current NSP as well, since it just got removed from the scan
list.  And make sure the current NSP is cleared when activation fails
or when the device becomes disconnected, since it's not connected to
anything and thus can't have a current NSP either.

The current NSP should only be set during the activation attempt and
while the device is connected.
2011-05-11 15:21:05 -05:00
Dan Williams
f74c9ebe8f wimax: don't attempt to connect while device is scanning
The WiMAX SDK will reject connect requests while the device is scanning,
which happens when right after suspend or when the wimax radio is
turned on.  Postpone the connect attempt until the device says it's
not scanning anymore instead of having the connect attempt fail
and be retried.
2011-05-11 15:21:05 -05:00
Jiří Klimeš
e5e3dbf415 dispatcher: handle DHCP Options property correctly 2011-05-11 16:16:48 +02:00
Bill Nottingham
0ce4b6b412 systemd: tweak NM-wait-online.service
1) Don't require NM, but run after it. This allows this service
to be installed without bringing up NetworkManager. Add -x so that
it exits if NM isn't running.

2) Install as a want of network.target, instead of multi-user.target.
This allows us to skip it if nothing requires network.target or the
legacy $network SysV capability.
2011-05-10 16:34:11 -05:00
Dan Williams
9ff4914ccc libnm-util: fix some GObject Introspection annotations
Unfortunately, GObject Introspection can no longer describe deeper
types, like those inside nested hash tables, which NM uses extensively
for the NMConnection type and other places.  So we have to remove
those descriptions.  But this moves us back into compliance with
GOI annotation formats.
2011-05-10 13:24:07 -05:00
Dan Williams
ab56b8e925 libnm-util: clarify certificate and key argument names
Clarify that these are supposed to be paths in the argument name;
this shouldn't break API as it's just an argument rename.  Helps
users figure out what the argument should be without as much trouble
as 'value', which is what it was before.
2011-05-10 12:44:01 -05:00
Dan Williams
a08e9b928e core: fix dispatcher handling of empty VPN interface (bgo #649773)
We pass a VPN IP iface of "" through D-Bus (since dbus doesn't do NULL)
and the dispatcher code wasn't ignoring that as it should have been.
2011-05-10 11:33:43 -05:00
Dan Williams
5e2cda5c20 core: fix typo 2011-05-09 13:55:19 -05:00
Dan Williams
4ae83f2d93 libnm-util: remove unused #include 2011-05-09 13:34:21 -05:00
Kristjan SCHMIDT
77e78df1bd po: update Esperanto translation (bgo #649580) 2011-05-06 13:10:47 -05:00