From: Quanah Gibson-Mount Date: Mon, 30 Jan 2023 22:06:06 +0000 (+0000) Subject: ITS#9718 - Fix nonportable sed usage X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b220ba10777a837881d176d9253eb2da2e033f18;p=thirdparty%2Fopenldap.git ITS#9718 - Fix nonportable sed usage --- diff --git a/tests/scripts/test022-ppolicy b/tests/scripts/test022-ppolicy index 3d74f4d875..33c1f8f5c5 100755 --- a/tests/scripts/test022-ppolicy +++ b/tests/scripts/test022-ppolicy @@ -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'` # $DELAY is empty if we were so slow that the lockout expired already, # continue test but the next part might fail anyway since we rely on @@ -127,7 +127,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" # $DELAY is empty if we were so slow that the password expired already @@ -519,7 +519,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 @@ -810,7 +810,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"