summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-12-08 16:55:04 -0700
committerSean Whitton <spwhitton@spwhitton.name>2018-12-08 16:56:38 -0700
commit06b33ba789bfa557037138e840435392b27f41f7 (patch)
tree4c8fdf7075e4fa716958e1a4bf279e6647bd59c2
parent16a835ad72b7acc0f48b53e285c0c04eb6373bba (diff)
downloaddebug-me-06b33ba789bfa557037138e840435392b27f41f7.tar.gz
remove recursive chown from the postinstdebian/1.20181208-2archive/debian/1.20181208-2
-rw-r--r--debian/changelog8
-rwxr-xr-xdebian/debug-me-server.postinst25
2 files changed, 32 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index b779cbb..f85ff3c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+debug-me (1.20181208-2) unstable; urgency=medium
+
+ * Remove recursive chown from the postinst.
+ The situation in which I (presumably) thought it would be needed
+ cannot actually arise; see comments in the postinst.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Sat, 08 Dec 2018 16:56:33 -0700
+
debug-me (1.20181208-1) unstable; urgency=medium
* New upstream release.
diff --git a/debian/debug-me-server.postinst b/debian/debug-me-server.postinst
index bb28c39..83a895a 100755
--- a/debian/debug-me-server.postinst
+++ b/debian/debug-me-server.postinst
@@ -9,6 +9,29 @@ if ! getent passwd _debug-me >/dev/null; then
fi
mkdir -p /var/log/debug-me
chmod 700 /var/log/debug-me
-chown -R _debug-me:_debug-me /var/log/debug-me
+chown _debug-me:_debug-me /var/log/debug-me
+
+# We don't need to chown the contents of /var/log/debug-me because the
+# postrm either removes both the _debug-me user and the
+# /var/log/debug-me directory, or removes neither of them. So we
+# cannot get a situation where there are log files in
+# /var/log/debug-me which need to be chowned to the UID of the new
+# _debug-me user.
+#
+# If the postrm is ever changed not to delete the logs in
+# /var/log/debug-me even on a package purge, but instead to chown them
+# to root, or similar, we would need something like the following
+# (untested):
+#
+# for f in /var/log/debug-me/*; do
+# if test -f "$f"; then
+# links="$(stat --format=%h \"$f\")"
+# if test $links -eq 1; then
+# chown _debug-me:_debug-me "$f"
+# fi
+# fi
+# done
+#
+# (`chown -R` should not be used -- see Lintian tag maintainer-script-should-not-use-recursive-chown-or-chmod)
#DEBHELPER#