mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
If a Defaults value contains a blank, double-quote the string.
This commit is contained in:
6
parse.c
6
parse.c
@@ -320,7 +320,11 @@ display_defaults(pw)
|
|||||||
lbuf_append(&lbuf, prefix, NULL);
|
lbuf_append(&lbuf, prefix, NULL);
|
||||||
if (d->val != NULL) {
|
if (d->val != NULL) {
|
||||||
lbuf_append(&lbuf, d->var, d->op == '+' ? " += " :
|
lbuf_append(&lbuf, d->var, d->op == '+' ? " += " :
|
||||||
d->op == '-' ? "-=" : "=", d->val, NULL);
|
d->op == '-' ? " -= " : " = ", NULL);
|
||||||
|
if (strpbrk(d->val, " \t") != NULL)
|
||||||
|
lbuf_append(&lbuf, "\"", d->val, "\"", NULL);
|
||||||
|
else
|
||||||
|
lbuf_append(&lbuf, d->val, NULL);
|
||||||
} else
|
} else
|
||||||
lbuf_append(&lbuf, d->op == FALSE ? "!" : "", d->var, NULL);
|
lbuf_append(&lbuf, d->op == FALSE ? "!" : "", d->var, NULL);
|
||||||
prefix = ", ";
|
prefix = ", ";
|
||||||
|
Reference in New Issue
Block a user