summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2010-08-09 13:33:41 -0400
committerDavid Zeuthen <davidz@redhat.com>2010-08-09 13:33:41 -0400
commit4f9bbd75a897624b16b1473c43584ed6d47f1920 (patch)
tree01686f92b10fd5a4116e188752c20500491c704a
parent07186ab99e66aba27a10b43f834d04fbdee302ca (diff)
downloadpolkit-4f9bbd75a897624b16b1473c43584ed6d47f1920.tar.gz
Use polkit_authority_get_sync() instead of deprecated polkit_authority_get()
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--src/polkitagent/polkitagenthelperprivate.c11
-rw-r--r--src/polkitagent/polkitagentlistener.c2
-rw-r--r--src/programs/pkaction.c9
-rw-r--r--src/programs/pkcheck.c9
-rw-r--r--src/programs/pkexec.c9
5 files changed, 33 insertions, 7 deletions
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 ();