From 8daa83a594a2e98f39d764422bfbdbc62c9efd44 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 19:20:00 +0200 Subject: Adding upstream version 2:4.20.0+dfsg. Signed-off-by: Daniel Baumann --- source3/script/tests/test_smbd_error.sh | 66 +++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 source3/script/tests/test_smbd_error.sh (limited to 'source3/script/tests/test_smbd_error.sh') diff --git a/source3/script/tests/test_smbd_error.sh b/source3/script/tests/test_smbd_error.sh new file mode 100755 index 0000000..d39b174 --- /dev/null +++ b/source3/script/tests/test_smbd_error.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# +# Test smbd with failing chdir system call. +# +# Verify that smbd does not panic when the chdir system call is +# returning an error. ensure that the output format for ACL entries +# +# Copyright (C) 2017 Christof Schmitt + +. $(dirname $0)/../../../testprogs/blackbox/subunit.sh +failed=0 + +if [ $SMBD_DONT_LOG_STDOUT -eq 1 ]; then + subunit_start_test "check_panic_0" + subunit_skip_test "check_panic_0" <$error_inject_conf +echo '[global]' >>$error_inject_conf +echo 'panic action = ""' >>$error_inject_conf + +testit_expect_failure "smbclient" $VALGRIND \ + $BINDIR/smbclient //$SERVER_IP/error_inject \ + -U$USERNAME%$PASSWORD -c dir || + failed=$(expr $failed + 1) + +rm $error_inject_conf + +panic_count_1=$(grep -c PANIC $SMBD_TEST_LOG) + +testit "check_panic_1" test $(expr $panic_count_0 + 1) -eq $panic_count_1 || + failed=$(expr $failed + 1) + +# +# Verify that a failing chdir vfs call does not result in a smbd panic +# + +echo 'error_inject:chdir = ESTALE' >$error_inject_conf + +testit_expect_failure "smbclient" $VALGRIND \ + $BINDIR/smbclient //$SERVER_IP/error_inject \ + -U$USERNAME%$PASSWORD -c dir || + failed=$(expr $failed + 1) + +panic_count_2=$(grep -c PANIC $SMBD_TEST_LOG) + +testit "check_panic_2" test $panic_count_1 -eq $panic_count_2 || + failed=$(expr $failed + 1) + +rm $error_inject_conf + +testok $0 $failed -- cgit v1.2.3