ref: refs/heads/network
commit 7c7e884a11825896abcb89fa697602c639df490e
Author: Klaus Kämpf
Date: Sat Sep 26 17:00:29 2009 +0200
Add details to exceptions if policy cannot be obtained
---
ruby-polkit/src/polkit.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ruby-polkit/src/polkit.c b/ruby-polkit/src/polkit.c
index ed7a53a..e8fc5ef 100644
--- a/ruby-polkit/src/polkit.c
+++ b/ruby-polkit/src/polkit.c
@@ -119,8 +119,12 @@ method_polkit_check(VALUE self, VALUE act_v, VALUE usr_v)
polkit_result = polkit_context_is_caller_authorized(context, action, caller, FALSE, &polkit_error);
if (polkit_error_is_set(polkit_error)) {
+ uid_t uid;
+ polkit_caller_get_uid( caller, &uid );
+ struct passwd *passwd = getpwuid(uid);
+
/* polkit_error will be freed before we raise so we must copy the msg */
- exc = new_runtime_error(polkit_error_get_error_message(polkit_error));
+ exc = new_runtime_error("User %s (uid %d) is not authorized: %s", passwd?passwd->pw_name:"<unknown>", (int)uid, polkit_error_get_error_message(polkit_error));
goto finish;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org