From 56cde8da31a502945a6641858e6f9ee1f013eed6 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 12 Feb 2020 16:30:01 +0100 Subject: [PATCH 1/3] s3:tests: Add smbclient test for 'force create mode = 0664' Signed-off-by: Andreas Schneider --- selftest/target/Samba3.pm | 8 +++ .../script/tests/test_force_create_mode.sh | 72 +++++++++++++++++++ source3/selftest/tests.py | 1 + 3 files changed, 81 insertions(+) create mode 100755 source3/script/tests/test_force_create_mode.sh diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 0c9adcc76fd..99230a6429c 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1071,6 +1071,14 @@ sub setup_fileserver path = $share_dir comment = force group test # force group = everyone + +[create_mode_664] + path = $share_dir + comment = smb username is [%U] + create mask = 0644 + force create mode = 0664 + vfs objects = dirsort + [homes] comment = Home directories browseable = No diff --git a/source3/script/tests/test_force_create_mode.sh b/source3/script/tests/test_force_create_mode.sh new file mode 100755 index 00000000000..d5948b239b1 --- /dev/null +++ b/source3/script/tests/test_force_create_mode.sh @@ -0,0 +1,72 @@ +#!/bin/sh +# +# Blackbox test for 'force create mode' +# + +if [ $# -lt 7 ]; then +cat < $filename_path + + cat > $tmpfile < Date: Thu, 13 Feb 2020 13:48:17 +0100 Subject: [PATCH 2/3] s3:tests: Add test for a dropbox with dir mode 0733 Note: This is currently broken in Samba and a fix will require a rewrite of smbd with openat() and fchdir(). Signed-off-by: Andreas Schneider --- selftest/target/Samba3.pm | 7 +++ source3/script/tests/test_dropbox.sh | 88 ++++++++++++++++++++++++++++ source3/selftest/tests.py | 1 + 3 files changed, 96 insertions(+) create mode 100755 source3/script/tests/test_dropbox.sh diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 99230a6429c..4876c158e0f 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 diff --git a/source3/script/tests/test_dropbox.sh b/source3/script/tests/test_dropbox.sh new file mode 100755 index 00000000000..dd1267c9325 --- /dev/null +++ b/source3/script/tests/test_dropbox.sh @@ -0,0 +1,88 @@ +#!/bin/sh +# +# Blackbox test for valid users. +# + +if [ $# -lt 6 ]; then +cat < $filename_path + + # Create dropbox directory and set permissions + mkdir -p $dropbox_path + chmod 0333 $dropbox_path + + cat > $tmpfile < Date: Fri, 14 Feb 2020 17:50:39 +0100 Subject: [PATCH 3/3] SQ Don't cd into the directory --- source3/script/tests/test_dropbox.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source3/script/tests/test_dropbox.sh b/source3/script/tests/test_dropbox.sh index dd1267c9325..474a40f9d7b 100755 --- a/source3/script/tests/test_dropbox.sh +++ b/source3/script/tests/test_dropbox.sh @@ -42,8 +42,7 @@ test_dropbox() cat > $tmpfile <