Browse Source

Ticket 332 - minor quoting issue in a few scripts.

Description: In monitor and ldif2ldap a variable needed to be quoted.

https://fedorahosted.org/389/ticket/332
Mark Reynolds 12 years ago
parent
commit
07af8260f8
2 changed files with 12 additions and 9 deletions
  1. 5 5
      ldap/admin/src/scripts/ldif2ldap.in
  2. 7 4
      ldap/admin/src/scripts/monitor.in

+ 5 - 5
ldap/admin/src/scripts/ldif2ldap.in

@@ -99,7 +99,7 @@ protocol=$revised_protocol
 #
 if [ "$security" == "on" ]; then
     if [ "$protocol" == "STARTTLS" ] || [ "$protocol" == "" ]; then
-        if [ $error == "yes" ]; then 
+        if [ "$error" == "yes" ]; then 
             echo "Using the next most secure protocol(STARTTLS)"
         fi
         if [ "$openldap" == "yes" ]; then
@@ -116,7 +116,7 @@ fi
 #
 if [ "$security" == "on" ]; then
     if [ "$protocol" == "LDAPS" ] || [ "$protocol" == "" ]; then
-        if [ $error == "yes" ]; then 
+        if [ "$error" == "yes" ]; then 
             echo "Using the next most secure protocol(LDAPS)"
         fi
         if [ "$openldap" == "yes" ]; then
@@ -134,12 +134,12 @@ fi
 if [ "$ldapi" == "on" ] && [ "$openldap" == "yes" ]; then
     if [ "$protocol" == "LDAPI" ] || [ "$protocol" == "" ]; then
         if [ "$(id -u)" == "0" ] && [ "$autobind" == "on" ]; then
-            if [ $error == "yes" ]; then 
+            if [ "$error" == "yes" ]; then 
                 echo "Using the next most secure protocol(LDAPI/AUTOBIND)"
             fi
             ldapmodify -H $ldapiURL -Y EXTERNAL -a -f $input_file 2>/dev/null
         else
-            if [ $error == "yes" ]; then 
+            if [ "$error" == "yes" ]; then 
                 echo "Using the next most secure protocol(LDAPI)"
             fi
             ldapmodify -x -H $ldapiURL -D $rootdn -w $passwd -a -f $input_file
@@ -157,7 +157,7 @@ fi
 # LDAP
 #
 if [ "$protocol" == "LDAP" ] || [ "$protocol" == "" ]; then
-    if [ $error == "yes" ]; then 
+    if [ "$error" == "yes" ]; then 
         echo "Using the next most secure protocol(LDAP)"
     fi
     if [ "$openldap" == "yes" ]; then

+ 7 - 4
ldap/admin/src/scripts/monitor.in

@@ -104,7 +104,7 @@ protocol=$revised_protocol
 #
 if [ "$security" == "on" ]; then
     if [ "$protocol" == "STARTTLS" ] || [ "$protocol" == "" ]; then
-        if [ $error == "yes" ]; then 
+        if [ "$error" == "yes" ]; then 
             echo "Using the next most secure protocol(STARTTLS)"
         fi
         if [ "$openldap" == "yes" ]; then
@@ -121,7 +121,7 @@ fi
 #
 if [ "$security" == "on" ]; then
     if [ "$protocol" == "LDAPS" ] || [ "$protocol" == "" ]; then
-        if [ $error == "yes" ]; then 
+        if [ "$error" == "yes" ]; then 
             echo "Using the next most secure protocol(LDAPS)"
         fi
         if [ "$openldap" == "yes" ]; then
@@ -139,11 +139,14 @@ fi
 if [ "$ldapi" == "on" ] && [ "$openldap" == "yes" ]; then
     if [ "$protocol" == "LDAPI" ] || [ "$protocol" == "" ]; then
         if [ "$(id -u)" == "0" ] && [ "$autobind" == "on" ]; then
-            if [ $error == "yes" ]; then 
+            if [ "$error" == "yes" ]; then 
                 echo "Using the next most secure protocol(LDAPI/AUTOBIND)"
             fi
             ldapsearch -LLL -H "$ldapiURL" -b "$MDN" -s base -Y EXTERNAL "objectClass=*" 2>/dev/null
         else
+            if [ "$error" == "yes" ]; then 
+                echo "Using the next most secure protocol(LDAPI)"
+            fi
             ldapsearch -x -LLL -H "$ldapiURL" -b "$MDN" -s base $dn $passwd "objectClass=*"
         fi
         exit $?
@@ -154,7 +157,7 @@ fi
 # LDAP
 #
 if [ "$protocol" == "LDAP" ] || [ "$protocol" == "" ]; then
-    if [ $error == "yes" ]; then 
+    if [ "$error" == "yes" ]; then 
         echo "Using the next most secure protocol(LDAP)"
     fi
     if [ "$openldap" == "yes" ]; then