diff options
author | joerg <joerg@pkgsrc.org> | 2009-02-02 19:54:22 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-02-02 19:54:22 +0000 |
commit | 6daf419fa5c4e42c7a6c683042efa2e1e2ee314a (patch) | |
tree | 093e127fb56465794bdfd9e54cbff37932b8254b /mk/pkginstall | |
parent | 4e05f511641677195af6ef6156f6d7a928c38026 (diff) | |
download | pkgsrc-6daf419fa5c4e42c7a6c683042efa2e1e2ee314a.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.Linux | 12 |
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 |