summaryrefslogtreecommitdiff
path: root/mk/pkginstall
diff options
context:
space:
mode:
authorjoerg <joerg>2009-02-02 19:54:22 +0000
committerjoerg <joerg>2009-02-02 19:54:22 +0000
commit4893d97c4097b8ff394591f0f60f81532c17503f (patch)
tree093e127fb56465794bdfd9e54cbff37932b8254b /mk/pkginstall
parent663dbbd0f1c18f1d6b759dce21829b1f6a91b107 (diff)
downloadpkgsrc-4893d97c4097b8ff394591f0f60f81532c17503f.tar.gz
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 (limited to 'mk/pkginstall')
-rw-r--r--mk/pkginstall/usergroupfuncs.Linux12
1 files changed, 3 insertions, 9 deletions
diff --git a/mk/pkginstall/usergroupfuncs.Linux b/mk/pkginstall/usergroupfuncs.Linux
index 29e8d31261f..de15ff8135a 100644
--- a/mk/pkginstall/usergroupfuncs.Linux
+++ b/mk/pkginstall/usergroupfuncs.Linux
@@ -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 @@ adduser()
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