basic/user-util: introduce shell_is_placeholder() helper

This commit is contained in:
Mike Yuan
2024-11-19 00:38:18 +01:00
parent cc74edd861
commit 579ce77ead
2 changed files with 13 additions and 7 deletions
+2 -3
View File
@@ -322,10 +322,9 @@ int get_user_creds(
if (ret_shell)
*ret_shell = (FLAGS_SET(flags, USER_CREDS_CLEAN) &&
(isempty(p->pw_shell) ||
(shell_is_placeholder(p->pw_shell) ||
!path_is_valid(p->pw_shell) ||
!path_is_absolute(p->pw_shell) ||
is_nologin_shell(p->pw_shell))) ? NULL : p->pw_shell;
!path_is_absolute(p->pw_shell))) ? NULL : p->pw_shell;
if (patch_username)
*username = p->pw_name;