| Summary: | Do not fail if PolicyKit cannot be initialized | ||
|---|---|---|---|
| Product: | ConsoleKit | Reporter: | Martin Pitt <martin.pitt> |
| Component: | Daemon | Assignee: | william.jon.mccann |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | medium | CC: | halfline, jw+debian |
| Version: | unspecified | ||
| Hardware: | Other | ||
| OS: | All | ||
| URL: | https://launchpad.net/bugs/275432 | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
| Attachments: | patch | ||
|
Description
Martin Pitt
2009-03-26 02:36:38 UTC
Created attachment 24268 [details] [review] 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. Do you have an updated patch for polkit 1.0? 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.
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.