Package: base-files
Version: 12.4+deb12u1
Followup-For: Bug #1039973
Control: tags -1 patch

I attach a patch to fix this problem.

It uses install_local_dir() so that if /etc/staff-group-for-usr-local exists, 
then /var/local will be created as root:staff 2775 same as it works for the 
/usr/local directories.

This also means that the file 2775-dirs is no longer needed nor are the 
commands in rules.
>From 505e9cb788a22d8bbf95d08b3b9ef078ce55088d Mon Sep 17 00:00:00 2001
From: Your Name <y...@example.com>
Date: Fri, 4 Aug 2023 10:57:16 +0000
Subject: [PATCH] use staff group only when requested

---
 debian/2775-dirs   | 1 -
 debian/postinst.in | 2 ++
 debian/rules       | 2 --
 3 files changed, 2 insertions(+), 3 deletions(-)
 delete mode 100644 debian/2775-dirs

diff --git a/debian/2775-dirs b/debian/2775-dirs
deleted file mode 100644
index ad85adc..0000000
--- a/debian/2775-dirs
+++ /dev/null
@@ -1 +0,0 @@
-var/local
diff --git a/debian/postinst.in b/debian/postinst.in
index 0ad4ce3..576b30b 100644
--- a/debian/postinst.in
+++ b/debian/postinst.in
@@ -89,6 +89,8 @@ if [ "$1" = "configure" ] && [ "$2" = "" ]; then
   install_local_dir /usr/local/etc
   ln -sf share/man "$DPKG_ROOT/usr/local/man"
 
+  install_local_dir /var/local
+
   ensure_file_owner_mode /var/log/wtmp root:utmp 664
   ensure_file_owner_mode /var/log/btmp root:utmp 660
   ensure_file_owner_mode /var/log/lastlog root:utmp 664
diff --git a/debian/rules b/debian/rules
index 4c0497b..aab6c49 100755
--- a/debian/rules
+++ b/debian/rules
@@ -46,8 +46,6 @@ override_dh_compress:
 
 override_dh_fixperms:
        dh_fixperms
-       cd debian/base-files && chown root:staff   var/local
        cd debian/base-files && chmod 755  `find . -type d`
        cd debian/base-files && chmod 1777 `cat ../1777-dirs`
-       cd debian/base-files && chmod 2775 `cat ../2775-dirs`
        cd debian/base-files && chmod 700 root
-- 
2.39.2

Reply via email to