diff options
| author | David Zeuthen <zeuthen@gmail.com> | 2012-06-08 13:43:35 -0400 |
|---|---|---|
| committer | David Zeuthen <zeuthen@gmail.com> | 2012-06-08 13:43:35 -0400 |
| commit | f66346217c233f9689c3ad73312597821da94a82 (patch) | |
| tree | 3a9a9d7caeebf976065d66f0ec16e82780d1e07b | |
| parent | 78bdbecf97396e6ca0e0f297676a1d99f4fc06fc (diff) | |
Catch up with latest polkit guidance
See
http://cgit.freedesktop.org/polkit/commit/?id=acf3a06e55f9ca8a7f7bfa012c24e8794d27c85f
https://bugzilla.gnome.org/show_bug.cgi?id=677718
for details.
Signed-off-by: David Zeuthen <zeuthen@gmail.com>
| -rw-r--r-- | src/udisksdaemonutil.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/udisksdaemonutil.c b/src/udisksdaemonutil.c index 9a2e601..723cffe 100644 --- a/src/udisksdaemonutil.c +++ b/src/udisksdaemonutil.c @@ -652,14 +652,25 @@ udisks_daemon_util_check_authorization_sync (UDisksDaemon *daemon, &error); if (result == NULL) { - g_dbus_method_invocation_return_error (invocation, - UDISKS_ERROR, - UDISKS_ERROR_FAILED, - "Error checking authorization: %s (%s, %d)", - error->message, - g_quark_to_string (error->domain), - error->code); - g_error_free (error); + if (error->domain != POLKIT_ERROR) + { + /* assume polkit authority is not available (e.g. could be the service + * manager returning org.freedesktop.systemd1.Masked) + */ + g_error_free (error); + ret = check_authorization_no_polkit (daemon, object, action_id, options, message, invocation); + } + else + { + g_dbus_method_invocation_return_error (invocation, + UDISKS_ERROR, + UDISKS_ERROR_FAILED, + "Error checking authorization: %s (%s, %d)", + error->message, + g_quark_to_string (error->domain), + error->code); + g_error_free (error); + } goto out; } if (!polkit_authorization_result_get_is_authorized (result)) |
