mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-29 21:38:05 +00:00
If a Defaults value contains a blank, double-quote the string.
This commit is contained in:
parent
9cf8213c26
commit
c6cf39cdfd
8
parse.c
8
parse.c
@ -319,8 +319,12 @@ 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 = ", ";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user