[Pkg-samba-maint] [Git][samba-team/samba][master] d/samba-common.postinst: restore installing of smb.conf using ucf

Michael Tokarev (@mjt) gitlab at salsa.debian.org
Tue Oct 10 19:35:05 BST 2023



Michael Tokarev pushed to branch master at Debian Samba Team / samba


Commits:
9fc70e18 by Michael Tokarev at 2023-10-10T21:32:41+03:00
d/samba-common.postinst: restore installing of smb.conf using ucf

- - - - -


1 changed file:

- debian/samba-common.postinst


Changes:

=====================================
debian/samba-common.postinst
=====================================
@@ -1,6 +1,8 @@
 #!/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
@@ -8,6 +10,18 @@ if [ "$1" = configure ]; then
         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#



View it on GitLab: https://salsa.debian.org/samba-team/samba/-/commit/9fc70e184edd222d31a47b80d1566fbe780a5036

-- 
View it on GitLab: https://salsa.debian.org/samba-team/samba/-/commit/9fc70e184edd222d31a47b80d1566fbe780a5036
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-samba-maint/attachments/20231010/7e044a2e/attachment-0001.htm>


More information about the Pkg-samba-maint mailing list