[Pkg-privacy-commits] [onioncat] 260/340: Create, and run as, the onioncat dedicated user.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:04:45 UTC 2015


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

infinity0 pushed a commit to branch debian
in repository onioncat.

commit 28ccb6c05d85d93de59305b08042f95d1eceb494
Author: intrigeri <intrigeri at boum.org>
Date:   Thu Aug 18 01:51:47 2011 +0200

    Create, and run as, the onioncat dedicated user.
    
    It makes no sense to piggy-back debian-tor as it used to be the case.
---
 debian/onioncat.default  |  2 +-
 debian/onioncat.init     |  2 +-
 debian/onioncat.postinst | 21 +++++++++++++++++++++
 debian/onioncat.postrm   | 17 +++++++++++++++++
 4 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/debian/onioncat.default b/debian/onioncat.default
index a92bff1..d645712 100644
--- a/debian/onioncat.default
+++ b/debian/onioncat.default
@@ -8,7 +8,7 @@
 #ENABLED=0
 
 # User the daemon run as
-DAEMON_USER="debian-tor"
+DAEMON_USER="onioncat"
 
 # Options passed to onioncat on startup.
 # At least the hidden service hostname must generally be provided.
diff --git a/debian/onioncat.init b/debian/onioncat.init
index 1e81036..64ab9ed 100644
--- a/debian/onioncat.init
+++ b/debian/onioncat.init
@@ -31,7 +31,7 @@ test -x $DAEMON || exit 0
 DAEMON_OPTS=""
 DIETIME=10
 STARTTIME=1
-DAEMON_USER="debian-tor"
+DAEMON_USER="onioncat"
 ENABLED=0
 
 if [ -f /etc/default/$NAMEL ] ; then
diff --git a/debian/onioncat.postinst b/debian/onioncat.postinst
new file mode 100755
index 0000000..3a041e1
--- /dev/null
+++ b/debian/onioncat.postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+case $1 in
+   configure)
+      if ! getent passwd onioncat >/dev/null ; then
+         echo "adding onioncat user..."
+         adduser \
+            --quiet --system --group \
+            --home  '/var/lib/onioncat' \
+	    --shell '/bin/sh' \
+	    --gecos 'OnionCat user,,,' \
+	    onioncat
+	fi
+esac
+
+#DEBHELPER#
+
+exit 0
+
diff --git a/debian/onioncat.postrm b/debian/onioncat.postrm
new file mode 100755
index 0000000..5dd1a01
--- /dev/null
+++ b/debian/onioncat.postrm
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+case $1 in
+   purge)
+      if command -v deluser >/dev/null 2>&1 ; then
+         deluser --quiet --system onioncat > /dev/null || true
+      else
+	 echo >&2 "not removing onioncat system account because deluser command was not found"
+      fi
+      ;;
+esac
+
+#DEBHELPER#
+
+exit 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git



More information about the Pkg-privacy-commits mailing list