summaryrefslogtreecommitdiffstats
path: root/usr.sbin/adduser/adduser.sh
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2004-06-06 17:55:55 +0000
committermtm <mtm@FreeBSD.org>2004-06-06 17:55:55 +0000
commit1b8e607cd5c23d1560c6b3a787fa00aef38ff45c (patch)
tree9517378d1c73d90d813ecf5cabc5750f9e0770bf /usr.sbin/adduser/adduser.sh
parentee4a7e8b45816004c4b84ae9116b0feabc7a100d (diff)
downloadFreeBSD-src-1b8e607cd5c23d1560c6b3a787fa00aef38ff45c.zip
FreeBSD-src-1b8e607cd5c23d1560c6b3a787fa00aef38ff45c.tar.gz
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.
Diffstat (limited to 'usr.sbin/adduser/adduser.sh')
-rw-r--r--usr.sbin/adduser/adduser.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh
index c04463d..7e21cb5 100644
--- a/usr.sbin/adduser/adduser.sh
+++ b/usr.sbin/adduser/adduser.sh
@@ -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() {
OpenPOWER on IntegriCloud