PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Wed Feb 23 09:36:56 PST 2011


 docs/man/pkcheck.xml   |    7 +++++++
 src/programs/pkcheck.c |    5 +++++
 2 files changed, 12 insertions(+)

New commits:
commit c8e165017b1c9d82de820a80d1c11b192a032a86
Author: David Zeuthen <davidz at redhat.com>
Date:   Wed Feb 23 12:36:22 2011 -0500

    Make pkcheck(1) report if the authentication dialog was dismissed
    
    Signed-off-by: David Zeuthen <davidz at redhat.com>

diff --git a/docs/man/pkcheck.xml b/docs/man/pkcheck.xml
index 4b3ed03..f52b4a2 100644
--- a/docs/man/pkcheck.xml
+++ b/docs/man/pkcheck.xml
@@ -125,6 +125,13 @@ KEY3=VALUE3
       Details are printed on standard output.
     </para>
     <para>
+      If the specificied process is not authorized because the
+      authentication dialog / request was dismissed by the user,
+      <command>pkcheck</command> exits with a return value of 3 and a
+      diagnostic message is printed on standard error.  Details are
+      printed on standard output.
+    </para>
+    <para>
       If an error occured while checking for authorization, <command>pkcheck</command> exits
       with a return value of 127 with a diagnostic message printed on standard error.
     </para>
diff --git a/src/programs/pkcheck.c b/src/programs/pkcheck.c
index f6af3be..74d312f 100644
--- a/src/programs/pkcheck.c
+++ b/src/programs/pkcheck.c
@@ -325,6 +325,11 @@ main (int argc, char *argv[])
         }
       ret = 2;
     }
+  else if (polkit_authorization_result_get_dismissed (result))
+    {
+      g_printerr ("Authentication request was dismissed.\n");
+      ret = 3;
+    }
   else
     {
       g_printerr ("Not authorized.\n");


More information about the hal-commit mailing list