From: Todd C. Miller Date: Fri, 19 Mar 2010 12:17:58 +0000 (-0400) Subject: Better prefix determination now that we can't rely on len==0 to X-Git-Tag: SUDO_1_8_0~783 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c9db4ef6f167c5a7e92f4710ce0012b9150057b;p=sudo Better prefix determination now that we can't rely on len==0 to tell the beginning on an entry. --- diff --git a/plugins/sudoers/parse.c b/plugins/sudoers/parse.c index 3dfe7b846..f7ea49e4c 100644 --- a/plugins/sudoers/parse.c +++ b/plugins/sudoers/parse.c @@ -445,13 +445,17 @@ sudo_file_display_defaults(nss, pw, lbuf) struct lbuf *lbuf; { struct defaults *d; - char *prefix = NULL; + char *prefix; int nfound = 0; if (nss->handle == NULL) return(-1); - prefix = " "; + if (lbuf->len == 0 || isspace((unsigned char)lbuf->buf[lbuf->len - 1])) + prefix = " "; + else + prefix = ", "; + tq_foreach_fwd(&defaults, d) { switch (d->type) { case DEFAULTS_HOST: