Avoid returning an error if no authentication agent is available
authorDavid Zeuthen <davidz@redhat.com>
Fri, 29 May 2009 15:09:51 +0000 (11:09 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Fri, 29 May 2009 15:09:51 +0000 (11:09 -0400)
Instead, just return the PolkitAuthorizationResult that already has
authorized==FALSE and challenge==TRUE.

src/polkitbackend/polkitbackendlocalauthority.c

index 4c98aa6..28021d6 100644 (file)
@@ -651,17 +651,7 @@ polkit_backend_local_authority_check_authorization (PolkitBackendAuthority
       AuthenticationAgent *agent;
 
       agent = get_authentication_agent_for_subject (local_authority, subject);
-      if (agent == NULL)
-        {
-          g_simple_async_result_set_error (simple,
-                                           POLKIT_ERROR,
-                                           POLKIT_ERROR_FAILED,
-                                           "Challenge requested, but no suitable authentication agent is available");
-          g_simple_async_result_complete (simple);
-          g_object_unref (simple);
-          goto out;
-        }
-      else
+      if (agent != NULL)
         {
           g_object_unref (result);
           result = NULL;