Commit eac00de2 authored by Jeremy Allison's avatar Jeremy Allison Committed by Karolin Seeger

s3: tests: Add regression test for smbd crash on share force group change with existing connection.

Mark as known fail for now.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13690Signed-off-by: default avatarJeremy Allison <jra@samba.org>
Reviewed-by: default avatarRalph Boehme <slow@samba.org>
(cherry picked from commit 7b21b4c1)
parent 44f49283
......@@ -349,3 +349,5 @@
# Disabling NTLM means you can't use samr to change the password
^samba.tests.ntlmdisabled.python\(ktest\).ntlmdisabled.NtlmDisabledTests.test_samr_change_password\(ktest\)
^samba.tests.ntlmdisabled.python\(ad_dc_no_ntlm\).ntlmdisabled.NtlmDisabledTests.test_ntlm_connection\(ad_dc_no_ntlm\)
# BUG:https://bugzilla.samba.org/show_bug.cgi?id=13690
^samba3.blackbox.force_group_change.*
......@@ -197,3 +197,4 @@ smbcquotas = binpath('smbcquotas')
smbget = binpath('smbget')
rpcclient = binpath('rpcclient')
smbcacls = binpath('smbcacls')
smbcontrol = binpath('smbcontrol')
......@@ -904,6 +904,12 @@ sub setup_fileserver
force group = everyone
write list = force_user
# BUG: https://bugzilla.samba.org/show_bug.cgi?id=13690
[force_group_test]
path = $share_dir
comment = force group test
# force group = everyone
[smbget]
path = $smbget_sharedir
comment = smb username is [%U]
......
#!/bin/sh
# Copyright (c) Jeremy Allison <jra@samba.org>
# License: GPLv3
# Regression test for BUG:https://bugzilla.samba.org/show_bug.cgi?id=13690
if [ $# -lt 6 ]; then
echo "Usage: test_force_group_change.sh SERVER USERNAME PASSWORD LOCAL_PATH SMBCLIENT SMBCONTROL"
exit 1
fi
SERVER="${1}"
USERNAME="${2}"
PASSWORD="${3}"
LOCAL_PATH="${4}"
SMBCLIENT="${5}"
SMBCONTROL="${6}"
shift 6
incdir=`dirname $0`/../../../testprogs/blackbox
. $incdir/subunit.sh
failed=0
test_force_group_change()
{
#
# A SMB_CONF variable passed in here is the client smb.conf.
# We need to convert to the server.conf file from
# the LOCAL_PATH variable.
#
SERVER_CONFIG=`dirname $LOCAL_PATH`/lib/server.conf
SERVER_CONFIG_SAVE=${SERVER_CONFIG}.bak
SERVER_CONFIG_NEW=${SERVER_CONFIG}.new
cp $SERVER_CONFIG $SERVER_CONFIG_SAVE
sed -e 's/#\tforce group = everyone/\tforce group = everyone/' <${SERVER_CONFIG} >${SERVER_CONFIG_NEW}
tmpfile=$PREFIX/smbclient_force_group_change_commands
cat > $tmpfile <<EOF
ls
!cp ${SERVER_CONFIG_NEW} ${SERVER_CONFIG}
!${SMBCONTROL} --configfile=${SERVER_CONFIG} all reload-config
ls
!cp ${SERVER_CONFIG_SAVE} ${SERVER_CONFIG}
!${SMBCONTROL} --configfile=${SERVER_CONFIG} all reload-config
quit
EOF
cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/force_group_test $CONFIGURATION < $tmpfile 2>&1'
eval echo "$cmd"
out=$(eval $cmd)
ret=$?
rm -f $tmpfile
rm -f $SERVER_CONFIG_SAVE
rm -f $SERVER_CONFIG_NEW
echo "$out" | grep 'NT_STATUS_CONNECTION_DISCONNECTED'
ret=$?
if [ $ret -eq 0 ] ; then
# Client was disconnected as server crashed.
echo "$out"
return 1
fi
return 0
}
testit "test force group change" \
test_force_group_change || \
failed=`expr $failed + 1`
testok $0 $failed
......@@ -291,6 +291,9 @@ for env in ["fileserver"]:
plantestsuite("samba3.blackbox.large_acl.NT1", env, [os.path.join(samba3srcdir, "script/tests/test_large_acl.sh"), '$SERVER', '$USERNAME', '$PASSWORD', smbclient3, smbcacls, '-m', 'NT1'])
plantestsuite("samba3.blackbox.large_acl.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_large_acl.sh"), '$SERVER', '$USERNAME', '$PASSWORD', smbclient3, smbcacls, '-m', 'SMB3'])
plantestsuite("samba3.blackbox.give_owner", env, [os.path.join(samba3srcdir, "script/tests/test_give_owner.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3, smbcacls, net, 'tmp'])
plantestsuite("samba3.blackbox.force_group_change", env,
[os.path.join(samba3srcdir, "script/tests/test_force_group_change.sh"),
'$SERVER', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3, smbcontrol])
#
# tar command tests
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment