diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2015-07-18 20:27:38 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2015-07-18 20:27:38 +0000 |
commit | b84c9c171280ec5aca2093a87638bb4b8d0c0800 (patch) | |
tree | 5fbed04b5a454c389f58254c95a45276c4e15598 /usr.sbin/sysmerge | |
parent | f810da55f5d9b6d169a82022bc6f94d5040c7824 (diff) |
Add groups before users.
Diffstat (limited to 'usr.sbin/sysmerge')
-rw-r--r-- | usr.sbin/sysmerge/sysmerge.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh index aa507bdcfd8..0134ff9afd7 100644 --- a/usr.sbin/sysmerge/sysmerge.sh +++ b/usr.sbin/sysmerge/sysmerge.sh @@ -1,6 +1,6 @@ #!/bin/ksh - # -# $OpenBSD: sysmerge.sh,v 1.196 2015/06/02 17:29:28 jung Exp $ +# $OpenBSD: sysmerge.sh,v 1.197 2015/07/18 20:27:37 ajacoutot Exp $ # # Copyright (c) 2008-2014 Antoine Jacoutot <ajacoutot@openbsd.org> # Copyright (c) 1998-2003 Douglas Barton <DougB@FreeBSD.org> @@ -335,11 +335,19 @@ sm_install() { sm_add_user_grp() { local _g _p _gid _l _u _rest _newgrp _newusr - local _pw=./etc/master.passwd local _gr=./etc/group + local _pw=./etc/master.passwd ${PKGMODE} && return + while IFS=: read -r -- _g _p _gid _rest; do + if ! grep -Eq "^${_g}:" /etc/group; then + echo "===> Adding the ${_g} group" + groupadd -g ${_gid} ${_g} && \ + set -A _newgrp -- ${_newgrp[@]} ${_g} + fi + done <${_gr} + while read _l; do _u=${_l%%:*} if [[ ${_u} != root ]]; then @@ -350,14 +358,6 @@ sm_add_user_grp() { fi fi done <${_pw} - - while IFS=: read -r -- _g _p _gid _rest; do - if ! grep -Eq "^${_g}:" /etc/group; then - echo "===> Adding the ${_g} group" - groupadd -g ${_gid} ${_g} && \ - set -A _newgrp -- ${_newgrp[@]} ${_g} - fi - done <${_gr} } sm_merge_loop() { |