pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/pkginstall Create users with -M. On Linux this give...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ecc1e0fefe7b
branches:  trunk
changeset: 553888:ecc1e0fefe7b
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Feb 02 19:54:22 2009 +0000

description:
Create users with -M. On Linux this gives the same behavior as NetBSD's
useradd without -M, e.g. allows creation of users without home
directory. Tested on RHEL4. From Jens Rehsack.

diffstat:

 mk/pkginstall/usergroupfuncs.Linux |  12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diffs (34 lines):

diff -r c8c923bb4e28 -r ecc1e0fefe7b mk/pkginstall/usergroupfuncs.Linux
--- a/mk/pkginstall/usergroupfuncs.Linux        Mon Feb 02 19:23:27 2009 +0000
+++ b/mk/pkginstall/usergroupfuncs.Linux        Mon Feb 02 19:54:22 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: usergroupfuncs.Linux,v 1.3 2007/07/12 19:41:46 jlam Exp $
+# $NetBSD: usergroupfuncs.Linux,v 1.4 2009/02/02 19:54:22 joerg Exp $
 #
 # Platform-specific adduser and addgroup functionality
 # on top of shadow-utils.  (Not libuser)
@@ -104,22 +104,16 @@
 
        if ${TEST} -n "${USERADD}" -a -x "${USERADD}"; then
                ${ECHO} "${PKGNAME}: Creating user \`\`$user''"
-               # if home directory is missing, make and remove it
-               # ensures that the base directory exists, for shadow-utils
-               if ! ${TEST} -d "$home"; then
-                       ${MKDIR} -p "$home"
-                       ${RMDIR} "$home" 2>/dev/null
-               fi
                case $userid in
                "")
                        ${USERADD}                                      \
                                -c "$descr" -d "$home" -s "$shell"      \
-                               -g $group $user
+                               -g $group $user -M
                        ;;
                *)
                        ${USERADD}                                      \
                                -c "$descr" -d "$home" -s "$shell"      \
-                               -g $group -u $userid $user
+                               -g $group -u $userid $user -M
                        ;;
                esac
        fi



Home | Main Index | Thread Index | Old Index