mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
When printing a member name, quote sudoers special characters unless
it is a UID/GID, in which case we print the '#' unquoted.
This commit is contained in:
@@ -883,7 +883,14 @@ print_member_int(struct sudo_lbuf *lbuf, char *name, int type, int negated,
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
sudo_lbuf_append(lbuf, "%s%s", negated ? "!" : "", name);
|
||||
/* Do not quote UID/GID, all others get quoted. */
|
||||
if (name[0] == '#' &&
|
||||
name[strspn(name + 1, "0123456789") + 1] == '\0') {
|
||||
sudo_lbuf_append(lbuf, "%s%s", negated ? "!" : "", name);
|
||||
} else {
|
||||
sudo_lbuf_append_quoted(lbuf, SUDOERS_QUOTED, "%s%s",
|
||||
negated ? "!" : "", name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
debug_return;
|
||||
|
Reference in New Issue
Block a user