The Samba-Bugzilla – Attachment 15788 Details for
Bug 14279
REGRESSION: We can't change to a dropbox directory with mode 733 and drop a file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A 'dropbox' test
0001-s3-tests-Add-test-for-a-dropbox-with-dir-mode-0733.patch (text/plain), 4.79 KB, created by
Andreas Schneider
on 2020-02-13 16:29:49 UTC
(
hide
)
Description:
A 'dropbox' test
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2020-02-13 16:29:49 UTC
Size:
4.79 KB
patch
obsolete
>From 1a4b55d825e1a1cf15d8b1c8a9ada49d97c9ab50 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Thu, 13 Feb 2020 13:48:17 +0100 >Subject: [PATCH] s3:tests: Add test for a dropbox with dir mode 0733 > >Signed-off-by: Andreas Schneider <asn@samba.org> >--- > selftest/target/Samba3.pm | 9 ++++ > source3/script/tests/test_dropbox.sh | 77 ++++++++++++++++++++++++++++ > source3/selftest/tests.py | 1 + > 3 files changed, 87 insertions(+) > create mode 100755 source3/script/tests/test_dropbox.sh > >diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm >index 99230a6429c..7ccd800e474 100755 >--- a/selftest/target/Samba3.pm >+++ b/selftest/target/Samba3.pm >@@ -991,6 +991,9 @@ sub setup_fileserver > my $usershare_sharedir="$share_dir/usershares"; > push(@dirs,$usershare_sharedir); > >+ my $dropbox_sharedir="$share_dir/dropbox"; >+ push(@dirs,$dropbox_sharedir); >+ > my $fileserver_options = " > kernel change notify = yes > rpc_server:mdssvc = embedded >@@ -1079,6 +1082,10 @@ sub setup_fileserver > force create mode = 0664 > vfs objects = dirsort > >+[dropbox] >+ path = $dropbox_sharedir >+ comment = smb username is [%U] >+ > [homes] > comment = Home directories > browseable = No >@@ -1102,6 +1109,8 @@ sub setup_fileserver > > mkdir($_, 0777) foreach(@dirs); > >+ mkdir("$dropbox_sharedir/dirmode733", 0333); >+ > ## Create case sensitive lower case share dir > foreach my $file ('a'..'z') { > my $full_path = $lower_case_share_dir . '/' . $file; >diff --git a/source3/script/tests/test_dropbox.sh b/source3/script/tests/test_dropbox.sh >new file mode 100755 >index 00000000000..e05e02659b4 >--- /dev/null >+++ b/source3/script/tests/test_dropbox.sh >@@ -0,0 +1,77 @@ >+#!/bin/sh >+# >+# Blackbox test for valid users. >+# >+ >+if [ $# -lt 6 ]; then >+cat <<EOF >+Usage: $0 SERVER DOMAIN USERNAME PASSWORD PREFIX SMBCLIENT >+EOF >+exit 1; >+fi >+ >+SERVER=${1} >+DOMAIN=${2} >+USERNAME=${3} >+PASSWORD=${4} >+PREFIX=${5} >+SMBCLIENT=${6} >+shift 6 >+SMBCLIENT="$VALGRIND ${SMBCLIENT}" >+ADDARGS="$@" >+ >+incdir=`dirname $0`/../../../testprogs/blackbox >+. $incdir/subunit.sh >+ >+failed=0 >+ >+# Test listing a share with valid users succeeds >+test_dropbox() >+{ >+ local filename="wurst.$$" >+ local filename_path="$PREFIX/$filename" >+ >+ local tmpfile=$PREFIX/smbclient.in.$$ >+ >+ echo "wurstbar" > $filename_path >+ >+ cat > $tmpfile <<EOF >+lcd $PREFIX >+cd dirmode733 >+put $filename >+quit >+EOF >+ >+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT -U$USERNAME%$PASSWORD //$SERVER/$1 $ADDARGS < $tmpfile 2>&1' >+ eval echo "$cmd" >+ out=`eval $cmd` >+ ret=$? >+ rm -f $tmpfile >+ >+ if [ $ret != 0 ] ; then >+ echo "$out" >+ echo "failed accessing share $ret" >+ >+ return 1 >+ fi >+ rm -f $filename_path >+ >+ share_filename="$PREFIX/$ENVNAME/share/$1/dirmode733/$filename" >+ if [ ! -r "$share_filename" ]; then >+ echo "Failed to drop file $filename" >+ return 1 >+ fi >+ content=$(<$share_filename) >+ if [ "$content" != "wurstbar" ]; then >+ echo "Invalid file content: $content" >+ return 1 >+ fi >+ >+ return 0 >+} >+ >+testit "dropbox dirmode 0733" \ >+ test_dropbox dropbox || \ >+ failed=`expr $failed + 1` >+ >+exit $failed >diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py >index 2260699931f..240674e21f8 100755 >--- a/source3/selftest/tests.py >+++ b/source3/selftest/tests.py >@@ -358,6 +358,7 @@ for env in ["fileserver"]: > plantestsuite("samba3.blackbox.smbcquotas", env, [os.path.join(samba3srcdir, "script/tests/test_smbcquota.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbcquotas]) > plantestsuite("samba3.blackbox.valid_users", env, [os.path.join(samba3srcdir, "script/tests/test_valid_users.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3]) > plantestsuite("samba3.blackbox.force_create_mode", env, [os.path.join(samba3srcdir, "script/tests/test_force_create_mode.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$PREFIX', smbclient3]) >+ plantestsuite("samba3.blackbox.dropbox", env, [os.path.join(samba3srcdir, "script/tests/test_dropbox.sh"), '$SERVER', '$DOMAIN', 'gooduser', '$PASSWORD', '$PREFIX', smbclient3]) > plantestsuite("samba3.blackbox.offline", env, [os.path.join(samba3srcdir, "script/tests/test_offline.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/offline', smbclient3]) > plantestsuite("samba3.blackbox.shadow_copy2.NT1", env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3, '-m', 'NT1']) > plantestsuite("samba3.blackbox.shadow_copy2.SMB3", env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3, '-m', 'SMB3']) >-- >2.25.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14279
:
15788
|
15789
|
15790