mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
When checking whether a user may change the login class, just check
pw_uid of the runas user, which was passed in to set_loginclass().
This commit is contained in:
@@ -763,8 +763,7 @@ set_loginclass(struct passwd *pw)
|
||||
debug_return;
|
||||
|
||||
if (login_class && strcmp(login_class, "-") != 0) {
|
||||
if (user_uid != 0 &&
|
||||
strcmp(runas_user ? runas_user : def_runas_default, "root") != 0)
|
||||
if (user_uid != 0 && pw->pw_uid != 0)
|
||||
fatalx(U_("only root can use `-c %s'"), login_class);
|
||||
} else {
|
||||
login_class = pw->pw_class;
|
||||
|
Reference in New Issue
Block a user