mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-28 12:57:50 +00:00
Print a newline between Runas and Command-specific defaults in
sudo -l.
This commit is contained in:
parent
d0b2086a62
commit
8ca8f24001
8
lbuf.c
8
lbuf.c
@ -245,10 +245,14 @@ lbuf_print(lbuf)
|
|||||||
cp = lbuf->buf;
|
cp = lbuf->buf;
|
||||||
have = cols;
|
have = cols;
|
||||||
while (cp != NULL && *cp != '\0') {
|
while (cp != NULL && *cp != '\0') {
|
||||||
char *ep = NULL;
|
char *ep;
|
||||||
int need = lbuf->len - (int)(cp - lbuf->buf);
|
int need = lbuf->len - (int)(cp - lbuf->buf);
|
||||||
|
|
||||||
if (need > have) {
|
ep = memrchr(cp, '\n', need > have ? have : need);
|
||||||
|
if (ep) {
|
||||||
|
need = ep - cp;
|
||||||
|
ep++; /* skip over newline */
|
||||||
|
} else if (need > have) {
|
||||||
have -= contlen; /* subtract for continuation char */
|
have -= contlen; /* subtract for continuation char */
|
||||||
if ((ep = memrchr(cp, ' ', have)) == NULL)
|
if ((ep = memrchr(cp, ' ', have)) == NULL)
|
||||||
ep = memchr(cp + have, ' ', need - have);
|
ep = memchr(cp + have, ' ', need - have);
|
||||||
|
2
parse.c
2
parse.c
@ -560,6 +560,8 @@ display_bound_defaults(dtype, lbuf)
|
|||||||
nfound++;
|
nfound++;
|
||||||
if (binding != tq_first(&d->binding)) {
|
if (binding != tq_first(&d->binding)) {
|
||||||
binding = tq_first(&d->binding);
|
binding = tq_first(&d->binding);
|
||||||
|
if (nfound != 1)
|
||||||
|
lbuf_append(lbuf, "\n", NULL);
|
||||||
lbuf_append(lbuf, " Defaults", dsep, NULL);
|
lbuf_append(lbuf, " Defaults", dsep, NULL);
|
||||||
for (m = binding; m != NULL; m = m->next) {
|
for (m = binding; m != NULL; m = m->next) {
|
||||||
if (m != binding)
|
if (m != binding)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user