Accept full path names in addition to base names for shells.
Make explicit in the documentation that valid shells need to be supplied only if the -S option is not given.
This commit is contained in:
parent
037ac99f39
commit
e7291a6b12
@ -98,11 +98,13 @@ The
|
||||
.Ql \&:
|
||||
character is not allowed.
|
||||
.It shell
|
||||
Only valid shells from the shell database
|
||||
Unless the
|
||||
.Fl S
|
||||
argument is supplied only valid shells from the shell database
|
||||
.Pq Pa /etc/shells
|
||||
are allowed.
|
||||
In
|
||||
addition, only the base name of the shell is necessary, not the full path.
|
||||
In addition,
|
||||
either the base name or the full path of the shell may be supplied.
|
||||
.It UID
|
||||
Automatically generated or your choice.
|
||||
It must be less than 32000.
|
||||
@ -245,10 +247,10 @@ standard output.
|
||||
Default shell for new users.
|
||||
The
|
||||
.Ar shell
|
||||
argument must be the base name of the shell,
|
||||
.Em not
|
||||
the full path.
|
||||
It must exist in
|
||||
argument may be the base name of the shell or the full path.
|
||||
Unless the
|
||||
.Fl S
|
||||
argument is supplied the shell must exist in
|
||||
.Pa /etc/shells
|
||||
or be the special shell
|
||||
.Em nologin
|
||||
@ -372,7 +374,8 @@ is understood to mean that no home directory is to be
|
||||
created for the user.
|
||||
.It Ar shell
|
||||
Login shell.
|
||||
This field should contain the full path to a valid login shell.
|
||||
This field should contain either the base name or
|
||||
the full path to a valid login shell.
|
||||
.It Ar password
|
||||
User password.
|
||||
This field should contain a plaintext string, which will
|
||||
|
@ -118,7 +118,8 @@ valid_shells() {
|
||||
}
|
||||
|
||||
# fullpath_from_shell shell
|
||||
# Given $shell, the basename component of a valid shell, get the
|
||||
# Given $shell, which is either the full path to a shell or
|
||||
# the basename component of a valid shell, get the
|
||||
# full path to the shell from the /etc/shells file.
|
||||
#
|
||||
fullpath_from_shell() {
|
||||
@ -131,7 +132,8 @@ fullpath_from_shell() {
|
||||
\#*|'')
|
||||
;;
|
||||
*)
|
||||
if [ "`basename $_path`" = "$_shell" ]; then
|
||||
if [ "$_path" = "$_shell" -o \
|
||||
"`basename $_path`" = "$_shell" ]; then
|
||||
echo $_path
|
||||
return 0
|
||||
fi
|
||||
@ -372,7 +374,7 @@ get_gecos() {
|
||||
|
||||
# get_shell
|
||||
# Get the account's shell. Works in interactive and batch mode. It
|
||||
# accepts only the base name of the shell, NOT the full path.
|
||||
# accepts either the base name of the shell or the full path.
|
||||
# If an invalid shell is entered it will simply use the default shell.
|
||||
#
|
||||
get_shell() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user