Commit graph

39 commits

Author SHA1 Message Date
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
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
4d43ce8fa0 Merge remote branch 'origin/master' into zvm 2010-07-27 23:24:10 -07:00
Dan Williams
d533c807e6 system-settings: return InvalidSetting when secrets setting doesn't exist (bgo #623744)
So that clients can handle the error intelligently; it's not
really a fatal error.
2010-07-21 15:54:44 -07:00
Dan Williams
0b41797b49 s390: replace 'zvm' with s390
ZVM isn't the right terminology here.  s390 is.
2010-06-17 21:24:14 -07:00
Dan Williams
860e8a13eb system-settings: some s390 device types only use 2 channels 2010-05-26 17:27:37 -07:00
Dan Williams
d0ff1fd2ec system-settings: add unmanaged spec for z/VM subchannels (rh #591533) 2010-05-26 15:30:37 -07:00
Jiří Klimeš
a4cc8873c9 system-settings: fix loading connection by plugins
The error case was as follows. When using 'ifupdown,keyfile' plugins
and 'eth0' present in /etc/network/interfaces on a Debian-based system,
'ifupdown' plugin, in unmanaged mode, load_connections() prematurely
and thus effectively blocked reading connections from 'keyfile' plugin.
Patch by Dan and tested by me.
2010-04-23 12:13:04 +02:00
Dan Williams
6d6f7d3d90 core: ensure errors are dbus-glib accessible (rh #581794)
Errors that can possibly be returned from D-Bus method calls
need to be registered with dbus-glib.
2010-04-22 12:27:31 -07:00
Dan Williams
3f1604f3f0 system-settings: update logging 2010-04-07 12:27:34 -07:00
Dan Williams
da98780506 system-settings: update logging 2010-04-07 11:31:02 -07:00
Dan Williams
b5bad00bc3 system-settings: remove unneeded include 2010-02-18 08:02:15 -08:00
Dan Williams
95da6625b7 system-settings: register setting errors so D-Bus errors are meaningful
The errors weren't registered with dbus-glib yet for some reason, so
errors returned when adding invalid connections or updating or whatever
weren't meaningful at all.  We register them in the system settings
service (and not libnm-util) becuase libnm-util doesn't really have
anything to do wtih D-Bus, so we put the error registration with the
code that exports the connections over the bus.
2010-02-15 17:26:55 -08:00
Dan Williams
72f936db31 policy: fall back to original hostname before trying reverse DNS
Having the original hostname checks in the settings-service code
didn't allow the policy enough granularity to differentiate between
a plugin-provided hostname and the original hostname.  We want to
fall back to the original hostname if there isn't a persistent
hostname (from a plugin) and if there isn't a DHCP-provided
hostname.  Moving the original hostname checks to the policy
makes that possible.  Clarify the precedence order at the same
time, and minimally validate the DHCP hostname as well.
2010-01-27 17:13:35 -08:00
Tambet Ingo
d98c431c65 system-settings: Fix using hostname from DHCP
When a plugin has hostname capability, it's NULL for hostname means "use
the hostname from DHCP server".
2009-12-22 09:11:30 +02:00
Dan Williams
1151ac2478 system-settings: cache secrets to protect against nm_connection_clear_secrets()
3rd patch in a series with:
0bbdc6b0fc
b135fa3265

With NM 0.8 the system settings service was integrated into NM and
thus nm_connection_clear_secrets() acts directly on the system
settings plugins' NMConnection objects.  So when NM cleared secrets
(for example after determining that they might be bad in a device's
stage2 handler), we completely lost the secrets forever.

With this commit, the secrets are now cached and updated whenever
the connection is updated, and thus are again available to send to
NetworkManager when needed.
2009-11-16 16:48:59 -08:00
Dan Williams
0bbdc6b0fc system-settings: generalize nm_sysconfig_connection_update() a bit
So that it can be the sole location where secrets caching happens.
2009-11-16 16:14:50 -08:00
Dan Williams
b135fa3265 system-settings: add helper for updating plugin connections
nm_connection_replace_settings() replaces the connection's settings
but doesn't allow interception of the new settings.  Plugins would then
send out the update signal, but secrets are scrubbed out of them to
ensure secrets aren't leaked out into D-Bus signals.

With NM 0.8 the system settings service was integrated into NM and
thus nm_connection_clear_secrets() acts directly on the system
settings plugins' NMConnection objects.  So when NM cleared secrets
(for example after determining that they might be bad in a device's
stage2 handler), we completely lost the secrets forever.

Adding this function allows the system settings service to hook into
the connection updates when the plugin connection's backing storage
(like config files or whatever) changes and cache the secrets for
use in NMSettingsConnectionInterface get_secrets() requestes.
2009-11-16 15:51:40 -08:00
Dan Williams
50fdbabbcb system-settings: fix crash when deleting auto wired connections
Make it less magical and therefore actually work.
2009-11-14 11:26:38 -08:00
Dan Williams
f8643cc072 system-settings: fix PK Authority object lifetimes
It's a singleton, but PolicyKit didn't increment the reference count
when returning from polkit_authority_get() like we expected (which has
since been fixed upstream).  So for now, just don't unref the authority
at all.

Since we don't do that, there's a chance that some PolicyKit calls could
be outstanding when either the NMSysconfigSettings object or one of the
NMSysconfigConnection objects are around, so we make sure we cancel any
PolicyKit calls when the object gets disposed.  This is tricky, because
canceling them from the dispose may mean that the callback gets called
after the object is actually destroyed, so we have to be careful not to
access any private object data from the callbacks in that situation.
2009-10-21 14:23:24 -07:00
Dan Williams
7f63b48854 system-settings: fix writing connections when an earlier plugin can't (bgo #581758)
The error object passed to the plugin's add-connection handler wasn't
getting properly cleared if an earlier plugin had failed to write
the connection and fell back to the current plugin.
2009-10-15 20:52:00 -07:00
Dan Williams
72a98c5b29 system-settings: fix crash saving default wired connections to backing storage (lp:430781)
Fix up refcounting, plus it turns out that we already have the MAC address
lying around as	a GObject data item, so	we don't need to go grab it
from the connection itself.
2009-10-05 17:46:16 -07:00
Dan Williams
99e5a86394 system-settings: handle byte-array secrets too 2009-09-17 10:38:54 -07:00
Dan Williams
58fcc8efe6 libnm-glib: libnm_glib -> libnm-glib
Bothered me for a long time; now that we've bumped the soname, we can
rename the library too.
2009-08-26 13:07:35 -05:00
Dan Williams
d56674b147 libnm-glib: NMSettingsSystemPermission -> NMSettingsSystemPermissions 2009-08-24 15:57:11 -05:00
Dan Williams
2dbaab2221 system-settings: add permissions
Since the new PolicyKit does away with easy checking of authorizations,
we get to implement it by ourselves, but that's OK since we can actually
use it for a lot more stuff.  So add the GetPermissions call which returns
the permissions the caller actually has, and a signal informing callers
that their permissions might have changed.  Hook this all up to
PolicyKit so it's useful.
2009-08-24 13:03:09 -05:00
Dan Williams
56a597be32 core: use defined signal names 2009-08-24 10:17:05 -05:00
Dan Williams
e2b13be3d9 Merge commit 'origin/master' into polkit1
Conflicts:
	libnm-glib/Makefile.am
	src/system-settings/nm-sysconfig-settings.c
	system-settings/plugins/ifcfg-rh/plugin.c
2009-08-21 14:12:31 -05:00
Dan Williams
537c2f1f86 build: always link locally-built libraries first (bgo #580131) 2009-08-20 12:31:17 -05:00
Alexander Sack
2e849a0cb8 system-settings: fix crasher (lp:411668) 2009-08-12 17:19:55 -05:00
Dan Williams
fb34976ab9 system-settings: remove redundant default methods for update/delete
NMExportedConnection implements these already, and we want the functionality
that it provides, so we don't need to override them here.
2009-08-12 17:10:20 -05:00
Dan Williams
d26b436d9e libnm-glib: NMSettingsInterface::add_connection() should take an NMConnection
instead of an NMSettingsConnectionInterface, because we won't always have an
object that implements NMSettingsConnectionInterface.  Plus, since NMConnection
is a prerequisite of NMSettingsConnectionInterface, the NMConnection will
always be there anyway.
2009-08-11 14:12:48 -05:00
Dan Williams
71507c9fa3 system-settings: fix issues with system settings service property types 2009-08-10 23:52:03 -05:00
Dan Williams
890866bef9 system-settings: clean up settings service classes
Make NMSettingsService implement most of the NMSettingsInterface
API to make subclasses simpler, and consolidate exporting of
NMExportedConnection subclasses in NMSettingsService instead of
in 3 places.  Make NMSysconfigSettings a subclass of
NMSettingsService and save a ton of code.
2009-08-10 23:25:11 -05:00
Dan Williams
0d69dfe39e libnm-glib: implement new settings interfaces
The old NMExportedConnection was used for both client and server-side classes,
which was a mistake and made the code very complicated to follow.  Additionally,
all PolicyKit operations were synchronous, and PK operations can block for a
long time (ie for user input) before returning, so they need to be async.  But
NMExportedConnection and NMSysconfigConnection didn't allow for async PK ops
at all.

Use this opportunity to clean up the mess and create GInterfaces that both
server and client objects implement, so that the connection editor and applet
can operate on generic objects like they did before (using the interfaces) but
can perform specific operations (like async PK verification of callers) depending
on whether they are local or remote or whatever.
2009-07-23 09:20:52 -04:00
Dan Williams
fec407b345 system-settings: resurrect auto-wired-default behavior
Dropped due to time during the udev conversion.
2009-07-09 11:06:31 -04:00
Dan Williams
9c8e600078 system-settings: let UID 0 bypass PolicyKit for PK < 1.0
PK < 1.0 doesn't work with UID 0 processes that aren't spawned via a
session-manager, and thus don't have the XDG_SESSION_COOKIE in their
environment (which ConsoleKit uses to figure out what session the
caller is in).  But since root could just scribble over the config
files anyway, bypassing PK for UID 0 doesn't meaningfully decrease
security.
2009-07-02 12:46:32 -04:00
Dan Williams
c9067d8fed everything: use libgudev instead of HAL; merge NM and nm-system-settings
The only thing that doesn't work yet is the system-settings service's
"auto eth" connections for ethernet devices that don't have an existing
connection.  Might also have issues with unmanaged devices that can't
provide a MAC address until they are brought up, but we'll see.
2009-06-11 00:39:12 -04:00