2008-05-08 Tambet Ingo <tambet@gmail.com>
authorTambet Ingo <tambet@gmail.com>
Fri, 9 May 2008 06:33:30 +0000 (06:33 +0000)
committerTambet Ingo <tambet@gmail.com>
Fri, 9 May 2008 06:33:30 +0000 (06:33 +0000)
commitd2cf6fa75ccd58a304b058d1f64c5fbdb57c9c2a
treec6bf476a8d05a32c3edf5c3914ca44b3903a6195
parente01dfa43b33e812bab8584ed247f6b9bab7aa091
2008-05-08  Tambet Ingo  <tambet@gmail.com>

     Use PolicyKit to authorize the system settings' AddConnection method
     and the system settings connections' Update and Delete methods.

     * libnm-glib/nm-settings.c (impl_exported_connection_update)
     (impl_exported_connection_delete, nm_exported_connection_update)
     (nm_exported_connection_delete): Return boolean and fill GError
     to notify the callers of the reasons why it might have failed.

     * libnm-glib/nm-dbus-settings-system.c
     (nm_dbus_settings_system_add_connection): Return the error from dbus
     call so that the callers can see why it failed.

     * libnm-glib/nm-dbus-connection.c (update, delete): Update the
     signatures.

     * system-settings/src/nm-polkit-helpers.[ch]: Implement.

     * system-settings/src/nm-sysconfig-connection.[ch]: Implement. New
     abstract base class that checks PolicyKit permissions.

     * system-settings/src/dbus-settings.c:
     (impl_settings_add_connection): Check the policy before carring out
     the request.

     * system-settings/plugins/keyfile/nm-keyfile-connection.c:
     Inherit from NMSysconfigConnection, check the policies before
     allowing updating or removing.

     * system-settings/plugins/ifcfg-suse/nm-suse-connection.c:
     Inherit from NMSysconfigConnection.

     * introspection/nm-exported-connection.xml: Annotate "Update" and
     "Delete" methods with async flag so that the implementations can get
     access to DBusGMethodInvocation.

     * system-settings/src/dbus-settings.c
     (settings_add_connection_check_privileges): Implement.
     (impl_settings_add_connection): Check the privileges before adding a new
     connection. Improve error reporting.

     * introspection/nm-settings-system.xml: Make the 'AddConnection' method
     async so that the implementation can access DBusGMethodInvocation.

     * configure.in: Check for PolicyKit.

     * policy/org.freedesktop.network-manager-settings.system.policy:
     New file.

     * policy/Makefile.am: Install the policy file.

     * configure.in: Add 'policy' subdir.

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3646 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
21 files changed:
ChangeLog
Makefile.am
configure.in
introspection/nm-exported-connection.xml
introspection/nm-settings-system.xml
libnm-glib/nm-dbus-connection.c
libnm-glib/nm-dbus-settings-system.c
libnm-glib/nm-dbus-settings-system.h
libnm-glib/nm-settings.c
libnm-glib/nm-settings.h
system-settings/plugins/ifcfg-suse/nm-suse-connection.c
system-settings/plugins/ifcfg-suse/nm-suse-connection.h
system-settings/plugins/keyfile/nm-keyfile-connection.c
system-settings/plugins/keyfile/nm-keyfile-connection.h
system-settings/plugins/keyfile/plugin.c
system-settings/src/Makefile.am
system-settings/src/dbus-settings.c
system-settings/src/nm-polkit-helpers.c [new file with mode: 0644]
system-settings/src/nm-polkit-helpers.h [new file with mode: 0644]
system-settings/src/nm-sysconfig-connection.c [new file with mode: 0644]
system-settings/src/nm-sysconfig-connection.h [new file with mode: 0644]