summaryrefslogtreecommitdiffstats
path: root/debian/samba-common.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/samba-common.postinst')
-rw-r--r--debian/samba-common.postinst27
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/samba-common.postinst b/debian/samba-common.postinst
new file mode 100644
index 0000000..1877c78
--- /dev/null
+++ b/debian/samba-common.postinst
@@ -0,0 +1,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#