projects
/
matthijs
/
upstream
/
backupninja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes for Trac#24
[matthijs/upstream/backupninja.git]
/
handlers
/
ldap.in
diff --git
a/handlers/ldap.in
b/handlers/ldap.in
index 5f9040a32ebe056f3f3c24050aa4ada9ab2a2d5f..f6f87c77a46ce83eba218aa0d87c09cb29555e75 100644
(file)
--- a/
handlers/ldap.in
+++ b/
handlers/ldap.in
@@
-42,7
+42,7
@@
if [ "$ldif" == "yes" ]; then
fi
for db in $databases; do
fi
for db in $databases; do
- if [ `expr index "$db
num
" "="` == "0" ]; then
+ if [ `expr index "$db" "="` == "0" ]; then
# db is a number, get the suffix.
dbsuffix=${dbsuffixes[$db]/*:/}
else
# db is a number, get the suffix.
dbsuffix=${dbsuffixes[$db]/*:/}
else
@@
-55,7
+55,6
@@
if [ "$ldif" == "yes" ]; then
if [ "$method" == "slapcat" ]; then
execstr="$SLAPCAT -f $conf -b $dbsuffix"
if [ "$method" == "slapcat" ]; then
execstr="$SLAPCAT -f $conf -b $dbsuffix"
- debug "$execstr"
else
if [ -n "$ldaphost" ]; then
execstr="$LDAPSEARCH -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
else
if [ -n "$ldaphost" ]; then
execstr="$LDAPSEARCH -H $URLBASE://$ldaphost -x -L -b ""$dbsuffix"" -D ""$binddn"" -y $passwordfile"
@@
-81,10
+80,12
@@
if [ "$ldif" == "yes" ]; then
fi
if [ "$compress" == "yes" ]; then
fi
if [ "$compress" == "yes" ]; then
- output=`$execstr | $GZIP > $dumpdir/$dbsuffix.ldif.gz`
+ execstr="$execstr | $GZIP > $dumpdir/$dbsuffix.ldif.gz"
else
else
- output=`$execstr > $dumpdir/$dbsuffix.ldif`
+ execstr="$execstr > $dumpdir/$dbsuffix.ldif"
fi
fi
+ debug "$execstr"
+ output=`su root -c "$execstr" 2>&1`
code=$?
if [ "$code" == "0" ]; then
debug $output
code=$?
if [ "$code" == "0" ]; then
debug $output