summaryrefslogtreecommitdiffstats
path: root/debian/samba-common.postinst
blob: 1877c78c77c1991d9a8a823b1b5b24192ba601fe (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
#!/bin/sh
set -e

CONFIG=/etc/samba/smb.conf

if [ "$1" = configure ]; then
    if ! dpkg-statoverride --list /var/log/samba >/dev/null; then
        # Set some reasonable default perms for the samba logdir
        # to hide sensitive information
        chmod 0750 /var/log/samba
        chown root:adm /var/log/samba
    fi

    ucf --three-way --debconf-ok /usr/share/samba/smb.conf "$CONFIG"

    if [ ! -e "$CONFIG" ]; then
       echo "Install/upgrade will fail. To recover, please try:"
       echo " sudo cp /usr/share/samba/smb.conf $CONFIG"
       echo " sudo dpkg --configure -a"
    else
       ucfr samba-common "$CONFIG"
       chmod a+r "$CONFIG"
    fi

fi

#DEBHELPER#