Move list_pw global into struct runas_context.

This commit is contained in:
Todd C. Miller
2023-08-13 09:34:57 -06:00
parent a321e6cedf
commit 217b7b46f3
11 changed files with 24 additions and 27 deletions

View File

@@ -81,7 +81,6 @@ static int testsudoers_query(const struct sudo_nss *nss, struct passwd *pw);
*/
struct sudoers_user_context user_ctx;
struct sudoers_runas_context runas_ctx;
struct passwd *list_pw;
static const char *orig_cmnd;
static char *runas_group, *runas_user;
unsigned int sudo_mode = MODE_RUN;
@@ -166,8 +165,8 @@ main(int argc, char *argv[])
}
break;
case 'L':
list_pw = sudo_getpwnam(optarg);
if (list_pw == NULL) {
runas_ctx.list_pw = sudo_getpwnam(optarg);
if (runas_ctx.list_pw == NULL) {
sudo_warnx(U_("unknown user %s"), optarg);
usage();
}