From 4f405b77ce9cf27bca7384ad539f0ec93dbb085c Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Fri, 20 Oct 2023 13:26:54 -0400 Subject: [PATCH] Remove pw check in authorize_wizard_mode Now that CHECK_PLNAME is a sysconf option, it can be possible to authorize wizard mode even if get_unix_pw() fails to return the user's login name, so I think the call to check_user_string() should go out either way in case that's what's happening. --- sys/libnh/libnhmain.c | 4 +--- sys/unix/unixmain.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/libnh/libnhmain.c b/sys/libnh/libnhmain.c index 40be3b467..41669033b 100644 --- a/sys/libnh/libnhmain.c +++ b/sys/libnh/libnhmain.c @@ -597,9 +597,7 @@ port_help(void) boolean authorize_wizard_mode(void) { - struct passwd *pw = get_unix_pw(); - - if (pw && sysopt.wizards && sysopt.wizards[0]) { + if (sysopt.wizards && sysopt.wizards[0]) { if (check_user_string(sysopt.wizards)) return TRUE; } diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 2b041d0e8..56f567a46 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -956,9 +956,7 @@ port_help(void) boolean authorize_wizard_mode(void) { - struct passwd *pw = get_unix_pw(); - - if (pw && sysopt.wizards && sysopt.wizards[0]) { + if (sysopt.wizards && sysopt.wizards[0]) { if (check_user_string(sysopt.wizards)) return TRUE; }