This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch quake
in repository game-data-packager.

commit b99602323520b55a44c7982096e6409dce41f344
Author: Simon McVittie <s...@debian.org>
Date:   Sun Oct 25 14:15:32 2015 +0000

    quake3-server: lock the Debian-quake3 account on purge
    
    Also unlock it on reinstallation. Previously we deleted it on purge.
    This matches what we do for quake-server and quake2-server, and
    hardens the system against the possibility that files owned by
    Debian-quake3 might become owned by a different user that is given
    the same numeric uid.
---
 debian/changelog              | 6 ++++++
 debian/quake3-server.postinst | 6 ++++++
 debian/quake3-server.postrm   | 7 ++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 0bf57ab..83db1b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,12 @@
 quake (15) UNRELEASED; urgency=medium
 
   * quake3-server: correct help text
+  * quake3-server: lock the Debian-quake3 account on purge, and unlock
+    it on reinstallation, instead of deleting it on purge.
+    This matches what we do for quake-server and quake2-server,
+    and hardens the system against the possibility that files owned
+    by Debian-quake3 might become owned by an unrelated user that
+    is given the same numeric uid.
 
  -- Simon McVittie <s...@debian.org>  Sun, 25 Oct 2015 01:51:37 +0100
 
diff --git a/debian/quake3-server.postinst b/debian/quake3-server.postinst
index 1d278d9..26a93a3 100644
--- a/debian/quake3-server.postinst
+++ b/debian/quake3-server.postinst
@@ -10,6 +10,12 @@ case "$1" in
         --gecos "Quake III Arena dedicated server" \
        --ingroup games --force-badname Debian-quake3
     fi
+    # Unlock account, if it was locked by our postrm
+    if [ -f /etc/shadow ]; then
+      usermod -U -e '' Debian-quake3
+    else
+      usermod -U Debian-quake3
+    fi
     install -d /var/games
     install -d /var/games/quake3-server
     chown Debian-quake3:games /var/games/quake3-server
diff --git a/debian/quake3-server.postrm b/debian/quake3-server.postrm
index e78c872..eaccc05 100644
--- a/debian/quake3-server.postrm
+++ b/debian/quake3-server.postrm
@@ -5,7 +5,12 @@ set -e
 #DEBHELPER#
 
 if [ "$1" = "purge" ] ; then
+    # Lock account on purge
+    if [ -f /etc/shadow ]; then
+        usermod -L -e 1 Debian-quake3
+    else
+        usermod -L Debian-quake3
+    fi
     rm -r /var/games/quake3-server
     rmdir --ignore-fail-on-non-empty /var/games
-    deluser --quiet --system Debian-quake3 > /dev/null || true
 fi

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/game-data-packager.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to