fixed Trac#29 causing slapcat + gzip not to work
authorMicah Anderson <micah@riseup.net>
Sat, 24 Nov 2007 23:00:33 +0000 (23:00 +0000)
committerMicah Anderson <micah@riseup.net>
Sat, 24 Nov 2007 23:00:33 +0000 (23:00 +0000)
ChangeLog
handlers/ldap.in

index 8cd85c6f3be1302221a3c83df997c8fca1306a88..9a2cb00d0cec859a771aa94b61239847815b31a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,8 +11,8 @@ version 0.9.5 -- unreleased
           created with permissions 000 by an older ninjahelper version.
         . Enhanced portability for other platforms
         . Added quoting because it was needed to prevent shell expansion, broking the
-           toint function sometimes (Trac#11)
-        . Fixed reportspace option (Trac#10)
+           toint function sometimes (Closes: Trac#11)
+        . Fixed reportspace option (Closes: Trac#10)
     handler changes
        dup:
         . Support duplicity >= 0.4.3 invocation syntax (--ssh-command option
@@ -23,6 +23,8 @@ version 0.9.5 -- unreleased
           file (Closes: #394935)
         . Fixed ninjahelper to properly set compress option, standardized on yes/no
           instead of on/off
+        . Fixed problem that caused combination of slapcat and compress to not work
+          together (Closes: Trac#29)
        maildir:
         . Added an examples file (Closes: Trac#23)
         mysql:
index 5f9040a32ebe056f3f3c24050aa4ada9ab2a2d5f..4d9a3354e117a50759ce961847965908a59685c4 100644 (file)
@@ -55,7 +55,6 @@ if [ "$ldif" == "yes" ]; then
       
       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"
@@ -81,10 +80,12 @@ if [ "$ldif" == "yes" ]; then
          fi
          
          if [ "$compress" == "yes" ]; then
-            output=`$execstr | $GZIP > $dumpdir/$dbsuffix.ldif.gz`
+            execstr="$execstr | $GZIP > $dumpdir/$dbsuffix.ldif.gz"
          else
-            output=`$execstr > $dumpdir/$dbsuffix.ldif`
+            execstr="$execstr > $dumpdir/$dbsuffix.ldif"
          fi
+         debug "$execstr"
+         output=`su root -c "$execstr" 2>&1`
          code=$?
          if [ "$code" == "0" ]; then
             debug $output