Debian Codegraph @

debian/sudo.postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 # remove old link
6 # this was already present in 2017
7
8 if [ -L "$DPKG_ROOT/etc/alternatives/sudo" ]; then
9 rm "$DPKG_ROOT/etc/alternatives/sudo"
10 fi
11
12 # remove legacy conffile no longer delivered
13 # this was added in 1.8.21p2-1 in 2017.
14
15 if [ -f "$DPKG_ROOT/etc/sudoers.dist" ]; then
16 rm "$DPKG_ROOT/etc/sudoers.dist"
17 fi
18
19 # complain if no sudoers file is present
20 if [ ! -f "$DPKG_ROOT/etc/sudoers" ];then
21 echo "WARNING: /etc/sudoers not present!";
22 fi
23
24 # make sure sudoers has the correct permissions and owner/group
25 if [ -f "$DPKG_ROOT/etc/sudoers" ];then
26 chown root:root "$DPKG_ROOT/etc/sudoers"
27 chmod 440 "$DPKG_ROOT/etc/sudoers"
28 fi
29
30 # if we've gotten this far .. remove the saved, unchanged old sudoers file
31 rm -f "$DPKG_ROOT/etc/sudoers.pre-conffile"
32
33 #DEBHELPER#