Commit graph

5158 commits

Author SHA1 Message Date
Dan Williams
d3e640eacf ifcfg-rh: propagate errors from updating new connection settings 2010-10-29 23:15:38 -05:00
Dan Williams
034aee641a ifcfg-rh: fix possible warning
'added' won't always be valid, and thus the GObject typecast could fail.
Use a C typecast instead.
2010-10-29 23:14:42 -05:00
Dan Williams
453ea4d5c7 settings: make sure we use a clear error every time 2010-10-29 23:13:57 -05:00
Dan Williams
947efa3080 libnm-util: verify permissions property type
Connections are normally created from hashes using g_object_set()
which calls that object's set_property handler.  But GObject does
not allow errors to be returned from property handlers, so if the
type doesn't match what it should be, the property does not get
set, and error is printed to stdout, and life goes on.

But that's not what we want for the permissions property since the
client might expect that property to be set, but the connection now
is available to everyone.  So validate the permissions property
type (its really the only one we need to be so paranoid about)
and return an error when the incoming property type is wrong.
2010-10-29 22:31:23 -05:00
Dan Williams
85db10a13f settings: fix connection addition
Need to make sure we actually export the connection over D-Bus (via
claim_connection()) before we try to return its object path in the
AddConnection reply.  Second, we need to send the path as a string
in the reply, not an object, since the return type is an object path.
2010-10-29 22:10:32 -05:00
Dan Williams
9d725be3a9 settings: fix signature of connection updated handler 2010-10-29 22:05:23 -05:00
Dan Williams
c2ca4298fa ifcfg-rh: ensure connection is still alive for the removal signal 2010-10-29 16:58:07 -05:00
Dan Williams
37845af954 settings: return new connection object path from AddConnection
Finally.
2010-10-29 14:34:33 -05:00
Dan Williams
856a1c6b2c ifnet: fix memory leak 2010-10-29 14:01:22 -05:00
Dan Williams
28b17c8b4f ifnet: trivial cleanups 2010-10-29 13:58:23 -05:00
Dan Williams
8a6e2b6560 ifnet: constify tons of stuff
Use 'const char *' where appropriate.
2010-10-29 13:56:23 -05:00
Dan Williams
090329d0be ifnet: fix include name broken by 3f64bf5e36 2010-10-29 11:02:56 -05:00
Dan Williams
d1faa496d0 ifcfg-rh: remove unused UDI stuff 2010-10-28 09:29:16 -05:00
Dan Williams
3f64bf5e36 settings: rename NM_SYSCONFIG_SETTINGS_ERROR -> NM_SETTINGS_ERROR 2010-10-27 20:38:26 -05:00
Dan Williams
83ab4ec2ee settings: system-settings -> settings 2010-10-27 20:22:14 -05:00
Dan Williams
1ec6b67162 settings: rename NMSysconfigSettings to NMSettings 2010-10-27 20:05:23 -05:00
Dan Williams
18f819d71d policy: clean up device signal handling 2010-10-27 16:57:31 -05:00
Dan Williams
6329fadb48 core: fix refcounting of settings object 2010-10-27 16:50:57 -05:00
Dan Williams
e2275bba68 settings: fix handling of connection visibility changes 2010-10-27 16:50:09 -05:00
Dan Williams
3c32c02778 policy: fix and clean up policy signal disconnection on dispose 2010-10-27 16:46:32 -05:00
Dan Williams
b3b722e234 core: fix session monitor initialization
Braindead error handling on my part.
2010-10-27 16:45:52 -05:00
Dan Williams
33deafe69d settings: return the right thing when listing connections 2010-10-27 16:24:48 -05:00
Dan Williams
153e11eeea settings: small optimization
hash table already has the exported object path, no reason to ask
the connection itself for it.
2010-10-27 16:23:47 -05:00
Dan Williams
330cb35630 policy: make sure we have a valid settings object 2010-10-27 16:22:18 -05:00
Dan Williams
02711a0e67 settings: re-add exported NewConnection signal
Oops, got removed in an earlier commit.
2010-10-27 16:20:41 -05:00
Dan Williams
f1d4af6996 settings: make sure we get our D-Bus connection before using it 2010-10-27 16:17:44 -05:00
Dan Williams
84def2fedf settings: remove connection tracking from NMManager
NMSysconfigSettings has the authoritative list of connections, no reason
to duplicate all that tracking code in NMManager.  Add the missing bits
that the manager had to NMSysconfigSettings, and point NMPolicy at the
settings object instead of NMManager for that.
2010-10-27 15:47:10 -05:00
Dan Williams
b51cef3cba settings: clean up connection visibility and session change handling 2010-10-26 16:33:47 -05:00
Dan Williams
edbf4a3ca2 core: allow ConsoleKit usage to be disabled 2010-10-26 15:57:03 -05:00
Dan Williams
e5adfcbabe settings: remove remnants of unused CheckPermissions signal 2010-10-26 11:40:43 -05:00
Dan Williams
7b50607fc9 settings: consolidate settings connection purged and removed signals
They almost do the same thing.
2010-10-26 11:36:38 -05:00
Dan Williams
d2d48676fc settings: remove older session monitor code 2010-10-26 11:19:29 -05:00
Dan Williams
925d69c6d1 core: use new session monitor in system connection class 2010-10-26 11:15:19 -05:00
Dan Williams
39ed9c2956 core: get D-Bus manager during auth if not provided 2010-10-26 11:00:30 -05:00
Dan Williams
1b21949380 core: move session monitor to core
We'll need it for agent authentication too, so move it out of
system settings specific code.
2010-10-25 23:43:04 -05:00
Dan Williams
0c409d75ea settings: add a simpler session monitor
Heavily modified from polkitbackendsessionmonitor.c, thanks davidz!
2010-10-25 23:24:44 -05:00
Dan Williams
8f7aedc7e0 Merge remote branch 'origin/master' into rm-userset 2010-10-18 19:02:27 -05:00
Dan Williams
b368b8fea3 Merge remote branch 'origin/sup-rework' 2010-10-18 18:40:42 -05:00
Dan Williams
8310593ce4 core: ignore authorization for sleep/wake requests (but restrict to root) (rh #638640)
Everyone uses pm-utils still for sleep/wake support, and that's
traditionally how NM was put to sleep and woken up.  But pm-utils
uses dbus-send without --print-reply so dbus-send quits immediately
after sending the message.  That doesn't give NM enough time to
get the senders UID and thus validate the request, so the request
gets denied, and sometimes NM stays asleep after the machine is
woken up.

Instead, don't get the sender's UID and try to authorize it, but
just let the request go through.  Rely on D-Bus permissions to
make sure that only root can call sleep/wake methods.
2010-10-15 10:33:34 -05:00
Jiří Klimeš
9f2b48ef08 libnm-glib: call D-Bus with a timeout when Set()ting properties
The caller needs to be authenticated, so wait a bit to be sure
it didn't quit too quickly.
2010-10-15 09:41:34 +02:00
Dan Williams
fee318abdb settings: remove groups checking
See "libnm-util: simplify permissions somewhat; remove groups"
for more rationale.  Might come back later.
2010-10-12 18:01:11 -05:00
Dan Williams
82772191a9 libnm-util: simplify permissions somewhat; remove groups
Groups may come later, but they are also quite a bit more complicated
because getting the groups a user is in may require network access
if that user is backed by LDAP.  And it gets worse because you have
no idea that the glibc calls like getgrouplist(3) are backed by
the network and may take an arbitrary amount of time to complete.
Punt that.
2010-10-12 17:55:08 -05:00
Dan Williams
f532f41c02 supplicant: ratelimit supplicant activation
If the supplicant dies a number of times within a short period of
time, make it go sit in the corner for a bit instead of continuously
trying to start it and have it die again.

Instead of just exposing a "running" value, instead make a meta
"available" value that's a combination of whether the supplicant
is actually running plus whether we want to talk to it right now
or not.
2010-10-12 14:18:42 -05:00
Dan Williams
39e111e5eb supplicant: ignore unknown wpa_supplicant states
Don't treat them as DISCONNECTED.
2010-10-11 20:35:54 -05:00
Dan Williams
48e37de3a4 supplicant: prevent a race condition due to D-Bus activation
interface_add() could get called from two places: by the wifi/eth
device class when activating (which if the supplicant isn't yet
running will D-Bus activate it) and from the NameOwnerChanged
handler for the wpa_supplicant dbus service smgr_running_cb().

So if the supplicant wasn't running, nm_supplicant_interface_new()
would call interface_add() to bring the supplicant to life via
activation, then go on and create priv->iface_proxy.  When the
supplicant appeared and D-Bus sent the NameOwnerChanged,
smgr_running_cb() would also call interface_add(), creating a
second priv->iface_proxy.  The first one got lost and lived after
its parent NMSupplicantInterface was killed, and could still
respond to signals over the bus.

Prevent that by adding another state, STARTING, that indicates
that we've already started talking to the supplicant.  Also be
extra paranoid about disconnecting signal handlers on the proxy.
2010-10-11 20:30:40 -05:00
Dan Williams
5858c6103e supplicant: make sure we remove the right interface
It shouldn't ever happen that two interface objects for the same
network interface are active at the same time, but make sure we
yell if it does.
2010-10-11 20:27:51 -05:00
Alex Vogt
d40c81b06a linexa: add basic Linexa support 2010-10-08 23:03:10 -05:00
Dan Williams
be97e7f104 build: include <config.h> for kill(2), isblank(3), and isascii(3)
config.h defines _GNU_SOURCE, which in turn defines the bits necessary
for kill, isblank, and isascii.  So wherever we use those, we need
to make sure config.h is included.
2010-10-08 22:46:55 -05:00
cee1
9ee77769af trivial: add missing includes 2010-10-08 16:43:16 -05:00
Dan Williams
bbf3f12d7b policy: prevent hostname duplication in /etc/hosts 2010-10-07 18:24:59 -05:00