2
0
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:
Todd C. Miller
2013-12-07 09:17:54 -07:00
parent acdff2d998
commit 8bdf3d9a27
2 changed files with 2 additions and 2 deletions

View File

@@ -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;