In -l mode, if the user is only allowed to run as a group, display
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 10 May 2009 11:33:45 +0000 (11:33 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 10 May 2009 11:33:45 +0000 (11:33 +0000)
the user's name, not root's before the allowed group.

parse.c

diff --git a/parse.c b/parse.c
index a5d289312ed5184a02b8bee22b1c34bd5790b192..202d4003f268e20faa44a653a0ea7e9962323778 100644 (file)
--- 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)) {