Add a sudoers_context struct that embeds the user and runas structs.

This commit is contained in:
Todd C. Miller
2023-08-20 16:27:08 -06:00
parent 1b9fb405a3
commit 2d2529a15e
36 changed files with 920 additions and 912 deletions

View File

@@ -62,12 +62,12 @@ adt_sudo_common(char *const argv[])
}
/* get the real executable name */
if (user_ctx.cmnd != NULL) {
if (strlcpy(cmdpath, (const char *)user_ctx.cmnd,
if (ctx.user.cmnd != NULL) {
if (strlcpy(cmdpath, (const char *)ctx.user.cmnd,
sizeof(cmdpath)) >= sizeof(cmdpath)) {
log_warningx(SLOG_NO_STDERR,
_("truncated audit path user_ctx.cmnd: %s"),
user_ctx.cmnd);
_("truncated audit path ctx.user.cmnd: %s"),
ctx.user.cmnd);
}
} else {
if (strlcpy(cmdpath, argv[0],