summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2025-08-05 11:11:10 +0200
committerVolker Lendecke <vl@samba.org>2025-08-05 11:50:32 +0000
commitdf35b106c8da2ce563301bd9f41fea0817a91996 (patch)
tree937bbb5f73d291a37e39513030fdf5d08c67dc96 /source3
parent4fcfcc2dd31d1ebcaa58fe12d1c8d3a2695263ce (diff)
downloadsamba-df35b106c8da2ce563301bd9f41fea0817a91996.tar.gz
samba-df35b106c8da2ce563301bd9f41fea0817a91996.tar.bz2
samba-df35b106c8da2ce563301bd9f41fea0817a91996.zip
s3:tests: Fix shellcheck warning of test_wbinfo_lookuprids_cache.sh
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>
Diffstat (limited to 'source3')
-rwxr-xr-xsource3/script/tests/test_wbinfo_lookuprids_cache.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/script/tests/test_wbinfo_lookuprids_cache.sh b/source3/script/tests/test_wbinfo_lookuprids_cache.sh
index fef4e04b369..2f441d21af3 100755
--- a/source3/script/tests/test_wbinfo_lookuprids_cache.sh
+++ b/source3/script/tests/test_wbinfo_lookuprids_cache.sh
@@ -24,7 +24,7 @@ testit "flush" "$NET" "cache" "flush" || failed=$(expr $failed + 1)
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)