From 587deddf80b2ad72d1ff21a2d5858c720303106c Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Thu, 24 May 2012 15:50:59 -0400 Subject: Clarify pkexec(1) variables Signed-off-by: David Zeuthen --- .../org.freedesktop.policykit.examples.pkexec.policy.in | 13 ++++++------- src/programs/pkexec.c | 6 ++++-- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/examples/org.freedesktop.policykit.examples.pkexec.policy.in b/src/examples/org.freedesktop.policykit.examples.pkexec.policy.in index 9c05b77..049c024 100644 --- a/src/examples/org.freedesktop.policykit.examples.pkexec.policy.in +++ b/src/examples/org.freedesktop.policykit.examples.pkexec.policy.in @@ -1,15 +1,14 @@ - + - Examples for the PolicyKit Project - http://hal.freedesktop.org/docs/PolicyKit/ + Examples for the polkit project + http://www.freedesktop.org/wiki/Software/polkit/ - <_description>Run the PolicyKit example program Frobnicate - <_message>Authentication is required to run the PolicyKit example program Frobnicate (user=$(user), program=$(program), command_line=$(command_line)) + <_description>Run the polkit example program Frobnicate + <_message>Authentication is required to run the polkit example program Frobnicate (user=$(user), user.gecos=$(user.gecos), user.display=$(user.display), program=$(program), command_line=$(command_line)) audio-x-generic no diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c index db13cf9..d87825c 100644 --- a/src/programs/pkexec.c +++ b/src/programs/pkexec.c @@ -669,11 +669,13 @@ main (int argc, char *argv[]) details = polkit_details_new (); polkit_details_insert (details, "user", pw->pw_name); + if (pw->pw_gecos != NULL) + polkit_details_insert (details, "user.gecos", pw->pw_gecos); if (pw->pw_gecos != NULL && strlen (pw->pw_gecos) > 0) s = g_strdup_printf ("%s (%s)", pw->pw_gecos, pw->pw_name); else s = g_strdup_printf ("%s", pw->pw_name); - polkit_details_insert (details, "user_full", s); + polkit_details_insert (details, "user.display", s); g_free (s); polkit_details_insert (details, "program", path); polkit_details_insert (details, "command_line", command_line); @@ -696,7 +698,7 @@ main (int argc, char *argv[]) * be expanded to the path of the program e.g. "/bin/bash" and the latter * to the user e.g. "John Doe (johndoe)" or "johndoe". */ - N_("Authentication is needed to run `$(program)' as user $(user)")); + N_("Authentication is needed to run `$(program)' as user $(user.display)")); } } polkit_details_insert (details, "polkit.gettext_domain", GETTEXT_PACKAGE); -- cgit v1.2.3