The branch, master has been updated
       via  43b3ee91b29 s3:tests: Use bash and disable history expansion for 
test_wbinfo_lookuprids_cache.sh
       via  df35b106c8d s3:tests: Fix shellcheck warning of 
test_wbinfo_lookuprids_cache.sh
      from  4fcfcc2dd31 docs-xml: Update documentation for --use-kerberos and 
--use-krb5-ccache

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 43b3ee91b29f32477e5ce65ca2b9f1fed86d39ba
Author: Andreas Schneider <a...@samba.org>
Date:   Tue Aug 5 11:31:59 2025 +0200

    s3:tests: Use bash and disable history expansion for 
test_wbinfo_lookuprids_cache.sh
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>
    
    Autobuild-User(master): Volker Lendecke <v...@samba.org>
    Autobuild-Date(master): Tue Aug  5 12:50:07 UTC 2025 on atb-devel-224

commit df35b106c8da2ce563301bd9f41fea0817a91996
Author: Andreas Schneider <a...@samba.org>
Date:   Tue Aug 5 11:11:10 2025 +0200

    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 <a...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/script/tests/test_wbinfo_lookuprids_cache.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/script/tests/test_wbinfo_lookuprids_cache.sh 
b/source3/script/tests/test_wbinfo_lookuprids_cache.sh
index fef4e04b369..31dad5c3f14 100755
--- a/source3/script/tests/test_wbinfo_lookuprids_cache.sh
+++ b/source3/script/tests/test_wbinfo_lookuprids_cache.sh
@@ -1,4 +1,8 @@
-#!/bin/sh
+#!/bin/bash
+
+# Disabling history expansion temporarily
+# This is needed, as the tdb key can include e.g. !6
+set +H
 
 WBINFO="$VALGRIND ${WBINFO:-$BINDIR/wbinfo}"
 samba_tdbtool=tdbtool
@@ -24,9 +28,9 @@ 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 "delete key" "$TDBTOOL" "$cache" delete "$key" || failed=$((failed + 1))
 testit "lookuprids2" "$WBINFO" "-R" "512,12345" || failed=$(expr $failed + 1)
 
 testok $0 $failed


-- 
Samba Shared Repository

Reply via email to