summaryrefslogtreecommitdiffstats
path: root/source/a/shadow/adduser
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/shadow/adduser')
-rw-r--r--source/a/shadow/adduser10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/a/shadow/adduser b/source/a/shadow/adduser
index 49c11f87a..834b34ada 100644
--- a/source/a/shadow/adduser
+++ b/source/a/shadow/adduser
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Copyright 1995 Hrvoje Dogan, Croatia.
-# Copyright 2002-2004, 2008, 2009, 2010 Stuart Winter, Surrey, England, UK.
+# Copyright 2002-2004, 2008, 2009, 2010, 2023 Stuart Winter, Surrey, England, UK.
# Copyright 2004, 2008-2010 Slackware Linux, Inc., Concord, CA, USA
# Copyright 2012 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
@@ -30,12 +30,14 @@
# Author : Stuart Winter <mozes@slackware.com>
# Based on the original Slackware adduser by Hrvoje Dogan
# with modifications by Patrick Volkerding
-# Version: 1.16
+# Version: 1.18
##########################################################################
# Usage..: adduser [<new_user_name>]
##########################################################################
# History #
###########
+# v1.18 - 2023-11-25
+# * chown: use new format for supplying user:group.
# v1.17 - 2019-04-01
# * Re-invoking input requests when human error causes failure. <ttk>
# qv: https://www.linuxquestions.org/questions/slackware-14/adduser-shell-script-error-4175650984/
@@ -329,7 +331,7 @@ while [ ! -z "$needinput" ]; do
if [ "$(echo $getyn | grep -i "n")" ]; then
unset needinput
# You're most likely going to only do this if you have the dir *mounted* for this user's $HOME
- getyn="$(get_input " Do you want to chown $LOGIN.$( echo $GID | awk '{print $2}') $HME ? (y/N) ")"
+ getyn="$(get_input " Do you want to chown ${LOGIN}:$( echo $GID | awk '{print $2}') $HME ? (y/N) ")"
if [ "$(echo $getyn | grep -i "y")" ]; then
CHOWNHOMEDIR=$HME # set this to the home directory
fi
@@ -423,7 +425,7 @@ fi
# chown the home dir? We can only do this once the useradd has
# completed otherwise the user name doesn't exist.
if [ ! -z "${CHOWNHOMEDIR}" ]; then
- chown "$LOGIN"."$( echo $GID | awk '{print $2}')" "${CHOWNHOMEDIR}"
+ chown "${LOGIN}":"$( echo $GID | awk '{print $2}')" "${CHOWNHOMEDIR}"
fi
# Set the finger information