]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9718 - Fix nonportable sed usage
authorQuanah Gibson-Mount <quanah@openldap.org>
Mon, 30 Jan 2023 22:06:06 +0000 (22:06 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 30 Jan 2023 22:59:19 +0000 (22:59 +0000)
tests/scripts/test022-ppolicy

index 6a9cc6caed6f85da413d37f06339dfee8c54c226..292a97c1bf5a11dd0519fafc465ef21c835ebb76 100755 (executable)
@@ -105,7 +105,7 @@ fi
 
 DELAYATTR=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD -b "$USER" -E accountUsability 1.1`
 echo "$DELAYATTR" >> $SEARCHOUT
-DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*seconds_before_unlock=\(\d*\)/\1/p'`
+DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*seconds_before_unlock=\([[:digit:]]*\)/\1/p'`
 
 echo "Waiting $DELAY seconds for lockout to reset..."
 sleep $DELAY
@@ -122,7 +122,7 @@ fi
 
 DELAYATTR=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD -b "$USER" -E accountUsability 1.1`
 echo "$DELAYATTR" >> $SEARCHOUT
-DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\([[:digit:]]*\)/\1/p'`
 
 echo "Testing password expiration"
 echo "Waiting $DELAY seconds for password to expire..."
@@ -493,7 +493,7 @@ $LDAPSEARCH -e ppolicy -H $URI1 -D "$USER" -w $PASS \
 
 DELAYATTR=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD -b "$USER" -E accountUsability 1.1`
 echo "$DELAYATTR" >> $SEARCHOUT
-DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\([[:digit:]]*\)/\1/p'`
 
 echo "Waiting $DELAY seconds for password to expire..."
 sleep $DELAY
@@ -739,7 +739,7 @@ EOMODS
 
 DELAYATTR=`$LDAPSEARCH -D "$MANAGERDN" -H $URI1 -w $PASSWD -b "$USER" -E accountUsability 1.1`
 echo "$DELAYATTR" >> $TESTOUT
-DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\(\d*\)/\1/p'`
+DELAY=`echo "$DELAYATTR" | sed -n -e 's/.*expire=\([[:digit:]]*\)/\1/p'`
 DELAY=`expr $DELAY - 10`
 
 echo "Testing password expiration"