Merge pull request #210 from t8m/shell-check

Make the check for non-executable shell only a warning.
This commit is contained in:
Serge Hallyn 2020-01-20 07:04:51 -08:00 committed by GitHub
commit dfceca8427
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1328,15 +1328,22 @@ static void process_flags (int argc, char **argv)
if ( ( !VALID (optarg) )
|| ( ('\0' != optarg[0])
&& ('/' != optarg[0])
&& ('*' != optarg[0]) )
|| (stat(optarg, &st) != 0)
|| (S_ISDIR(st.st_mode))
|| (access(optarg, X_OK) != 0)) {
&& ('*' != optarg[0]) )) {
fprintf (stderr,
_("%s: invalid shell '%s'\n"),
Prog, optarg);
exit (E_BAD_ARG);
}
if ( '\0' != optarg[0]
&& '*' != optarg[0]
&& strcmp(optarg, "/sbin/nologin") != 0
&& ( stat(optarg, &st) != 0
|| S_ISDIR(st.st_mode)
|| access(optarg, X_OK) != 0)) {
fprintf (stderr,
_("%s: Warning: missing or non-executable shell '%s'\n"),
Prog, optarg);
}
user_shell = optarg;
def_shell = optarg;
sflg = true;