From 2a573734b692ce27e4809e47e514ca0dfffaa970 Mon Sep 17 00:00:00 2001
From: Przemyslaw Pawelczyk <przemoc@zoho.com>
Date: Sat, 23 Apr 2016 13:13:36 +0200
Subject: [PATCH] Reorder options passed to adduser in scripts: make -S first.

It's only for consistency and to ease spotting lack of it.
---
 community/smstools/smstools.pre-install                       | 2 +-
 community/sniproxy/sniproxy.pre-install                       | 2 +-
 main/amavisd-new/amavisd-new.pre-install                      | 2 +-
 main/avahi/avahi.pre-install                                  | 4 ++--
 main/backuppc/backuppc.pre-install                            | 2 +-
 main/bacula-client/bacula-client.pre-install                  | 2 +-
 main/bacula/bacula.pre-install                                | 2 +-
 main/charybdis/charybdis.pre-install                          | 2 +-
 main/ircservices/ircservices.pre-install                      | 2 +-
 main/nginx/nginx-common.pre-install                           | 2 +-
 main/nsd/nsd.pre-install                                      | 2 +-
 main/ntop/ntop.pre-install                                    | 2 +-
 main/openldap/openldap.pre-install                            | 2 +-
 main/opentracker/opentracker.pre-install                      | 2 +-
 main/perdition/perdition.pre-install                          | 2 +-
 main/sircbot/sircbot.pre-install                              | 2 +-
 main/smokeping/smokeping.pre-install                          | 2 +-
 main/snmptt/snmptt.pre-install                                | 2 +-
 main/umurmur/umurmur.post-install                             | 2 +-
 main/uvncrepeater/uvncrepeater.pre-install                    | 2 +-
 main/vsftpd/vsftpd.pre-install                                | 2 +-
 testing/consul/consul.pre-install                             | 2 +-
 .../darwin-streaming-server.post-install                      | 2 +-
 testing/elasticsearch/elasticsearch.pre-install               | 4 ++--
 testing/exim/exim.pre-install                                 | 2 +-
 testing/h2o/h2o.pre-install                                   | 2 +-
 testing/knot/knot.pre-install                                 | 2 +-
 testing/logstash/logstash.pre-install                         | 2 +-
 testing/ntopng/ntopng.pre-install                             | 2 +-
 testing/openxcap/openxcap.pre-install                         | 2 +-
 testing/rmilter/rmilter.pre-install                           | 2 +-
 testing/rspamd/rspamd.pre-install                             | 2 +-
 testing/tor/tor.pre-install                                   | 2 +-
 unmaintained/apache-couchdb/apache-couchdb.post-install       | 2 +-
 unmaintained/shadowircd/shadowircd.pre-install                | 2 +-
 35 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/community/smstools/smstools.pre-install b/community/smstools/smstools.pre-install
index dc250442df5d..638266c7394a 100755
--- a/community/smstools/smstools.pre-install
+++ b/community/smstools/smstools.pre-install
@@ -1,5 +1,5 @@
 #!/bin/sh
 addgroup -S smsd &>/dev/null
-adduser -h /var/spool/sms -s /sbin/nologin -G smsd -S -D smsd &>/dev/null
+adduser -S -h /var/spool/sms -s /sbin/nologin -G smsd -D smsd &>/dev/null
 adduser -G uucp smsd &>/dev/null
 exit 0
diff --git a/community/sniproxy/sniproxy.pre-install b/community/sniproxy/sniproxy.pre-install
index 596dad6fb948..0c6ea464ad4c 100644
--- a/community/sniproxy/sniproxy.pre-install
+++ b/community/sniproxy/sniproxy.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S sniproxy 2>/dev/null
-adduser -h /var/log/sniproxy -s /bin/false -S -D sniproxy 2>/dev/null
+adduser -S -h /var/log/sniproxy -s /bin/false -D sniproxy 2>/dev/null
 exit 0
diff --git a/main/amavisd-new/amavisd-new.pre-install b/main/amavisd-new/amavisd-new.pre-install
index 431d9ab3f495..691ae273818b 100755
--- a/main/amavisd-new/amavisd-new.pre-install
+++ b/main/amavisd-new/amavisd-new.pre-install
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 addgroup amavis 2>/dev/null
-adduser -D -S -G amavis -h /var/amavis -s /sbin/nologin amavis 2>/dev/null
+adduser -S -D -G amavis -h /var/amavis -s /sbin/nologin amavis 2>/dev/null
 exit 0
 
diff --git a/main/avahi/avahi.pre-install b/main/avahi/avahi.pre-install
index 331e4d50e5ae..33802cafbe77 100644
--- a/main/avahi/avahi.pre-install
+++ b/main/avahi/avahi.pre-install
@@ -2,10 +2,10 @@
 
 addgroup -S -g 28 netdev 2>/dev/null
 addgroup -S -g 86 avahi 2>/dev/null
-adduser -u 86 \
+adduser -S -u 86 \
 	-h /var/run/avahi-daemon \
 	-s /sbin/nologin \
-	-S -D -H \
+	-D -H \
 	-g "Avahi System User" \
 	-G avahi \
 	avahi 2>/dev/null
diff --git a/main/backuppc/backuppc.pre-install b/main/backuppc/backuppc.pre-install
index 04a7ce191996..32440ee678dd 100644
--- a/main/backuppc/backuppc.pre-install
+++ b/main/backuppc/backuppc.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S backuppc &>/dev/null
-adduser -h /var/lib/BackupPC -s /bin/sh -S -D -H -G backuppc -g "BackupPC user" backuppc &>/dev/null
+adduser -S -h /var/lib/BackupPC -s /bin/sh -D -H -G backuppc -g "BackupPC user" backuppc &>/dev/null
 exit 0
diff --git a/main/bacula-client/bacula-client.pre-install b/main/bacula-client/bacula-client.pre-install
index 6cbd0e661d49..0eb2cab342c2 100644
--- a/main/bacula-client/bacula-client.pre-install
+++ b/main/bacula-client/bacula-client.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S bacula 2>/dev/null
-adduser -h /var/lib/bacula/ -s /sbin/nologin -G bacula -S -D bacula 2>/dev/null
+adduser -S -h /var/lib/bacula/ -s /sbin/nologin -G bacula -D bacula 2>/dev/null
 exit 0
diff --git a/main/bacula/bacula.pre-install b/main/bacula/bacula.pre-install
index 6cbd0e661d49..0eb2cab342c2 100644
--- a/main/bacula/bacula.pre-install
+++ b/main/bacula/bacula.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S bacula 2>/dev/null
-adduser -h /var/lib/bacula/ -s /sbin/nologin -G bacula -S -D bacula 2>/dev/null
+adduser -S -h /var/lib/bacula/ -s /sbin/nologin -G bacula -D bacula 2>/dev/null
 exit 0
diff --git a/main/charybdis/charybdis.pre-install b/main/charybdis/charybdis.pre-install
index d36c3c610927..3c120d30a641 100644
--- a/main/charybdis/charybdis.pre-install
+++ b/main/charybdis/charybdis.pre-install
@@ -1,3 +1,3 @@
 #!/bin/sh
-adduser -h /var/run/charybdis -s /sbin/nologin -S -D ircd 2>/dev/null
+adduser -S -h /var/run/charybdis -s /sbin/nologin -D ircd 2>/dev/null
 exit 0
diff --git a/main/ircservices/ircservices.pre-install b/main/ircservices/ircservices.pre-install
index e04348296c0e..5016c893330d 100644
--- a/main/ircservices/ircservices.pre-install
+++ b/main/ircservices/ircservices.pre-install
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-adduser -h /var/lib/ircservices -s /sbin/nologin -S -D ircservices 2>/dev/null
+adduser -S -h /var/lib/ircservices -s /sbin/nologin -D ircservices 2>/dev/null
 exit 0
 
diff --git a/main/nginx/nginx-common.pre-install b/main/nginx/nginx-common.pre-install
index 823de3a4b143..27bf2de7cb3c 100644
--- a/main/nginx/nginx-common.pre-install
+++ b/main/nginx/nginx-common.pre-install
@@ -2,7 +2,7 @@
 
 addgroup -Sg 82 www-data 2>/dev/null
 addgroup -S nginx 2>/dev/null
-adduser -h /var/lib/nginx -g "nginx" -s /sbin/nologin -SDHG nginx nginx 2>/dev/null
+adduser -S -h /var/lib/nginx -g "nginx" -s /sbin/nologin -DHG nginx nginx 2>/dev/null
 addgroup nginx www-data 2>/dev/null
 
 exit 0
diff --git a/main/nsd/nsd.pre-install b/main/nsd/nsd.pre-install
index 80edbd154f48..7f92eca5f741 100644
--- a/main/nsd/nsd.pre-install
+++ b/main/nsd/nsd.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S nsd 2>/dev/null
-adduser -G nsd -S -H -h /var/db/nsd -s /sbin/nologin nsd 2>/dev/null
+adduser -S -G nsd -H -h /var/db/nsd -s /sbin/nologin nsd 2>/dev/null
 exit 0
diff --git a/main/ntop/ntop.pre-install b/main/ntop/ntop.pre-install
index 1ace75c61b91..e22ff3e3d8c3 100755
--- a/main/ntop/ntop.pre-install
+++ b/main/ntop/ntop.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S ntop 2>/dev/null
-adduser -h /var/lib/ntop -s /sbin/nologin -S -G ntop -H -D ntop 2>/dev/null
+adduser -S -h /var/lib/ntop -s /sbin/nologin -G ntop -H -D ntop 2>/dev/null
 exit 0
diff --git a/main/openldap/openldap.pre-install b/main/openldap/openldap.pre-install
index f5d586f78948..a01f4fa3037c 100644
--- a/main/openldap/openldap.pre-install
+++ b/main/openldap/openldap.pre-install
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 addgroup -S ldap 2>/dev/null
-adduser -h /usr/lib/openldap -s /sbin/nologin -S -D -H -g "OpenLdap User" \
+adduser -S -h /usr/lib/openldap -s /sbin/nologin -D -H -g "OpenLdap User" \
 	-G ldap ldap 2>/dev/null
 
 exit 0
diff --git a/main/opentracker/opentracker.pre-install b/main/opentracker/opentracker.pre-install
index c6fc95ed1bf8..8d619f67b238 100644
--- a/main/opentracker/opentracker.pre-install
+++ b/main/opentracker/opentracker.pre-install
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-adduser -D -S -H -h /var/empty -s /sbin/false opentracker 2>/dev/null
+adduser -S -D -H -h /var/empty -s /sbin/false opentracker 2>/dev/null
 exit 0
 
diff --git a/main/perdition/perdition.pre-install b/main/perdition/perdition.pre-install
index 61a3eef5afed..5d9148fcb08b 100644
--- a/main/perdition/perdition.pre-install
+++ b/main/perdition/perdition.pre-install
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 addgroup -S perdition 2>/dev/null
-adduser -h /var/run/perdition -s /sbin/nologin -S -G perdition -D perdition 2>/dev/null
+adduser -S -h /var/run/perdition -s /sbin/nologin -G perdition -D perdition 2>/dev/null
 
 exit 0
diff --git a/main/sircbot/sircbot.pre-install b/main/sircbot/sircbot.pre-install
index 36adc6cce3f6..450fff3fc4ee 100644
--- a/main/sircbot/sircbot.pre-install
+++ b/main/sircbot/sircbot.pre-install
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 addgroup sircbot 2>/dev/null
-adduser -h /var/run/sircbot -G sircbot -S -D sircbot 2>/dev/null
+adduser -S -h /var/run/sircbot -G sircbot -D sircbot 2>/dev/null
 exit 0
diff --git a/main/smokeping/smokeping.pre-install b/main/smokeping/smokeping.pre-install
index 236550f7c195..490c4c1879f4 100644
--- a/main/smokeping/smokeping.pre-install
+++ b/main/smokeping/smokeping.pre-install
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 addgroup smokeping 2>/dev/null
-adduser -h /var/lib/smokeping -S -D -G smokeping smokeping 2>/dev/null
+adduser -S -h /var/lib/smokeping -D -G smokeping smokeping 2>/dev/null
 exit 0
diff --git a/main/snmptt/snmptt.pre-install b/main/snmptt/snmptt.pre-install
index 873986f5cbfd..6619337ad10f 100644
--- a/main/snmptt/snmptt.pre-install
+++ b/main/snmptt/snmptt.pre-install
@@ -1,3 +1,3 @@
 #!/bin/sh
-adduser -h /var/spool/snmptt -s /sbin/nologin -S -D snmptt &>/dev/null
+adduser -S -h /var/spool/snmptt -s /sbin/nologin -D snmptt &>/dev/null
 exit 0
diff --git a/main/umurmur/umurmur.post-install b/main/umurmur/umurmur.post-install
index 4373bd7e7abf..9d5f40834f0c 100755
--- a/main/umurmur/umurmur.post-install
+++ b/main/umurmur/umurmur.post-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S umurmur &>/dev/null
-adduser -s /bin/false -G umurmur -h /var/run/umurmurd -S -D umurmur &>/dev/null
+adduser -S -s /bin/false -G umurmur -h /var/run/umurmurd -D umurmur &>/dev/null
 exit 0
diff --git a/main/uvncrepeater/uvncrepeater.pre-install b/main/uvncrepeater/uvncrepeater.pre-install
index 2e1e6730a791..a1126c617970 100644
--- a/main/uvncrepeater/uvncrepeater.pre-install
+++ b/main/uvncrepeater/uvncrepeater.pre-install
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-adduser -D -S uvncrep 2>/dev/null
+adduser -S -D uvncrep 2>/dev/null
 exit 0
 
diff --git a/main/vsftpd/vsftpd.pre-install b/main/vsftpd/vsftpd.pre-install
index e60f9d82a24b..4bdf064b94b9 100755
--- a/main/vsftpd/vsftpd.pre-install
+++ b/main/vsftpd/vsftpd.pre-install
@@ -1,5 +1,5 @@
 #!/bin/sh
 addgroup ftp &>/dev/null
 addgroup vsftp ftp &>/dev/null
-adduser -h /var/lib/ftp -s /sbin/nologin -G ftp -S vsftp &>/dev/null
+adduser -S -h /var/lib/ftp -s /sbin/nologin -G ftp vsftp &>/dev/null
 exit 0
diff --git a/testing/consul/consul.pre-install b/testing/consul/consul.pre-install
index aef42305577d..6e11c5bc04e8 100644
--- a/testing/consul/consul.pre-install
+++ b/testing/consul/consul.pre-install
@@ -2,6 +2,6 @@
 
 # Create consul group and user
 addgroup -S consul 2> /dev/null
-adduser -h /var/consul -s /sbin/nologin -G consul -S -D consul 2> /dev/null
+adduser -S -h /var/consul -s /sbin/nologin -G consul -D consul 2> /dev/null
 exit 0
 
diff --git a/testing/darwin-streaming-server/darwin-streaming-server.post-install b/testing/darwin-streaming-server/darwin-streaming-server.post-install
index bfd9a90c75c9..607ec156b1fa 100644
--- a/testing/darwin-streaming-server/darwin-streaming-server.post-install
+++ b/testing/darwin-streaming-server/darwin-streaming-server.post-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S qtss &>/dev/null
-adduser -s /bin/false -G qtss -h /var/darwinstreaming -S -D qtss &>/dev/null
+adduser -S -s /bin/false -G qtss -h /var/darwinstreaming -D qtss &>/dev/null
 exit 0
diff --git a/testing/elasticsearch/elasticsearch.pre-install b/testing/elasticsearch/elasticsearch.pre-install
index 042588e5b7eb..9e96765bda40 100644
--- a/testing/elasticsearch/elasticsearch.pre-install
+++ b/testing/elasticsearch/elasticsearch.pre-install
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 addgroup elastico
-adduser -h /var/lib/elasticsearch -s /sbin/nologin -G elastico \
-	-g "added by apk for elasticsearch" -SDH elastico
+adduser -S -h /var/lib/elasticsearch -s /sbin/nologin -G elastico \
+	-g "added by apk for elasticsearch" -DH elastico
 
 exit 0
diff --git a/testing/exim/exim.pre-install b/testing/exim/exim.pre-install
index de7372199044..816ed9650f40 100644
--- a/testing/exim/exim.pre-install
+++ b/testing/exim/exim.pre-install
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 addgroup -S exim 2>/dev/null
-adduser -h /var/spool/exim -g "exim" -s /sbin/nologin -SDHG exim exim 2>/dev/null
+adduser -S -h /var/spool/exim -g "exim" -s /sbin/nologin -DHG exim exim 2>/dev/null
 adduser exim mail 2>/dev/null
 
 exit 0
diff --git a/testing/h2o/h2o.pre-install b/testing/h2o/h2o.pre-install
index 12a76a026bd7..358f4a20b9ab 100644
--- a/testing/h2o/h2o.pre-install
+++ b/testing/h2o/h2o.pre-install
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-adduser -s /sbin/nologin -h /var/www -D -S -H h2o 2>/dev/null 
+adduser -S -s /sbin/nologin -h /var/www -D -H h2o 2>/dev/null 
 addgroup -S -g 82 www-data 2>/dev/null
 addgroup h2o www-data 2>/dev/null
 
diff --git a/testing/knot/knot.pre-install b/testing/knot/knot.pre-install
index 57bc7044f750..82be3a69ac2b 100644
--- a/testing/knot/knot.pre-install
+++ b/testing/knot/knot.pre-install
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 addgroup -S knot 2>/dev/null
-adduser -s /sbin/nologin -G knot -S -D -H knot 2>/dev/null
+adduser -S -s /sbin/nologin -G knot -D -H knot 2>/dev/null
 
 exit 0
diff --git a/testing/logstash/logstash.pre-install b/testing/logstash/logstash.pre-install
index 056badb59dc2..6844757497d6 100644
--- a/testing/logstash/logstash.pre-install
+++ b/testing/logstash/logstash.pre-install
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-adduser -h /usr/share/logstash -s /sbin/nologin -S -D -H -g "Logstash User" \
+adduser -S -h /usr/share/logstash -s /sbin/nologin -D -H -g "Logstash User" \
 	-G daemon logstash 2>/dev/null
 
 exit 0
diff --git a/testing/ntopng/ntopng.pre-install b/testing/ntopng/ntopng.pre-install
index 1ace75c61b91..e22ff3e3d8c3 100755
--- a/testing/ntopng/ntopng.pre-install
+++ b/testing/ntopng/ntopng.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S ntop 2>/dev/null
-adduser -h /var/lib/ntop -s /sbin/nologin -S -G ntop -H -D ntop 2>/dev/null
+adduser -S -h /var/lib/ntop -s /sbin/nologin -G ntop -H -D ntop 2>/dev/null
 exit 0
diff --git a/testing/openxcap/openxcap.pre-install b/testing/openxcap/openxcap.pre-install
index cc2b529e93d7..c67a449d3a5b 100755
--- a/testing/openxcap/openxcap.pre-install
+++ b/testing/openxcap/openxcap.pre-install
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 addgroup openxcap 2>/dev/null
-adduser -G openxcap -h /var/run/openxcap -s /bin/false -S -D -H openxcap 2>/dev/null
+adduser -S -G openxcap -h /var/run/openxcap -s /bin/false -D -H openxcap 2>/dev/null
 exit 0
diff --git a/testing/rmilter/rmilter.pre-install b/testing/rmilter/rmilter.pre-install
index b7dc736d9962..bda1a9468396 100644
--- a/testing/rmilter/rmilter.pre-install
+++ b/testing/rmilter/rmilter.pre-install
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 addgroup -S rmilter 2>dev/null
-adduser -h /run/rmilter -g "rmilter" -s /bin/false -SDHG rmilter rmilter 2>/dev/null
+adduser -S -h /run/rmilter -g "rmilter" -s /bin/false -DHG rmilter rmilter 2>/dev/null
 
 exit 0
diff --git a/testing/rspamd/rspamd.pre-install b/testing/rspamd/rspamd.pre-install
index 7f00b36c6a9a..b107f1c2eccf 100644
--- a/testing/rspamd/rspamd.pre-install
+++ b/testing/rspamd/rspamd.pre-install
@@ -1,6 +1,6 @@
 #!/bin/sh
 
 addgroup -S rspamd 2>/dev/null
-adduser -h /var/lib/rspamd -g "rspamd" -s /bin/false -SDHG rspamd rspamd 2>/dev/null
+adduser -S -h /var/lib/rspamd -g "rspamd" -s /bin/false -DHG rspamd rspamd 2>/dev/null
 
 exit 0
diff --git a/testing/tor/tor.pre-install b/testing/tor/tor.pre-install
index e036984586d0..9db7ac85116f 100644
--- a/testing/tor/tor.pre-install
+++ b/testing/tor/tor.pre-install
@@ -1,4 +1,4 @@
 #!/bin/sh
-adduser -h /var/run/tor -s /sbin/nologin -S -D tor 2>/dev/null
+adduser -S -h /var/run/tor -s /sbin/nologin -D tor 2>/dev/null
 exit 0
 
diff --git a/unmaintained/apache-couchdb/apache-couchdb.post-install b/unmaintained/apache-couchdb/apache-couchdb.post-install
index 5cc944e70b02..4d3b8417598c 100755
--- a/unmaintained/apache-couchdb/apache-couchdb.post-install
+++ b/unmaintained/apache-couchdb/apache-couchdb.post-install
@@ -1,4 +1,4 @@
 #!/bin/sh
 addgroup -S couchdb &>/dev/null
-adduser -h /var/run/couchdb -s /bin/false -G couchdb -S -D couchdb &>/dev/null
+adduser -S -h /var/run/couchdb -s /bin/false -G couchdb -D couchdb &>/dev/null
 exit 0
diff --git a/unmaintained/shadowircd/shadowircd.pre-install b/unmaintained/shadowircd/shadowircd.pre-install
index e40f84021d2c..f8d24e4d3708 100644
--- a/unmaintained/shadowircd/shadowircd.pre-install
+++ b/unmaintained/shadowircd/shadowircd.pre-install
@@ -1,3 +1,3 @@
 #!/bin/sh
-adduser -h /var/run/shadowircd -s /bin/false -S -D ircd 2>/dev/null
+adduser -S -h /var/run/shadowircd -s /bin/false -D ircd 2>/dev/null
 exit 0
-- 
GitLab