In source3/script/tests/test_wbinfo_lookuprids_cache.sh line 27:
key=$("$TDBDUMP" "$cache" | grep ^key.*NDR.*/"$opnum"/ | cut -d\" -f2)
^-------------------^ SC2062 (warning):
Quote the grep pattern so the shell won't
interpret it.
Lets better use awk for matching the pattern.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
testit "lookuprids1" "$WBINFO" "-R" "512,12345" || failed=$(expr $failed + 1)
opnum=$($PYTHON -c'from samba.dcerpc.winbind import wbint_LookupRids; print(wbint_LookupRids.opnum())')
-key=$("$TDBDUMP" "$cache" | grep ^key.*NDR.*/"$opnum"/ | cut -d\" -f2)
+key=$("$TDBDUMP" "$cache" | awk -F'"' -v opnum="${opnum}" '/key.*NDR/ { regex = "NDR/[^/]+/" opnum "/.*$"; if (match($2, regex)) print substr($2, RSTART, RLENGTH) }')
testit "delete" "$TDBTOOL" "$cache" delete "$key"
testit "lookuprids2" "$WBINFO" "-R" "512,12345" || failed=$(expr $failed + 1)