summaryrefslogtreecommitdiffstats
path: root/debian/sudo.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:37:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:37:39 +0000
commitc015179efce5825c16d68ec81530d82631cd2cf7 (patch)
tree186c902f87903d06ece7d840b230c37383e86f50 /debian/sudo.postinst
parentAdding upstream version 1.9.13p3. (diff)
downloadsudo-c015179efce5825c16d68ec81530d82631cd2cf7.tar.xz
sudo-c015179efce5825c16d68ec81530d82631cd2cf7.zip
Adding debian version 1.9.13p3-1+deb12u1.debian/1.9.13p3-1+deb12u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/sudo.postinst33
1 files changed, 33 insertions, 0 deletions
diff --git a/debian/sudo.postinst b/debian/sudo.postinst
new file mode 100644
index 0000000..f9bed9b
--- /dev/null
+++ b/debian/sudo.postinst
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+
+# remove old link
+# this was already present in 2017
+
+if [ -L /etc/alternatives/sudo ]; then
+ rm /etc/alternatives/sudo
+fi
+
+# remove legacy conffile no longer delivered
+# this was added in 1.8.21p2-1 in 2017.
+
+if [ -f /etc/sudoers.dist ]; then
+ rm /etc/sudoers.dist
+fi
+
+# complain if no sudoers file is present
+if [ ! -f /etc/sudoers ];then
+ echo "WARNING: /etc/sudoers not present!";
+fi
+
+# make sure sudoers has the correct permissions and owner/group
+if [ -f /etc/sudoers ];then
+ chown root:root /etc/sudoers
+ chmod 440 /etc/sudoers
+fi
+
+# if we've gotten this far .. remove the saved, unchanged old sudoers file
+rm -f /etc/sudoers.pre-conffile
+
+#DEBHELPER#