[med-svn] [Git][med-team/dcmtk][master] 2 commits: Stop deleting system user/group on remove/purge
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sun May 3 16:54:52 BST 2026
Andreas Tille pushed to branch master at Debian Med / dcmtk
Commits:
4ec5e9eb by Luca Boccassi at 2026-05-03T14:47:25+01:00
Stop deleting system user/group on remove/purge
Removing system users/groups on purge is considered bad practice,
as the kernel recycles UIDs/GIDs. So any potential leftover
file/directory can then become owned by the next user/group that
gets added, with unpredictable consequences.
- - - - -
14f8feec by Luca Boccassi at 2026-05-03T14:47:37+01:00
Install and use sysusers.d/tmpfiles.d config files
sysusers.d/tmpfiles.d config files allow a package to use declarative
configuration instead of manually written maintainer scripts.
This also allows image-based systems to be created with /usr/ only, and
also allows for factory resetting a system and recreating /etc/ on boot.
https://www.freedesktop.org/software/systemd/man/latest/sysusers.d.html
- - - - -
5 changed files:
- debian/control
- debian/dcmtk.postinst
- debian/dcmtk.postrm
- + debian/dcmtk.sysusers
- + debian/dcmtk.tmpfiles
Changes:
=====================================
debian/control
=====================================
@@ -4,6 +4,7 @@ Uploaders: Gert Wollny <gewo at debian.org>, Mathieu Malaterre <malat at debian.org>
Section: science
Build-Depends: cmake,
debhelper-compat (= 13),
+ dh-sequence-installsysusers,
dpkg-dev (>= 1.22.5),
gettext,
help2man,
@@ -24,7 +25,7 @@ Homepage: https://dicom.offis.de/dcmtk
Package: dcmtk
Architecture: any
-Depends: adduser, ${misc:Depends}, ${shlibs:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
Description: OFFIS DICOM toolkit command line utilities
DCMTK includes a collection of libraries and applications for examining,
constructing and converting DICOM image files, handling offline media,
=====================================
debian/dcmtk.postinst
=====================================
@@ -2,24 +2,6 @@
set -e
-# Create dcmtk user and group
-
-if ! getent passwd dcmtk >/dev/null 2>&1; then
- if ! getent group dcmtk > /dev/null 2>&1; then
- echo "Adding \`dcmtk' group to system ..."
- addgroup --quiet --system dcmtk || true
- fi
- echo "Adding \`dcmtk' user to system ..."
- adduser --quiet --system --ingroup dcmtk --home /var/lib/dcmtk/db \
- --shell /usr/sbin/nologin dcmtk || true
-fi
-
-# work around possible adduser bug, see #119366
-[ -d /var/lib/dcmtk/db ] || mkdir -p /var/lib/dcmtk/db
-chmod 755 /var/lib/dcmtk/db
-chown -h dcmtk:dcmtk /var/lib/dcmtk/db || true
-
-
# Handle imagectn -> dcmqrdb transition in (3.5.3 -> 3.5.4)
=====================================
debian/dcmtk.postrm
=====================================
@@ -19,11 +19,5 @@ if [ "$1" = "purge" ] ; then
fi
fi
-# Remove dcmtk user/group if they exist on cleanup
-if id -u "dcmtk" > /dev/null 2>&1; then
- echo "Removing \`dcmtk' user and group from the system..."
- userdel dcmtk
-fi
-
#DEBHELPER#
=====================================
debian/dcmtk.sysusers
=====================================
@@ -0,0 +1 @@
+u! dcmtk - - /var/lib/dcmtk/db /usr/sbin/nologin
=====================================
debian/dcmtk.tmpfiles
=====================================
@@ -0,0 +1,2 @@
+d /var/lib/dcmtk/db 0755 dcmtk dcmtk
+Z /var/lib/dcmtk/db 0755 dcmtk dcmtk
View it on GitLab: https://salsa.debian.org/med-team/dcmtk/-/compare/c76c426eb81d6e5a49757bf474a98a61f2d4a62b...14f8feec060ac99c34978944d3dcda89788f897a
--
View it on GitLab: https://salsa.debian.org/med-team/dcmtk/-/compare/c76c426eb81d6e5a49757bf474a98a61f2d4a62b...14f8feec060ac99c34978944d3dcda89788f897a
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260503/ba163089/attachment-0001.htm>
More information about the debian-med-commit
mailing list