2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 05:48:18 +00:00

If a Defaults value contains a blank, double-quote the string.

This commit is contained in:
Todd C. Miller 2007-08-20 23:24:31 +00:00
parent 9cf8213c26
commit c6cf39cdfd

View File

@ -319,8 +319,12 @@ display_defaults(pw)
}
lbuf_append(&lbuf, prefix, NULL);
if (d->val != NULL) {
lbuf_append(&lbuf, d->var, d->op == '+' ? "+=" :
d->op == '-' ? "-=" : "=", d->val, NULL);
lbuf_append(&lbuf, d->var, d->op == '+' ? " += " :
d->op == '-' ? " -= " : " = ", NULL);
if (strpbrk(d->val, " \t") != NULL)
lbuf_append(&lbuf, "\"", d->val, "\"", NULL);
else
lbuf_append(&lbuf, d->val, NULL);
} else
lbuf_append(&lbuf, d->op == FALSE ? "!" : "", d->var, NULL);
prefix = ", ";