[pkg-bacula-commits] [bacula] 02/02: merge postinst-common into bacula-director-db.postinst.in
Carsten Leonhardt
leo at moszumanska.debian.org
Sun Aug 21 21:23:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
leo pushed a commit to branch migrate-files
in repository bacula.
commit fbd75938754e42a708bb46a2a777b2a621bff9ec
Author: Carsten Leonhardt <leo at debian.org>
Date: Sun Aug 21 18:01:14 2016 +0200
merge postinst-common into bacula-director-db.postinst.in
---
debian/TODO | 2 +-
debian/additions/postinst-common | 31 -------------------------------
debian/bacula-director-db.postinst.in | 33 +++++++++++++++++++++++++++++++--
debian/bacula-director.install | 1 -
4 files changed, 32 insertions(+), 35 deletions(-)
diff --git a/debian/TODO b/debian/TODO
index 17f59e1..a29e5e6 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -1,6 +1,6 @@
High:
- * debian/additions/postinst-common: possibly unsafe handling of file,
+ * debian/bacula-director-db.postinst.in: possibly unsafe handling of file,
permissions should be set before sensible data is written to the
file. Also consider the worth of having this as a seperate file, it
seems to be only used in one postinst template
diff --git a/debian/additions/postinst-common b/debian/additions/postinst-common
deleted file mode 100755
index 52b43f9..0000000
--- a/debian/additions/postinst-common
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-DEFCONFIGDIR="/usr/share/bacula-common/defconfig"
-DSTDIR="/etc/bacula"
-CONFIG="bacula-dir.conf"
-TMPCONFIG=$DSTDIR/$CONFIG.dpkg-tmp
-
-if [ -f $TMPCONFIG ]; then
- SOURCE=$TMPCONFIG
-else
- SOURCE=$DEFCONFIGDIR/$CONFIG
-fi
-
-if [ ! -f $DSTDIR/$CONFIG ]; then
- TARGET=$DSTDIR/$CONFIG
-else
- TARGET=$DSTDIR/$CONFIG.dist
-fi
-
-# Final config fix
-sed -e "s/@debian_hostname@/`hostname`/" < $SOURCE > $TARGET
-
-# get rid of now unnecessary file
-rm -f $TMPCONFIG
-
-# Harden permissions, so that passwords can not be looked at
-# Fixed by Philipp M Hahn
-chown root:bacula $TARGET
-chmod 640 $TARGET
-
-exit 0
diff --git a/debian/bacula-director-db.postinst.in b/debian/bacula-director-db.postinst.in
index 9792b99..beec30a 100644
--- a/debian/bacula-director-db.postinst.in
+++ b/debian/bacula-director-db.postinst.in
@@ -59,7 +59,6 @@ if [ -f /usr/share/dbconfig-common/dpkg/postinst.$THISDB ]; then
dbc_go bacula-director-$THISDB $@
fi
-POSTINST_COMMON="/usr/share/bacula-director/postinst-common"
DEFCONFIG="/usr/share/bacula-common/defconfig"
CFGFILE="/etc/bacula/bacula-dir.conf"
@@ -114,7 +113,37 @@ configure)
/etc/bacula/scripts/delete_catalog_backup
chmod 755 /etc/bacula/scripts/delete_catalog_backup
- sh $POSTINST_COMMON
+ # the remainder was formerly the content of postinst-common:
+ DEFCONFIGDIR="/usr/share/bacula-common/defconfig"
+ DSTDIR="/etc/bacula"
+ CONFIG="bacula-dir.conf"
+ TMPCONFIG=$DSTDIR/$CONFIG.dpkg-tmp
+
+ if [ -f $TMPCONFIG ]; then
+ SOURCE=$TMPCONFIG
+ else
+ SOURCE=$DEFCONFIGDIR/$CONFIG
+ fi
+
+ if [ ! -f $DSTDIR/$CONFIG ]; then
+ TARGET=$DSTDIR/$CONFIG
+ else
+ TARGET=$DSTDIR/$CONFIG.dist
+ fi
+
+ # Final config fix
+ sed -e "s/@debian_hostname@/`hostname`/" < $SOURCE > $TARGET
+
+ # get rid of now unnecessary file
+ rm -f $TMPCONFIG
+
+ # Harden permissions, so that passwords can not be looked at
+ # Fixed by Philipp M Hahn
+ # XXX this is too late! should be done BEFORE the passwords
+ # are written to the file
+ chown root:bacula $TARGET
+ chmod 640 $TARGET
+
echo "Ok."
;;
diff --git a/debian/bacula-director.install b/debian/bacula-director.install
index 6a99e6f..b3f143a 100644
--- a/debian/bacula-director.install
+++ b/debian/bacula-director.install
@@ -1,4 +1,3 @@
-debian/additions/postinst-common usr/share/bacula-director
etc/bacula/scripts/delete_catalog_backup usr/share/bacula-common/defconfig/scripts
etc/bacula/scripts/query.sql
usr/sbin/bacula-dir
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git
More information about the pkg-bacula-commits
mailing list