PolicyKit: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Mon Aug 9 10:34:09 PDT 2010
src/polkitagent/polkitagenthelperprivate.c | 11 ++++++++---
src/polkitagent/polkitagentlistener.c | 2 +-
src/programs/pkaction.c | 9 ++++++++-
src/programs/pkcheck.c | 9 ++++++++-
src/programs/pkexec.c | 9 ++++++++-
5 files changed, 33 insertions(+), 7 deletions(-)
New commits:
commit 4f9bbd75a897624b16b1473c43584ed6d47f1920
Author: David Zeuthen <davidz at redhat.com>
Date: Mon Aug 9 13:33:41 2010 -0400
Use polkit_authority_get_sync() instead of deprecated polkit_authority_get()
Signed-off-by: David Zeuthen <davidz at redhat.com>
diff --git a/src/polkitagent/polkitagenthelperprivate.c b/src/polkitagent/polkitagenthelperprivate.c
index be495e9..d4495dd 100644
--- a/src/polkitagent/polkitagenthelperprivate.c
+++ b/src/polkitagent/polkitagenthelperprivate.c
@@ -55,11 +55,16 @@ send_dbus_message (const char *cookie, const char *user)
ret = FALSE;
- error = NULL;
-
g_type_init ();
- authority = polkit_authority_get ();
+ error = NULL;
+ authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error);
+ if (authority == NULL)
+ {
+ g_printerr ("Error getting authority: %s\n", error->message);
+ g_error_free (error);
+ goto out;
+ }
identity = polkit_unix_user_new_for_name (user, &error);
if (identity == NULL)
diff --git a/src/polkitagent/polkitagentlistener.c b/src/polkitagent/polkitagentlistener.c
index 528aabe..f8321f4 100644
--- a/src/polkitagent/polkitagentlistener.c
+++ b/src/polkitagent/polkitagentlistener.c
@@ -188,7 +188,7 @@ server_init_sync (Server *server,
if (server->system_bus == NULL)
goto out;
- server->authority = polkit_authority_get ();
+ server->authority = polkit_authority_get_sync (cancellable, error);
if (server->authority == NULL)
goto out;
diff --git a/src/programs/pkaction.c b/src/programs/pkaction.c
index 7d8f645..2d8c90d 100644
--- a/src/programs/pkaction.c
+++ b/src/programs/pkaction.c
@@ -167,7 +167,14 @@ main (int argc, char *argv[])
goto out;
}
- authority = polkit_authority_get ();
+ error = NULL;
+ authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error);
+ if (authority == NULL)
+ {
+ g_printerr ("Error getting authority: %s\n", error->message);
+ g_error_free (error);
+ goto out;
+ }
error = NULL;
actions = polkit_authority_enumerate_actions_sync (authority,
diff --git a/src/programs/pkcheck.c b/src/programs/pkcheck.c
index fbda073..fb61b33 100644
--- a/src/programs/pkcheck.c
+++ b/src/programs/pkcheck.c
@@ -209,7 +209,14 @@ main (int argc, char *argv[])
goto out;
}
- authority = polkit_authority_get ();
+ error = NULL;
+ authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error);
+ if (authority == NULL)
+ {
+ g_printerr ("Error getting authority: %s\n", error->message);
+ g_error_free (error);
+ goto out;
+ }
error = NULL;
flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE;
diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c
index b0193f4..4a3d55d 100644
--- a/src/programs/pkexec.c
+++ b/src/programs/pkexec.c
@@ -619,7 +619,14 @@ main (int argc, char *argv[])
goto out;
}
- authority = polkit_authority_get ();
+ error = NULL;
+ authority = polkit_authority_get_sync (NULL /* GCancellable* */, &error);
+ if (authority == NULL)
+ {
+ g_printerr ("Error getting authority: %s\n", error->message);
+ g_error_free (error);
+ goto out;
+ }
details = polkit_details_new ();
More information about the hal-commit
mailing list