summaryrefslogtreecommitdiffstats
path: root/debian/sudo.postinst
blob: f9bed9bc22dae669f0ebc8be92bd4d8a795753e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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#