summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2011-02-23 12:36:22 -0500
committerDavid Zeuthen <davidz@redhat.com>2011-02-23 12:36:22 -0500
commitc8e165017b1c9d82de820a80d1c11b192a032a86 (patch)
treec4b24df553122ec3a33d742aad011e260c30fe98
parent4746ff303b0803e928e5c88c961b8befc13fa57f (diff)
Make pkcheck(1) report if the authentication dialog was dismissed
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--docs/man/pkcheck.xml7
-rw-r--r--src/programs/pkcheck.c5
2 files changed, 12 insertions, 0 deletions
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");