Commit da49ff95 authored by David Zeuthen's avatar David Zeuthen
Browse files

Log when the name org.fd.PolicyKit1 has been acquired


Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 8e0383cb
......@@ -53,12 +53,8 @@ on_bus_acquired (GDBusConnection *connection,
g_print ("Connected to the system bus\n");
g_assert (authority == NULL);
g_assert (registration_id == NULL);
authority = polkit_backend_authority_get ();
g_print ("Using authority class %s\n", g_type_name (G_TYPE_FROM_INSTANCE (authority)));
error = NULL;
registration_id = polkit_backend_authority_register (authority,
connection,
......@@ -77,7 +73,8 @@ on_name_lost (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
g_print ("Lost the name org.freedesktop.PolicyKit1 - exiting\n");
polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
"Lost the name org.freedesktop.PolicyKit1 - exiting");
g_main_loop_quit (loop);
}
......@@ -86,7 +83,8 @@ on_name_acquired (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
g_print ("Acquired the name org.freedesktop.PolicyKit1\n");
polkit_backend_authority_log (POLKIT_BACKEND_AUTHORITY (authority),
"Acquired the name org.freedesktop.PolicyKit1 on the system bus");
}
static gboolean
......@@ -216,6 +214,8 @@ main (int argc,
if (g_getenv ("PATH") == NULL)
g_setenv ("PATH", "/usr/bin:/bin:/usr/sbin:/sbin", TRUE);
authority = polkit_backend_authority_get ();
loop = g_main_loop_new (NULL, FALSE);
sigint_id = g_unix_signal_add (SIGINT,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment