]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Fix parsing error with back-ldif
authorHoward Chu <hyc@openldap.org>
Sat, 14 Aug 2021 13:21:45 +0000 (14:21 +0100)
committerHoward Chu <hyc@openldap.org>
Sat, 14 Aug 2021 13:21:45 +0000 (14:21 +0100)
tests/scripts/test022-ppolicy

index 34ee6308871c8acc3a15f0494280cc6e2208b45a..2e20dd40c7ab8f1d2c2284401834313db86111c7 100755 (executable)
@@ -103,8 +103,9 @@ if test $COUNT != 2 ; then
        exit 1
 fi
 
-DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
-    -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*seconds_before_unlock=\(\d*\)/\1/p'`
+DTEXT=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
+    -b "$USER" -E accountUsability 1.1`
+DELAY=`echo $DTEXT | sed -n -e 's/.*seconds_before_unlock=\(\d*\)/\1/p'`
 
 echo "Waiting $DELAY seconds for lockout to reset..."
 sleep $DELAY
@@ -119,8 +120,9 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
-    -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DTEXT=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
+    -b "$USER" -E accountUsability 1.1`
+DELAY=`echo $DTEXT | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
 
 echo "Testing password expiration"
 echo "Waiting $DELAY seconds for password to expire..."
@@ -489,8 +491,9 @@ fi
 $LDAPSEARCH -e ppolicy -H $URI1 -D "$USER" -w $PASS \
        -b "$BASEDN" -s base > $SEARCHOUT 2>&1
 
-DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
-    -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DTEXT=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
+    -b "$USER" -E accountUsability 1.1`
+DELAY=`echo $DTEXT | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
 
 echo "Waiting $DELAY seconds for password to expire..."
 sleep $DELAY
@@ -734,8 +737,9 @@ delete: pwdReset
 
 EOMODS
 
-DELAY=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
-    -b "$USER" -E accountUsability 1.1 | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DTEXT=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD \
+    -b "$USER" -E accountUsability 1.1`
+DELAY=`echo $DTEXT | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
 DELAY=`expr $DELAY - 10`
 
 echo "Testing password expiration"