diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /source3/script/tests/test_smbclient_iconv.sh | |
parent | Initial commit. (diff) | |
download | samba-upstream.tar.xz samba-upstream.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'source3/script/tests/test_smbclient_iconv.sh')
-rwxr-xr-x | source3/script/tests/test_smbclient_iconv.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbclient_iconv.sh b/source3/script/tests/test_smbclient_iconv.sh new file mode 100755 index 0000000..e6cdc5e --- /dev/null +++ b/source3/script/tests/test_smbclient_iconv.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +# This checks directory listing with a file containing +# an invalid CP850 conversion name returns NT_STATUS_INVALID_NETWORK_RESPONSE + +if [ $# -lt 6 ]; then + cat <<EOF +Usage: test_smbclient_iconv.sh SERVER SERVER_IP SHARENAME USERNAME PASSWORD SMBCLIENT +EOF + exit 1 +fi + +SERVER="$1" +SERVER_IP="$2" +SHARENAME="$3" +USERNAME="$4" +PASSWORD="$5" +SMBCLIENT="$6" +shift 6 +ADDARGS="$@" + +incdir=$(dirname $0)/../../../testprogs/blackbox +. $incdir/subunit.sh + +failed=0 + +test_smbclient_iconv() +{ + normal_smbclient_config="$PREFIX/client/client.conf" + smbclient_config="$PREFIX/client/client_cp850_smbconf" + cat >$smbclient_config <<EOF +[global] + include = $normal_smbclient_config + unix charset = cp850 + client min protocol = core +EOF + + cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT -U$USERNAME%$PASSWORD //$SERVER/$SHARENAME --configfile=$smbclient_config "$ADDARGS" -c ls 2>&1' + eval echo "$cmd" + out=$(eval $cmd) + rm -f $smbclient_config + + echo "$out" | grep 'NT_STATUS_INVALID_NETWORK_RESPONSE' + ret=$? + if [ $ret -ne 0 ]; then + echo "$out" + echo 'failed - should get: NT_STATUS_INVALID_NETWORK_RESPONSE.' + return 1 + fi + + return 0 +} + +testit "bad_iconv smbclient" test_smbclient_iconv || failed=$(expr $failed + 1) +testok $0 $failed |