From cd24e2dfb792d261814d88517eb893cb8d50ab75 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 13 Jun 2022 16:03:39 +0200 Subject: [PATCH] testprogs: Fix shellchecks errors in test_pdbtest.sh MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit testprogs/blackbox/test_pdbtest.sh:61:53: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:73:157: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:76:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:78:92: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:80:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:90:79: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:92:75: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:96:73: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:100:99: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:104:89: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:111:125: error: Double quote array expansions to avoid re-splitting elements. [SC2068] testprogs/blackbox/test_pdbtest.sh:115:70: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider Reviewed-by: Pavel Filipenský --- testprogs/blackbox/test_pdbtest.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/testprogs/blackbox/test_pdbtest.sh b/testprogs/blackbox/test_pdbtest.sh index d7fff879d91..03c0bd2d462 100755 --- a/testprogs/blackbox/test_pdbtest.sh +++ b/testprogs/blackbox/test_pdbtest.sh @@ -58,7 +58,7 @@ EOF fi } -testit "pdbtest" $VALGRIND $BINDIR/pdbtest -u $USER $@ || failed=$(expr $failed + 1) +testit "pdbtest" $VALGRIND $BINDIR/pdbtest -u $USER "$@" || failed=$(expr $failed + 1) NEWUSERPASS=testPaSS@01% @@ -70,14 +70,14 @@ expect retype new password: send ${NEWUSERPASS}\n EOF -testit "create user with pdbedit" $texpect $PREFIX/tmpsmbpasswdscript $VALGRIND $pdbedit --configfile=$SMB_CONF -a $USER --account-desc="pdbedit-test-user" $@ || failed=$(expr $failed + 1) +testit "create user with pdbedit" $texpect $PREFIX/tmpsmbpasswdscript $VALGRIND $pdbedit --configfile=$SMB_CONF -a $USER --account-desc="pdbedit-test-user" "$@" || failed=$(expr $failed + 1) USERPASS=$NEWUSERPASS -test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS $@ || failed=$(expr $failed + 1) +test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS "$@" || failed=$(expr $failed + 1) -testit "modify user" $VALGRIND $pdbedit --configfile=$SMB_CONF --modify $USER --drive="D:" $@ || failed=$(expr $failed + 1) +testit "modify user" $VALGRIND $pdbedit --configfile=$SMB_CONF --modify $USER --drive="D:" "$@" || failed=$(expr $failed + 1) -test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS $@ || failed=$(expr $failed + 1) +test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS "$@" || failed=$(expr $failed + 1) NEWUSERPASS=testPaSS@02% @@ -87,32 +87,32 @@ testit "set user password with smbpasswd" \ USERPASS=$NEWUSERPASS -test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS $@ || failed=$(expr $failed + 1) +test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS "$@" || failed=$(expr $failed + 1) -testit "modify user - disabled" $VALGRIND $net sam set disabled $USER yes $@ || failed=$(expr $failed + 1) +testit "modify user - disabled" $VALGRIND $net sam set disabled $USER yes "$@" || failed=$(expr $failed + 1) testit_expect_failure "Test login with disabled suer" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -U$USER@%$USERPASS && failed=$(expr $failed + 1) -testit "modify user - enabled" $VALGRIND $net sam set disabled $USER no $@ || failed=$(expr $failed + 1) +testit "modify user - enabled" $VALGRIND $net sam set disabled $USER no "$@" || failed=$(expr $failed + 1) test_smbclient "Test login with re-enabled user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS || failed=$(expr $failed + 1) -testit "modify user - must change password now" $VALGRIND $net sam set pwdmustchangenow $USER yes $@ || failed=$(expr $failed + 1) +testit "modify user - must change password now" $VALGRIND $net sam set pwdmustchangenow $USER yes "$@" || failed=$(expr $failed + 1) testit_expect_failure "Test login with expired password" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -U$USER@%$USERPASS && failed=$(expr $failed + 1) -testit "modify user - disable password expiry" $VALGRIND $net sam set pwnoexp $USER yes $@ || failed=$(expr $failed + 1) +testit "modify user - disable password expiry" $VALGRIND $net sam set pwnoexp $USER yes "$@" || failed=$(expr $failed + 1) test_smbclient "Test login with no expiry (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS || failed=$(expr $failed + 1) NEWUSERPASS=testPaSS@03% NEWUSERHASH=062519096c45739c1938800f80906731 -testit "Set user password with password hash" $VALGRIND $pdbedit --configfile=$SMB_CONF -u $USER --set-nt-hash $NEWUSERHASH $@ || failed=$(expr $failed + 1) +testit "Set user password with password hash" $VALGRIND $pdbedit --configfile=$SMB_CONF -u $USER --set-nt-hash $NEWUSERHASH "$@" || failed=$(expr $failed + 1) test_smbclient "Test login with new password (from hash)" 'ls' "$unc" -U$USER%$NEWUSERPASS || failed=$(expr $failed + 1) -testit "del user" $VALGRIND $pdbedit --configfile=$SMB_CONF -x $USER $@ || failed=$(expr $failed + 1) +testit "del user" $VALGRIND $pdbedit --configfile=$SMB_CONF -x $USER "$@" || failed=$(expr $failed + 1) rm $PREFIX/tmpsmbpasswdscript -- 2.47.3