From 2a609b467cbcfe6e335328052d15baeb22d23bc9 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 10 May 2009 11:33:45 +0000 Subject: [PATCH] In -l mode, if the user is only allowed to run as a group, display the user's name, not root's before the allowed group. --- parse.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index a5d289312..202d4003f 100644 --- a/parse.c +++ b/parse.c @@ -328,8 +328,10 @@ sudo_file_display_priv_short(pw, us, lbuf) print_member(lbuf, m->name, m->type, m->negated, RUNASALIAS); } - } else { + } else if (tq_empty(&cs->runasgrouplist)) { lbuf_append(lbuf, def_runas_default, NULL); + } else { + lbuf_append(lbuf, pw->pw_name, NULL); } if (!tq_empty(&cs->runasgrouplist)) { lbuf_append(lbuf, " : ", NULL); @@ -377,8 +379,10 @@ sudo_file_display_priv_long(pw, us, lbuf) print_member(lbuf, m->name, m->type, m->negated, RUNASALIAS); } - } else { + } else if (tq_empty(&cs->runasgrouplist)) { lbuf_append(lbuf, def_runas_default, NULL); + } else { + lbuf_append(lbuf, pw->pw_name, NULL); } lbuf_print(lbuf); if (!tq_empty(&cs->runasgrouplist)) {