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
24 # Do not let deprecated option warnings muck this up
25 SAMBA_DEPRECATED_SUPPRESS
=1
26 export SAMBA_DEPRECATED_SUPPRESS
28 error_inject_conf
=$
(dirname ${SERVERCONFFILE})/error_inject.conf
31 incdir
=$
(dirname $0)/..
/..
/..
/testprogs
/blackbox
36 cd $SELFTEST_TMPDIR ||
exit 1
38 rm -f smbclient-stdin smbclient-stdout smbclient-stderr
39 mkfifo smbclient-stdin smbclient-stdout smbclient-stderr
41 CLI_FORCE_INTERACTIVE
=1
42 export CLI_FORCE_INTERACTIVE
44 ${SMBCLIENT} //${SERVER}/${SHARE} ${CONF} -U${USER}%${PASSWORD} \
45 <smbclient-stdin
>smbclient-stdout
2>smbclient-stderr
&
50 exec 100>smbclient-stdin
101<smbclient-stdout
102<smbclient-stderr
52 # consume the smbclient startup messages
55 echo "error_inject:openat = EINTR" >${error_inject_conf}
56 ${SMBCONTROL} ${CONF} 0 reload-config
61 echo 'get badnames/blank.txt -' >&100
66 ${SMBCONTROL} ${CONF} 0 reload-config
68 head -n 1 <&102 |
grep 'getting file' >/dev
/null
72 rm -f smbclient-stdin smbclient-stdout smbclient-stderr
74 testit
"Verify that we could get the file" \
75 test $GREP_RET -eq 0 || failed
=$
(expr $failed + 1)