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.
This commit is contained in:
Dan Williams
2011-05-18 22:20:24 -05:00
parent 487cd8a301
commit f79dcb9560
9 changed files with 166 additions and 247 deletions

View File

@@ -21,7 +21,6 @@
#ifndef NM_MANAGER_AUTH_H
#define NM_MANAGER_AUTH_H
#include <polkit/polkit.h>
#include <glib.h>
#include <dbus/dbus-glib.h>
@@ -56,25 +55,16 @@ typedef void (*NMAuthChainResultFunc) (NMAuthChain *chain,
DBusGMethodInvocation *context,
gpointer user_data);
typedef void (*NMAuthChainCallFunc) (NMAuthChain *chain,
const char *permission,
GError *error,
NMAuthCallResult result,
gpointer user_data);
NMAuthChain *nm_auth_chain_new (PolkitAuthority *authority,
DBusGMethodInvocation *context,
NMAuthChain *nm_auth_chain_new (DBusGMethodInvocation *context,
DBusGProxy *proxy,
NMAuthChainResultFunc done_func,
gpointer user_data);
NMAuthChain *nm_auth_chain_new_raw_message (PolkitAuthority *authority,
DBusMessage *message,
NMAuthChain *nm_auth_chain_new_raw_message (DBusMessage *message,
NMAuthChainResultFunc done_func,
gpointer user_data);
NMAuthChain *nm_auth_chain_new_dbus_sender (PolkitAuthority *authority,
const char *dbus_sender,
NMAuthChain *nm_auth_chain_new_dbus_sender (const char *dbus_sender,
NMAuthChainResultFunc done_func,
gpointer user_data);
@@ -112,5 +102,7 @@ gboolean nm_auth_uid_in_acl (NMConnection *connection,
gulong uid,
char **out_error_desc);
void nm_auth_set_changed_func (GDestroyNotify callback, gpointer callback_data);
#endif /* NM_MANAGER_AUTH_H */