From 986d7c293c6b35899a1e7bc6437f18775220dc47 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 22 Feb 2011 16:49:44 -0500 Subject: Bug 30653 – No way to detect cancellation in pkexec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://bugs.freedesktop.org/show_bug.cgi?id=30653 Signed-off-by: David Zeuthen --- src/programs/pkexec.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/programs') diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c index fbd700d..40042e4 100644 --- a/src/programs/pkexec.c +++ b/src/programs/pkexec.c @@ -714,10 +714,19 @@ main (int argc, char *argv[]) } else { - log_message (LOG_WARNING, TRUE, - "Error executing command as another user: Not authorized"); - g_printerr ("\n" - "This incident has been reported.\n"); + if (polkit_authorization_result_get_dismissed (result)) + { + log_message (LOG_WARNING, TRUE, + "Error executing command as another user: Request dismissed"); + ret = 126; + } + else + { + log_message (LOG_WARNING, TRUE, + "Error executing command as another user: Not authorized"); + g_printerr ("\n" + "This incident has been reported.\n"); + } goto out; } -- cgit v1.2.3