* src/chsh.c: Even for root, warn if an invalid shell is
specified.
This commit is contained in:
parent
5204a15f95
commit
5e38d92a95
@ -1,3 +1,8 @@
|
|||||||
|
2010-03-18 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/chsh.c: Even for root, warn if an invalid shell is
|
||||||
|
specified.
|
||||||
|
|
||||||
2010-03-18 Nicolas François <nicolas.francois@centraliens.net>
|
2010-03-18 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* man/limits.5.xml: Document the selection of the limits when
|
* man/limits.5.xml: Document the selection of the limits when
|
||||||
|
@ -535,10 +535,17 @@ int main (int argc, char **argv)
|
|||||||
if ( !amroot
|
if ( !amroot
|
||||||
&& ( is_restricted_shell (loginsh)
|
&& ( is_restricted_shell (loginsh)
|
||||||
|| (access (loginsh, X_OK) != 0))) {
|
|| (access (loginsh, X_OK) != 0))) {
|
||||||
fprintf (stderr, _("%s: %s is an invalid shell.\n"), Prog, loginsh);
|
fprintf (stderr, _("%s: %s is an invalid shell\n"), Prog, loginsh);
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Even for root, warn if an invalid shell is specified. */
|
||||||
|
if (access (loginsh, F_OK) != 0) {
|
||||||
|
fprintf (stderr, _("%s: Warning: %s does not exist\n"), Prog, loginsh);
|
||||||
|
} else if (access (loginsh, X_OK) != 0) {
|
||||||
|
fprintf (stderr, _("%s: Warning: %s is not executable\n"), Prog, loginsh);
|
||||||
|
}
|
||||||
|
|
||||||
update_shell (user, loginsh);
|
update_shell (user, loginsh);
|
||||||
|
|
||||||
SYSLOG ((LOG_INFO, "changed user '%s' shell to '%s'", user, loginsh));
|
SYSLOG ((LOG_INFO, "changed user '%s' shell to '%s'", user, loginsh));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user