3 # Test smbd handling when open returns EINTR
5 # Copyright (C) 2020 Volker Lendecke
8 echo Usage: test_open_eintr.sh \
9 --configfile=SERVERCONFFILE SMBCLIENT SMBCONTROL SERVER SHARE
15 SMBCONTROL=$1; shift 1
19 error_inject_conf=$(dirname ${SERVERCONFFILE})/error_inject.conf
20 > ${error_inject_conf}
22 incdir=$(dirname $0)/../../../testprogs/blackbox
27 rm -f smbclient-stdin smbclient-stdout smbclient-stderr
28 mkfifo smbclient-stdin smbclient-stdout smbclient-stderr
30 CLI_FORCE_INTERACTIVE=1; export CLI_FORCE_INTERACTIVE
32 ${SMBCLIENT} //${SERVER}/${SHARE} ${CONF} -U${USER}%${PASSWORD} \
33 < smbclient-stdin > smbclient-stdout 2>smbclient-stderr &
38 exec 100>smbclient-stdin 101<smbclient-stdout 102<smbclient-stderr
40 # consume the smbclient startup messages
44 echo "error_inject:openat = EINTR" > ${error_inject_conf}
45 ${SMBCONTROL} ${CONF} 0 reload-config
48 > ${error_inject_conf}
50 echo 'get badnames/blank.txt -' >&100
54 > ${error_inject_conf}
55 ${SMBCONTROL} ${CONF} 0 reload-config
57 head -n 1 <&102 | grep 'getting file' > /dev/null
61 rm -f smbclient-stdin smbclient-stdout smbclient-stderr
63 testit "Verify that we could get the file" \
64 test $GREP_RET -eq 0 || failed=$(expr $failed + 1)