diff -Nru bacula-9.4.2/debian/bacula-sd.postinst bacula-9.4.2/debian/bacula-sd.postinst --- bacula-9.4.2/debian/bacula-sd.postinst 2019-03-01 04:45:37.000000000 +0000 +++ bacula-9.4.2/debian/bacula-sd.postinst 2020-04-13 22:05:09.000000000 +0000 @@ -14,13 +14,15 @@ # create new bacula-sd.conf using the template TMP_CONFIG="$(mktemp -p /tmp $PKG_NAME.conf.ucftmp-XXXXXXXXXX)" - chmod 640 $TMP_CONFIG - chown bacula:bacula $TMP_CONFIG - sed -e s~@debian_basename@~`hostname`~ \ -e s~XXX_SDPASSWORD_XXX~$SDPASSWD~ \ -e s~XXX_MONSDPASSWORD_XXX~$SDMPASSWD~ \ $TEMPLATE > $TMP_CONFIG + + # set permissions + chmod 640 $TMP_CONFIG + chown bacula:bacula $TMP_CONFIG + # let ucf handle the conffile and register it ucf --debconf-ok --three-way $TMP_CONFIG $TARGET ucfr $PKG_NAME $TARGET diff -Nru bacula-9.4.2/debian/changelog bacula-9.4.2/debian/changelog --- bacula-9.4.2/debian/changelog 2020-03-22 15:34:17.000000000 +0000 +++ bacula-9.4.2/debian/changelog 2020-04-13 22:05:09.000000000 +0000 @@ -1,3 +1,14 @@ +bacula (9.4.2-2ubuntu5) focal; urgency=medium + + * d/bacula-sd.postinst: let root user modify $TMP_CONFIG file + (LP: #1861514). Currently, the root user tries to modify the $TMP_CONFIG + file and it gets a permission denied error because the persmission and owner + is changed before any modification in this file is applied. Letting root + user modify $TMP_CONFIG first and then set the permissions fix this + installation issue. + + -- Lucas Kanashiro Mon, 13 Apr 2020 19:05:09 -0300 + bacula (9.4.2-2ubuntu4) focal; urgency=medium * No-change rebuild for libgcc-s1 package name change.