summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-04-17 12:55:02 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-04-17 12:55:51 +0000
commit0a2f9eb5822ad3cb85f55c4f7c1c5de36544f137 (patch)
tree86413e2b940d0d910bb67ce1b49565e97a022783
parent1e3c5a742bf5142296174282ef1811b71acad683 (diff)
downloadabuild-0a2f9eb5822ad3cb85f55c4f7c1c5de36544f137.tar.gz
abuild-0a2f9eb5822ad3cb85f55c4f7c1c5de36544f137.tar.bz2
abuild-0a2f9eb5822ad3cb85f55c4f7c1c5de36544f137.tar.xz
abuild-0a2f9eb5822ad3cb85f55c4f7c1c5de36544f137.zip
abuild: fix user creation when group exists
-rwxr-xr-xabuild.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/abuild.in b/abuild.in
index 20beae5..99d9cd0 100755
--- a/abuild.in
+++ b/abuild.in
@@ -385,8 +385,12 @@ mkusers() {
local i
for i in $pkgusers; do
if ! getent passwd $i >/dev/null; then
+ local gopt=
msg "Creating user $i"
- $SUDO adduser -D -H $i || return 1
+ if getent group $i >/dev/null; then
+ gopt="-G $i"
+ fi
+ $SUDO adduser -D -H $gopt $i || return 1
fi
done
for i in $pkggroups; do