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>
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,
}
}
+ /* 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,