summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <zeuthen@gmail.com>2012-09-18 14:47:06 -0400
committerDavid Zeuthen <zeuthen@gmail.com>2012-09-18 14:47:06 -0400
commitfa04223240d46641b0773dbf9f7d72f529046bea (patch)
tree4239404388cea9961115eab8c384592c9ed0f0ed
parentee4626b58a1d3cf34c599c810f5d0b2f47004d76 (diff)
downloadpolkit-fa04223240d46641b0773dbf9f7d72f529046bea.tar.gz
Fall back to authenticating as uid 0 if the list of admin identities is empty
For example, this can happen if the wheel group has no members. This was reported in Red Hat bug 834494, see https://bugzilla.redhat.com/show_bug.cgi?id=834494 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
-rw-r--r--src/polkitbackend/polkitbackendinteractiveauthority.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
index 1d4a555..3bd2f0b 100644
--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
@@ -1293,15 +1293,11 @@ polkit_backend_interactive_authority_get_admin_identities (PolkitBackendInteract
PolkitDetails *details)
{
PolkitBackendInteractiveAuthorityClass *klass;
- GList *ret;
+ GList *ret = NULL;
klass = POLKIT_BACKEND_INTERACTIVE_AUTHORITY_GET_CLASS (authority);
- if (klass->get_admin_identities == NULL)
- {
- ret = g_list_prepend (NULL, polkit_unix_user_new (0));
- }
- else
+ if (klass->get_admin_identities != NULL)
{
ret = klass->get_admin_identities (authority,
caller,
@@ -2257,6 +2253,10 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
}
}
+ /* Fall back to uid 0 if no users are available (rhbz #834494) */
+ if (user_identities == NULL)
+ user_identities = g_list_prepend (NULL, polkit_unix_user_new (0));
+
session = authentication_session_new (agent,
cookie,
subject,