[med-svn] [conquest-dicom-server] 03/17: Decided on OpenBSD convention for user name
Pablo Lorenzzoni
spectra at moszumanska.debian.org
Mon Feb 3 16:47:51 UTC 2014
This is an automated email from the git hooks/post-receive script.
spectra pushed a commit to branch master
in repository conquest-dicom-server.
commit f30cacafb23b8be62faf5a81ee557f024e74e3e3
Author: Pablo Lorenzzoni <spectra at debian.org>
Date: Thu Jan 30 15:07:48 2014 +0000
Decided on OpenBSD convention for user name
---
debian/README._conquest | 21 +++++++++++++++++++++
debian/TODO | 2 +-
debian/conquest-dicom-server.dirs | 4 ++--
debian/conquest-dicom-server.init | 4 ++--
debian/conquest-dicom-server.postinst | 4 ++--
debian/conquest-dicom-server.postrm | 11 +++++++++--
6 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/debian/README._conquest b/debian/README._conquest
new file mode 100644
index 0000000..fe92e0d
--- /dev/null
+++ b/debian/README._conquest
@@ -0,0 +1,21 @@
+_conquest user and group accounts
+---------------------------------
+
+Debian Policy is silent wrt how system accounts are created and named by
+packages, except when talking about base-passwd accounts (UID < 100).
+Considering discussion in bugs 228692, 291177 and 621833, following the
+threads http://lists.debian.org/debian-devel/2003/11/msg02231.html and
+http://lists.debian.org/debian-devel/2008/11/msg00343.html and as is written
+in the wiki (https://wiki.debian.org/AccountHandlingInMaintainerScripts),
+there are some de facto best practices that this package try to follow:
+
+(*) The account name follows common convention of using an underscore as a
+prefix to package name (except that our package name is too lenghty, so I
+shortened it to _conquest);
+
+(*) The account is created in postinst script and everything that should be
+owned by the account is chowned so;
+
+(*) The account is removed in postrm if purging the package, but the logfiles
+and images eventually dropped in the /var/lib subdirectory are preserved and
+chowned root:root
diff --git a/debian/TODO b/debian/TODO
index e67bca2..cb4a8b7 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -3,9 +3,9 @@
[ ] Add support for PostgreSQL
[ ] Add Manpage (asciidoc?)
[ ] Replace get-orig-source
-[ ] Run as non-root user
[ ] Bind to 127.0.0.1 by default (probably have to patch source code)
[ ] Change the expected path for dicom.ini by default (probably have to
patch source code)
[**] Convert Repository layout to git-buildpackage
+[**] Run as non-root user
diff --git a/debian/conquest-dicom-server.dirs b/debian/conquest-dicom-server.dirs
index a941d05..363898d 100644
--- a/debian/conquest-dicom-server.dirs
+++ b/debian/conquest-dicom-server.dirs
@@ -1,4 +1,4 @@
-/var/lib/conquest-dicom-server/dbase/
-/var/lib/conquest-dicom-server/MAG0/
+/var/lib/conquest-dicom-server/dbase
+/var/lib/conquest-dicom-server/MAG0
/var/log/conquest-dicom-server/
/etc/conquest-dicom-server/
diff --git a/debian/conquest-dicom-server.init b/debian/conquest-dicom-server.init
index 009a699..f240244 100755
--- a/debian/conquest-dicom-server.init
+++ b/debian/conquest-dicom-server.init
@@ -16,8 +16,8 @@ PACKAGE=conquest-dicom-server
PATH=/sbin:/usr/sbin:/bin:/usr/bin
ETCDIR=/etc/$PACKAGE
LOGDIR=/var/log/$PACKAGE
-USER=Debian-conquest
-GROUP=Debian-conquest
+USER=_conquest
+GROUP=_conquest
NAME=dgate
DAEMON=/usr/bin/$NAME # Introduce the server's location here
DAEMON_ARGS="-w$ETCDIR -^$LOGDIR/dgate.log" # Arguments to run the daemon with
diff --git a/debian/conquest-dicom-server.postinst b/debian/conquest-dicom-server.postinst
index 49336f3..1a928ba 100644
--- a/debian/conquest-dicom-server.postinst
+++ b/debian/conquest-dicom-server.postinst
@@ -3,8 +3,8 @@
set -e
PACKAGE=conquest-dicom-server
-USER=Debian-conquest
-GROUP=Debian-conquest
+USER=_conquest
+GROUP=_conquest
ETCDIR=/etc/$PACKAGE
VARDIR=/var/lib/$PACKAGE
LOGDIR=/var/log/$PACKAGE
diff --git a/debian/conquest-dicom-server.postrm b/debian/conquest-dicom-server.postrm
index 8cba7df..41e4e11 100644
--- a/debian/conquest-dicom-server.postrm
+++ b/debian/conquest-dicom-server.postrm
@@ -3,8 +3,8 @@
set -e
PACKAGE=conquest-dicom-server
-USER=Debian-conquest
-GROUP=Debian-conquest
+USER=_conquest
+GROUP=_conquest
ETCDIR=/etc/$PACKAGE
VARDIR=/var/lib/$PACKAGE
LOGDIR=/var/log/$PACKAGE
@@ -17,8 +17,15 @@ remove_user_group() {
fi
}
+# Chown root:root what remains
+chown_root() {
+ chown -R root:root $VARDIR > /dev/null || true
+ chown -R root:root $LOGDIR > /dev/null || true
+}
+
case "$1" in
purge)
+ chown_root
remove_user_group
;;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/conquest-dicom-server.git
More information about the debian-med-commit
mailing list