diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-12-09 16:43:53 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-12-09 16:43:53 +0000 |
commit | 0c1c66930bc8d68b849d5bf91da29d30d51dc289 (patch) | |
tree | 8b4f8f524ac833d0afca1e4796b331e7320e9508 | |
parent | f07baecf09e3be6b1ef01a02fd31f95db702ad86 (diff) | |
download | userv-utils-0c1c66930bc8d68b849d5bf91da29d30d51dc289.tar.gz |
Improve adduser calls:
- no longer guard with calls to id, as adduser --quiet is idempotent
- pass --shell /bin/false and --no-create-home
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | debian/userv-dyndns.postinst | 7 | ||||
-rwxr-xr-x | debian/userv-git-daemon.postinst | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/debian/changelog b/debian/changelog index bcd63e7..93ae89f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ userv-utils (0.6.0~~iwj3) unstable; urgency=low * Add debhelper token to postinst scripts. * Change default user for git-daemon to userv-git and default user for dyndns to userv-dyndns. + * Improve adduser calls: + - no longer guard with calls to id, as adduser --quiet is idempotent + - pass --shell /bin/false and --no-create-home -- diff --git a/debian/userv-dyndns.postinst b/debian/userv-dyndns.postinst index da9acd7..a6779f9 100755 --- a/debian/userv-dyndns.postinst +++ b/debian/userv-dyndns.postinst @@ -23,7 +23,8 @@ set -e #DEBHELPER# user="$(sed -n '/^[a-z]/{p;q;}' /etc/userv/dyndns-service-users)" -if id $user >/dev/null 2>&1; then exit 0; fi -adduser --system --group --gecos 'userv dyndns' \ - --home /etc/userv +if [ "$user" ]; then + adduser --system --quiet --group --gecos 'userv dyndns' \ + --home /etc/userv --no-create-home --shell /bin/false $user +fi diff --git a/debian/userv-git-daemon.postinst b/debian/userv-git-daemon.postinst index 5ed3b4e..5ccaa88 100755 --- a/debian/userv-git-daemon.postinst +++ b/debian/userv-git-daemon.postinst @@ -30,8 +30,6 @@ if test -f $defaults; then . $defaults; fi #DEBHELPER# if [ "$GITDUSER" ]; then - if id $GITDUSER >/dev/null 2>&1; then exit 0; fi - - adduser --system --group --gecos 'userv git daemon' \ - --home /etc/userv $GITDUSER + adduser --system --quiet --group --gecos 'userv git daemon' \ + --home /etc/userv --no-create-home --shell /bin/false $GITDUSER fi |