aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-11-07 13:07:26 +0100
committerintrigeri <intrigeri@boum.org>2010-11-07 13:07:26 +0100
commit13f247afebde199ffb03d23e8662d362d5681ca6 (patch)
treeb8858b83adc18b09e3822f78f517473a09d45878 /handlers
parent0b60b58153f352e6f0c7e8f52b0824720c2a4c05 (diff)
downloadbackupninja-13f247afebde199ffb03d23e8662d362d5681ca6.tar.gz
backupninja-13f247afebde199ffb03d23e8662d362d5681ca6.tar.bz2
Fix reliance on bash for pipefail. (Closes: #602374)
Thanks to Sergio Talens-Oliag <sto@debian.org> for the bug report and patch.
Diffstat (limited to 'handlers')
-rw-r--r--handlers/ldap.in2
-rw-r--r--handlers/mysql.in2
-rw-r--r--handlers/pgsql.in12
3 files changed, 8 insertions, 8 deletions
diff --git a/handlers/ldap.in b/handlers/ldap.in
index 83307ee..600f172 100644
--- a/handlers/ldap.in
+++ b/handlers/ldap.in
@@ -91,7 +91,7 @@ if [ "$ldif" == "yes" ]; then
execstr="$execstr > $dumpdir/$dbsuffix.ldif"
fi
debug "$execstr"
- output=`su root -c "set -o pipefail ; $execstr" 2>&1`
+ output=`su root -s /bin/bash -c "set -o pipefail ; $execstr" 2>&1`
code=$?
if [ "$code" == "0" ]; then
debug $output
diff --git a/handlers/mysql.in b/handlers/mysql.in
index 0282046..05ea396 100644
--- a/handlers/mysql.in
+++ b/handlers/mysql.in
@@ -303,7 +303,7 @@ then
debug "su $user -c \"$execstr\""
if [ ! $test ]
then
- output=`su $user -c "set -o pipefail ; $execstr" 2>&1`
+ output=`su $user -s /bin/bash -c "set -o pipefail ; $execstr" 2>&1`
code=$?
if [ "$code" == "0" ]
then
diff --git a/handlers/pgsql.in b/handlers/pgsql.in
index f68ec2f..ff71ebc 100644
--- a/handlers/pgsql.in
+++ b/handlers/pgsql.in
@@ -115,13 +115,13 @@ fi
if [ "$databases" == "all" ]; then
if [ $usevserver = yes ]; then
if [ "$compress" == "yes" ]; then
- execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMPALL | $GZIP $GZIP_OPTS > '$backupdir/${vsname}.sql.gz'\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -s /bin/bash -c \"set -o pipefail ; $PGSQLDUMPALL | $GZIP $GZIP_OPTS > '$backupdir/${vsname}.sql.gz'\""
else
execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > '$backupdir/${vsname}.sql'\""
fi
else
if [ "$compress" == "yes" ]; then
- execstr="su - $PGSQLUSER -c \"set -o pipefail ; $PGSQLDUMPALL | $GZIP $GZIP_OPTS > '$backupdir/${localhost}-all.sql.gz'\""
+ execstr="su - $PGSQLUSER -s /bin/bash -c \"set -o pipefail ; $PGSQLDUMPALL | $GZIP $GZIP_OPTS > '$backupdir/${localhost}-all.sql.gz'\""
else
execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > '$backupdir/${localhost}-all.sql'\""
fi
@@ -152,9 +152,9 @@ else
globalscmd="$PGSQLDUMPALL -g > '$backupdir/globals.sql'"
fi
if [ $usevserver = yes ]; then
- execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$globalscmd\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -s /bin/bash -c \"$globalscmd\""
else
- execstr="su - $PGSQLUSER -c \"$globalscmd\""
+ execstr="su - $PGSQLUSER -s /bin/bash -c \"$globalscmd\""
fi
debug "$execstr"
if [ ! $test ]; then
@@ -189,9 +189,9 @@ else
dumpcmd="$PGSQLDUMP --format=$format ${disablecustomcompress} $db | > '$backupdir/${db}.${dumpext}'"
fi
if [ $usevserver = yes ]; then
- execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$dumpcmd\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -s /bin/bash -c \"$dumpcmd\""
else
- execstr="su - $PGSQLUSER -c \"$dumpcmd\""
+ execstr="su - $PGSQLUSER -s /bin/bash -c \"$dumpcmd\""
fi
debug "$execstr"
if [ ! $test ]; then