Move check_user_shell() to pwutil.c as user_shell_valid()
This will make it possible to support a different backend which may be used by testsudoers in the future.
This commit is contained in:
@@ -1198,3 +1198,17 @@ done:
|
||||
__func__, pw->pw_name, matched ? "" : "NOT ", group);
|
||||
debug_return_bool(matched);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if the user's shell is considered to be valid.
|
||||
*/
|
||||
bool
|
||||
user_shell_valid(const struct passwd *pw)
|
||||
{
|
||||
debug_decl(user_shell_valid, SUDOERS_DEBUG_NSS);
|
||||
|
||||
if (!def_runas_check_shell)
|
||||
debug_return_bool(true);
|
||||
|
||||
debug_return_bool(valid_shell(pw->pw_shell));
|
||||
}
|
||||
|
Reference in New Issue
Block a user