Mail archive
alpine-aports

[alpine-aports] [PATCH 10/15] main/[various]: Add group and use it as primary in .pre-* scripts.

From: Przemyslaw Pawelczyk <przemoc_at_zoho.com>
Date: Mon, 6 Jun 2016 02:05:10 +0200

Fixes the problem I unintentionally brought in commit ccc056dbf9d3:
system user creation doesn't add same named group and uses nogroup as
primary group unless explicitly specified via -G.

Brings status quo regarding primary groups of users created in packages:
- main/apache2
- main/aports-build
- main/atheme-iris
- main/clamav
- main/clamsmtp
- main/coova-chilli
- main/dhcp
- main/djbdns
- main/ez-ipupdate
- main/fetchmail
- main/freeswitch
- main/gitolite
- main/gnats
- main/gross
- main/icecast
- main/memcached
- main/ngircd
- main/openntpd
- main/snort
- main/squid
- main/transmission
- main/znc
---
 main/apache2/apache2.pre-install                  | 3 ++-
 main/aports-build/aports-build.pre-install        | 3 ++-
 main/atheme-iris/atheme-iris.pre-install          | 3 ++-
 main/clamav/clamav-db.pre-install                 | 3 ++-
 main/clamsmtp/clamsmtp.pre-install                | 3 ++-
 main/clamsmtp/clamsmtp.pre-upgrade                | 3 ++-
 main/coova-chilli/coova-chilli.pre-install        | 3 ++-
 main/dhcp/dhcp.pre-install                        | 3 ++-
 main/djbdns/dnscache.pre-install                  | 3 ++-
 main/djbdns/tinydns.pre-install                   | 3 ++-
 main/ez-ipupdate/ez-ipupdate.pre-install          | 3 ++-
 main/fetchmail/fetchmail.pre-install              | 3 ++-
 main/freeswitch/freeswitch.pre-install            | 3 ++-
 main/gitolite/gitolite.pre-install                | 3 ++-
 main/gnats/gnats.pre-install                      | 3 ++-
 main/gross/gross.pre-install                      | 3 ++-
 main/icecast/icecast.pre-install                  | 3 ++-
 main/memcached/memcached.pre-install              | 3 ++-
 main/ngircd/ngircd.pre-install                    | 3 ++-
 main/openntpd/openntpd.pre-install                | 3 ++-
 main/snort/snort.pre-install                      | 3 ++-
 main/squid/squid.pre-install                      | 3 ++-
 main/squid/squid.pre-upgrade                      | 3 ++-
 main/transmission/transmission-daemon.pre-install | 3 ++-
 main/znc/znc.pre-install                          | 3 ++-
 25 files changed, 50 insertions(+), 25 deletions(-)
diff --git a/main/apache2/apache2.pre-install b/main/apache2/apache2.pre-install
index 703681e..d4ede74 100644
--- a/main/apache2/apache2.pre-install
+++ b/main/apache2/apache2.pre-install
_at_@ -1,7 +1,8 @@
 #!/bin/sh
 
 addgroup -S -g 82 www-data 2>/dev/null
-adduser -S -D -H -h /var/www -s /sbin/nologin -g apache apache 2>/dev/null
+addgroup -S apache 2>/dev/null
+adduser -S -D -H -h /var/www -s /sbin/nologin -G apache -g apache apache 2>/dev/null
 addgroup apache www-data 2>/dev/null
 
 exit 0
diff --git a/main/aports-build/aports-build.pre-install b/main/aports-build/aports-build.pre-install
index 4fcbdd4..72c62b4 100644
--- a/main/aports-build/aports-build.pre-install
+++ b/main/aports-build/aports-build.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -s /bin/sh -g buildozer buildozer 2>/dev/null
+addgroup -S buildozer 2>/dev/null
+adduser -S -D -s /bin/sh -G buildozer -g buildozer buildozer 2>/dev/null
 
 exit 0
diff --git a/main/atheme-iris/atheme-iris.pre-install b/main/atheme-iris/atheme-iris.pre-install
index ce2d521..aa18cf5 100644
--- a/main/atheme-iris/atheme-iris.pre-install
+++ b/main/atheme-iris/atheme-iris.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -h /usr/share/webapps/atheme-iris -s /sbin/nologin -g iris iris 2>/dev/null
+addgroup -S iris 2>/dev/null
+adduser -S -D -H -h /usr/share/webapps/atheme-iris -s /sbin/nologin -G iris -g iris iris 2>/dev/null
 
 exit 0
diff --git a/main/clamav/clamav-db.pre-install b/main/clamav/clamav-db.pre-install
index d1e52fb..fdb83a0 100644
--- a/main/clamav/clamav-db.pre-install
+++ b/main/clamav/clamav-db.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -s /sbin/nologin -g clamav clamav 2>/dev/null
+addgroup -S clamav 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G clamav -g clamav clamav 2>/dev/null
 
 exit 0
diff --git a/main/clamsmtp/clamsmtp.pre-install b/main/clamsmtp/clamsmtp.pre-install
index d1e52fb..fdb83a0 100644
--- a/main/clamsmtp/clamsmtp.pre-install
+++ b/main/clamsmtp/clamsmtp.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -s /sbin/nologin -g clamav clamav 2>/dev/null
+addgroup -S clamav 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G clamav -g clamav clamav 2>/dev/null
 
 exit 0
diff --git a/main/clamsmtp/clamsmtp.pre-upgrade b/main/clamsmtp/clamsmtp.pre-upgrade
index 959576d..c397bfc 100644
--- a/main/clamsmtp/clamsmtp.pre-upgrade
+++ b/main/clamsmtp/clamsmtp.pre-upgrade
_at_@ -10,6 +10,7 @@ if [ -f "$old" ] && [ ! -f "$new" ]; then
 	echo " *"
 fi
 
-adduser -S -D -H -s /bin/false -g clamav clamav 2>/dev/null
+addgroup -S clamav 2>/dev/null
+adduser -S -D -H -s /bin/false -G clamav -g clamav clamav 2>/dev/null
 
 exit 0
diff --git a/main/coova-chilli/coova-chilli.pre-install b/main/coova-chilli/coova-chilli.pre-install
index bf6ea4c..342778d 100644
--- a/main/coova-chilli/coova-chilli.pre-install
+++ b/main/coova-chilli/coova-chilli.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -s /sbin/nologin -g chilli chilli 2>/dev/null
+addgroup -S chilli 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G chilli -g chilli chilli 2>/dev/null
 
 exit 0
diff --git a/main/dhcp/dhcp.pre-install b/main/dhcp/dhcp.pre-install
index 2e0b839..6aa3de0 100644
--- a/main/dhcp/dhcp.pre-install
+++ b/main/dhcp/dhcp.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -h /var/lib/dhcp -s /sbin/nologin -g dhcp dhcp 2>/dev/null
+addgroup -S dhcp 2>/dev/null
+adduser -S -D -h /var/lib/dhcp -s /sbin/nologin -G dhcp -g dhcp dhcp 2>/dev/null
 
 exit 0
diff --git a/main/djbdns/dnscache.pre-install b/main/djbdns/dnscache.pre-install
index 664732c..f59549a 100644
--- a/main/djbdns/dnscache.pre-install
+++ b/main/djbdns/dnscache.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -h /etc/dnscache -g dnscache -s /sbin/nologin dnscache 2>/dev/null
+addgroup -S dnscache 2>/dev/null
+adduser -S -D -H -h /etc/dnscache -G dnscache -g dnscache -s /sbin/nologin dnscache 2>/dev/null
 
 exit 0
diff --git a/main/djbdns/tinydns.pre-install b/main/djbdns/tinydns.pre-install
index 85ba7e7..da47789 100644
--- a/main/djbdns/tinydns.pre-install
+++ b/main/djbdns/tinydns.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -h /etc/tinydns -s /sbin/nologin -g tinydns tinydns 2>/dev/null
+addgroup -S tinydns 2>/dev/null
+adduser -S -D -H -h /etc/tinydns -s /sbin/nologin -G tinydns -g tinydns tinydns 2>/dev/null
 
 exit 0
diff --git a/main/ez-ipupdate/ez-ipupdate.pre-install b/main/ez-ipupdate/ez-ipupdate.pre-install
index 11b4c57..8d33acc 100644
--- a/main/ez-ipupdate/ez-ipupdate.pre-install
+++ b/main/ez-ipupdate/ez-ipupdate.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -h /var/lib/ez-ipupdate -s /sbin/nologin -g ipupdate ipupdate 2>/dev/null
+addgroup -S ipupdate 2>/dev/null
+adduser -S -D -h /var/lib/ez-ipupdate -s /sbin/nologin -G ipupdate -g ipupdate ipupdate 2>/dev/null
 
 exit 0
diff --git a/main/fetchmail/fetchmail.pre-install b/main/fetchmail/fetchmail.pre-install
index ed3d409..ef46a10 100644
--- a/main/fetchmail/fetchmail.pre-install
+++ b/main/fetchmail/fetchmail.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -h /var/lib/fetchmail -s /sbin/nologin -g fetchmail fetchmail 2>/dev/null
+addgroup -S fetchmail 2>/dev/null
+adduser -S -D -H -h /var/lib/fetchmail -s /sbin/nologin -G fetchmail -g fetchmail fetchmail 2>/dev/null
 
 exit 0
diff --git a/main/freeswitch/freeswitch.pre-install b/main/freeswitch/freeswitch.pre-install
index 6f31b67..a7790e9 100755
--- a/main/freeswitch/freeswitch.pre-install
+++ b/main/freeswitch/freeswitch.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -h /var/run/freeswitch -s /sbin/nologin -g freeswitch freeswitch 2>/dev/null
+addgroup -S freeswitch 2>/dev/null
+adduser -S -D -H -h /var/run/freeswitch -s /sbin/nologin -G freeswitch -g freeswitch freeswitch 2>/dev/null
 
 exit 0
diff --git a/main/gitolite/gitolite.pre-install b/main/gitolite/gitolite.pre-install
index 506ef1d..eadbf73 100644
--- a/main/gitolite/gitolite.pre-install
+++ b/main/gitolite/gitolite.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -h /var/lib/git -s /bin/sh -g git git 2>/dev/null
+addgroup -S git 2>/dev/null
+adduser -S -D -H -h /var/lib/git -s /bin/sh -G git -g git git 2>/dev/null
 
 exit 0
diff --git a/main/gnats/gnats.pre-install b/main/gnats/gnats.pre-install
index e3a4de0..7e46b87 100644
--- a/main/gnats/gnats.pre-install
+++ b/main/gnats/gnats.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -h /var/lib/gnatsdb -g gnats gnats 2>/dev/null
+addgroup -S gnats 2>/dev/null
+adduser -S -D -h /var/lib/gnatsdb -G gnats -g gnats gnats 2>/dev/null
 
 exit 0
diff --git a/main/gross/gross.pre-install b/main/gross/gross.pre-install
index 078372d..2a3db3c 100644
--- a/main/gross/gross.pre-install
+++ b/main/gross/gross.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -s /sbin/nologin -g gross gross 2>/dev/null
+addgroup -S gross 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G gross -g gross gross 2>/dev/null
 
 exit 0
diff --git a/main/icecast/icecast.pre-install b/main/icecast/icecast.pre-install
index 3ee9c4a..1951890 100644
--- a/main/icecast/icecast.pre-install
+++ b/main/icecast/icecast.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -h /var/log/icecast -s /sbin/nologin -g icecast icecast 2>/dev/null
+addgroup -S icecast 2>/dev/null
+adduser -S -D -h /var/log/icecast -s /sbin/nologin -G icecast -g icecast icecast 2>/dev/null
 
 exit 0
diff --git a/main/memcached/memcached.pre-install b/main/memcached/memcached.pre-install
index 8ff0274..87b6ba9 100644
--- a/main/memcached/memcached.pre-install
+++ b/main/memcached/memcached.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -s /sbin/nologin -g memcached memcached 2>/dev/null
+addgroup -S memcached 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G memcached -g memcached memcached 2>/dev/null
 
 exit 0
diff --git a/main/ngircd/ngircd.pre-install b/main/ngircd/ngircd.pre-install
index c073447..49dd9d5 100644
--- a/main/ngircd/ngircd.pre-install
+++ b/main/ngircd/ngircd.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -h /etc/ngircd -s /sbin/nologin -g ngircd ngircd 2>/dev/null
+addgroup ngircd 2>/dev/null
+adduser -S -D -H -h /etc/ngircd -s /sbin/nologin -G ngircd -g ngircd ngircd 2>/dev/null
 
 exit 0
diff --git a/main/openntpd/openntpd.pre-install b/main/openntpd/openntpd.pre-install
index 6b8204b..975bf54 100644
--- a/main/openntpd/openntpd.pre-install
+++ b/main/openntpd/openntpd.pre-install
_at_@ -2,6 +2,7 @@
 
 # this user should be included in alpine-baselayout-1.2.
 # included here for backward compability.
-adduser -S -D -H -h /var/empty -s /sbin/nologin -g ntp ntp 2>/dev/null
+addgroup -S ntp 2>/dev/null
+adduser -S -D -H -h /var/empty -s /sbin/nologin -G ntp -g ntp ntp 2>/dev/null
 
 exit 0
diff --git a/main/snort/snort.pre-install b/main/snort/snort.pre-install
index e40838d..3b762d5 100644
--- a/main/snort/snort.pre-install
+++ b/main/snort/snort.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -h /var/log/snort -s /sbin/nologin -g snort snort 2>/dev/null
+addgroup -S snort 2>/dev/null
+adduser -S -D -h /var/log/snort -s /sbin/nologin -G snort -g snort snort 2>/dev/null
 
 exit 0
diff --git a/main/squid/squid.pre-install b/main/squid/squid.pre-install
index f613759..3c49c86 100644
--- a/main/squid/squid.pre-install
+++ b/main/squid/squid.pre-install
_at_@ -1,6 +1,7 @@
 #!/bin/sh
 
-adduser -S -D -h /var/cache/squid -g squid squid 2>/dev/null
+addgroup -S squid 2>/dev/null
+adduser -S -D -h /var/cache/squid -G squid -g squid squid 2>/dev/null
 addgroup -S winbind 2>/dev/null
 addgroup squid winbind 2>/dev/null
 
diff --git a/main/squid/squid.pre-upgrade b/main/squid/squid.pre-upgrade
index f613759..3c49c86 100644
--- a/main/squid/squid.pre-upgrade
+++ b/main/squid/squid.pre-upgrade
_at_@ -1,6 +1,7 @@
 #!/bin/sh
 
-adduser -S -D -h /var/cache/squid -g squid squid 2>/dev/null
+addgroup -S squid 2>/dev/null
+adduser -S -D -h /var/cache/squid -G squid -g squid squid 2>/dev/null
 addgroup -S winbind 2>/dev/null
 addgroup squid winbind 2>/dev/null
 
diff --git a/main/transmission/transmission-daemon.pre-install b/main/transmission/transmission-daemon.pre-install
index ad8a575..2e26d48 100644
--- a/main/transmission/transmission-daemon.pre-install
+++ b/main/transmission/transmission-daemon.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -h /var/lib/transmission -s /sbin/nologin -g transmission transmission 2>/dev/null
+addgroup -S transmission 2>/dev/null
+adduser -S -D -h /var/lib/transmission -s /sbin/nologin -G transmission -g transmission transmission 2>/dev/null
 
 exit 0
diff --git a/main/znc/znc.pre-install b/main/znc/znc.pre-install
index bc81d8a..c47e5e1 100644
--- a/main/znc/znc.pre-install
+++ b/main/znc/znc.pre-install
_at_@ -1,5 +1,6 @@
 #!/bin/sh
 
-adduser -S -D -H -s /sbin/nologin -g znc znc 2>/dev/null
+addgroup -S znc 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G znc -g znc znc 2>/dev/null
 
 exit 0
-- 
2.6.6
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Jun 06 2016 - 02:05:10 GMT