mirror of
https://github.com/samba-team/samba.git
synced 2025-12-09 00:23:50 +03:00
s3: smbd: Add fifo test for the DISABLE_OPATH case.
Currently we hang when trying to list a directory containing a fifo when configured with DISABLE_OPATH. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14816 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
committed by
Ralph Boehme
parent
6590bb0b77
commit
a54d9ffc87
@@ -7,3 +7,7 @@
|
||||
# These fail because become_root() doesn't work in make test
|
||||
^samba3.blackbox.dropbox.*
|
||||
^samba3.raw.samba3hide.*
|
||||
# This fails because of BUG: https://bugzilla.samba.org/show_bug.cgi?id=14816
|
||||
# which causes the server to hang when trying to open a pathref fifo without O_PATH.
|
||||
# We need to add O_NONBLOCK to make this work.
|
||||
^samba3.blackbox.fifo
|
||||
|
||||
83
source3/script/tests/test_fifo.sh
Executable file
83
source3/script/tests/test_fifo.sh
Executable file
@@ -0,0 +1,83 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Check smbclient can list a directory containing a fifo.
|
||||
#
|
||||
|
||||
if [ $# -lt 7 ]; then
|
||||
cat <<EOF
|
||||
Usage: $0 SERVER DOMAIN USERNAME PASSWORD PREFIX TARGET_ENV SMBCLIENT
|
||||
EOF
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
SERVER=${1}
|
||||
DOMAIN=${2}
|
||||
USERNAME=${3}
|
||||
PASSWORD=${4}
|
||||
PREFIX=${5}
|
||||
TARGET_ENV=${6}
|
||||
SMBCLIENT=${7}
|
||||
shift 7
|
||||
SMBCLIENT="$VALGRIND ${SMBCLIENT}"
|
||||
ADDARGS="$@"
|
||||
|
||||
incdir=`dirname $0`/../../../testprogs/blackbox
|
||||
. $incdir/subunit.sh
|
||||
|
||||
failed=0
|
||||
|
||||
# Test that listing a share with a directory containing a fifo succeeds.
|
||||
#
|
||||
# BUG: https://bugzilla.samba.org/show_bug.cgi?id=14816
|
||||
#
|
||||
test_fifo()
|
||||
{
|
||||
local fifo_dir_path="$PREFIX/$TARGET_ENV/share/fifodir"
|
||||
local fifo_path="$fifo_dir_path/fifo_name"
|
||||
|
||||
local tmpfile=$PREFIX/smbclient.in.$$
|
||||
|
||||
cat > $tmpfile <<EOF
|
||||
cd fifodir
|
||||
ls
|
||||
quit
|
||||
EOF
|
||||
|
||||
# Create fifo directory.
|
||||
mkdir -p $fifo_dir_path
|
||||
# Create fifo underneath.
|
||||
mkfifo $fifo_path
|
||||
|
||||
local cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT //$SERVER/$1 -U$USERNAME%$PASSWORD $ADDARGS < $tmpfile 2>&1'
|
||||
eval echo "$cmd"
|
||||
out=`eval $cmd`
|
||||
ret=$?
|
||||
|
||||
# Remove fifo and containing dir.
|
||||
rm $fifo_path
|
||||
rmdir $fifo_dir_path
|
||||
rm -f $tmpfile
|
||||
|
||||
# Check for smbclient error.
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "Failed accessing share containing dir with fifo $ret"
|
||||
echo "$out"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check for smbclient timeout (server hung).
|
||||
echo "$out" | grep 'NT_STATUS_'
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ] ; then
|
||||
# Client was disconnected as server timed out.
|
||||
echo "$out"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
testit "list directory containing a fifo" \
|
||||
test_fifo tmp || failed=`expr $failed + 1`
|
||||
|
||||
exit $failed
|
||||
@@ -567,6 +567,9 @@ for env in ["fileserver"]:
|
||||
'-u', '$USERNAME', '-p', '$PASSWORD', '-l', '$LOCAL_PATH/tarmode2',
|
||||
'-d', 'smbclient_tar.SMB3', '-b', smbclient3,
|
||||
'--subunit', '--', configuration, '-mSMB3'])
|
||||
plantestsuite("samba3.blackbox.fifo", env,
|
||||
[os.path.join(samba3srcdir, "script/tests/test_fifo.sh"),
|
||||
'$SERVER', '$DOMAIN', 'gooduser', '$PASSWORD', '$PREFIX', env, smbclient3])
|
||||
|
||||
for env in ["fileserver:local"]:
|
||||
plantestsuite("samba3.blackbox.net_usershare", env, [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3])
|
||||
|
||||
Reference in New Issue
Block a user