← Back to team overview

registry team mailing list archive

[Bug 275432] Re: libpolkit requires files from policykit for polkit_context_init to work

 

Launchpad has imported 4 comments from the remote bug at
http://bugs.freedesktop.org/show_bug.cgi?id=20876.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2009-03-26T02:36:38+00:00 Martin Pitt wrote:

There are various situations where polkit_context_init() fails:

 - PolicyKit daemon is not installed. This happens e. g. in a Debian or Ubuntu server installation (we split off the library to minimize dependencies)
 - PolicyKit.conf does not exist or is invalid

Right now, CK aborts with

Sep 28 22:10:01 acheron console-kit-daemon[13695]: CRITICAL: cannot
initialize libpolkit

However, I think that's too strong. Even without PK, CK is still useful
for session tracking. If this happens, CK should behave as if it was
compiled without PK support, not abort completely.

Reply at: https://bugs.launchpad.net/consolekit/+bug/275432/comments/36

------------------------------------------------------------------------
On 2009-03-26T02:39:37+00:00 Martin Pitt wrote:

Created an attachment (id=24268)
patch

This patch implements the suggested behaviour. If PK fails to
initialize, pol_ctx is unref'ed and kept as NULL.
polkit_context_is_caller_authorized() defaults to "NO" if the passed
context is NULL, thus when trying to call CK's .Stop() function over
D-Bus, the caller gets a proper "not authorized" response.

Reply at: https://bugs.launchpad.net/consolekit/+bug/275432/comments/37

------------------------------------------------------------------------
On 2009-07-20T14:32:09+00:00 Ray Strode wrote:

Do you have an updated patch for polkit 1.0?

Reply at: https://bugs.launchpad.net/consolekit/+bug/275432/comments/42

------------------------------------------------------------------------
On 2009-07-23T10:41:06+00:00 Martin Pitt wrote:

This patch isn't necessary any more with the polkit 1.0 update. That
does:

 #ifdef HAVE_POLKIT
-        manager->priv->pol_ctx = polkit_context_new ();
-        polkit_context_set_io_watch_functions (manager->priv->pol_ctx, pk_io_add_watch, pk_io_remove_watch);
-        if (! polkit_context_init (manager->priv->pol_ctx, NULL)) {
-                g_critical ("cannot initialize libpolkit");
-                return FALSE;
-        }
+        manager->priv->pol_ctx = polkit_authority_get ();
 #endif

I. e. it already removed the g_critical()/return FALSE, which is sort of
what my previous patch was doing as well. Since the polkit patch was
committed now (thanks!), I close this bug.

Reply at: https://bugs.launchpad.net/consolekit/+bug/275432/comments/43


** Changed in: consolekit
   Importance: Unknown => Medium

-- 
libpolkit requires files from policykit for polkit_context_init to work
https://bugs.launchpad.net/bugs/275432
You received this bug notification because you are a member of Registry
Administrators, which is the registrant for Debian.