[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Tue Jun 5 00:21:03 MDT 2012
The branch, master has been updated
via 07fc59f Tests for bug #8972 - Add permission checks to run_simple_posix_open_test().
via 27bb016 Tests for bug #8972 - run the POSIX tests against the posix_share.
via f57ca68 Tests for bug #8972 - Add a posix_share definition to s4 so we can do raw posix permissions checks.
via acab344 Tests for bug #8972 - Add a posix_share definition to s3 so we can do raw posix permissions checks.
from d6cd48f wintest: Fix test-s3.py to use smbclient3 under the name smbclient
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 07fc59f78d816c4496623cc37026b82fd6b0bed3
Author: Jeremy Allison <jra at samba.org>
Date: Mon Jun 4 20:45:34 2012 -0700
Tests for bug #8972 - Add permission checks to run_simple_posix_open_test().
This requires a share with :
create mask = 0777
force create mode = 0
directory mask = 0777
force directory mode = 0
set so we don't mess with requested permissions.
Autobuild-User: Jeremy Allison <jra at samba.org>
Autobuild-Date: Tue Jun 5 08:20:03 CEST 2012 on sn-devel-104
commit 27bb01691ca71854ba146fb62b1114e6b612f562
Author: Jeremy Allison <jra at samba.org>
Date: Mon Jun 4 20:44:56 2012 -0700
Tests for bug #8972 - run the POSIX tests against the posix_share.
commit f57ca68b1c26d2a93de4a6dc415817b7babcd87f
Author: Jeremy Allison <jra at samba.org>
Date: Mon Jun 4 20:44:08 2012 -0700
Tests for bug #8972 - Add a posix_share definition to s4 so we can do raw posix permissions checks.
commit acab34484718780dea8818ac0be5d6db78a06275
Author: Jeremy Allison <jra at samba.org>
Date: Mon Jun 4 20:43:09 2012 -0700
Tests for bug #8972 - Add a posix_share definition to s3 so we can do raw posix permissions checks.
-----------------------------------------------------------------------
Summary of changes:
selftest/target/Samba3.pm | 9 +++++++++
selftest/target/Samba4.pm | 8 ++++++++
source3/selftest/tests.py | 10 ++++++++--
source3/torture/torture.c | 27 +++++++++++++++++++++++++++
4 files changed, 52 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 098f532..a84b4e1 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -984,6 +984,15 @@ sub provision($$$$$$)
comment = smb username is [%U]
create mask = 777
force create mode = 777
+[posix_share]
+ path = $shrdir
+ comment = smb username is [%U]
+ create mask = 0777
+ force create mode = 0
+ directory mask = 0777
+ force directory mode = 0
+ vfs objects = $vfs_modulesdir_abs/xattr_tdb.so
+
[print\$]
copy = tmp
";
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 97cdbf2..954cf9c 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -745,6 +745,14 @@ sub provision($$$$$$$$)
create mask = 777
force create mode = 777
+[posix_share]
+ path = $ctx->{share}
+ read only = no
+ create mask = 0777
+ force create mode = 0
+ directory mask = 0777
+ force directory mode = 0
+
[test1]
path = $ctx->{share}/test1
read only = no
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index c131ca2..0d3bf04 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -85,8 +85,7 @@ tests=[ "FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7",
"OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "PROPERTIES", "W2K",
"TCON2", "IOCTL", "CHKPATH", "FDSESS", "CHAIN1", "CHAIN2",
"CHAIN3",
- "GETADDRINFO", "POSIX", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
- "POSIX-APPEND",
+ "GETADDRINFO", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
"CASE-INSENSITIVE-CREATE", "SMB2-BASIC", "NTTRANS-FSCTL", "SMB2-NEGPROT",
"CLEANUP1",
"CLEANUP2",
@@ -97,6 +96,13 @@ for t in tests:
plantestsuite("samba3.smbtorture_s3.crypt(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
plantestsuite("samba3.smbtorture_s3.plain(dc).%s" % t, "dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
+posix_tests=[ "POSIX", "POSIX-APPEND"]
+
+for t in posix_tests:
+ plantestsuite("samba3.smbtorture_s3.plain(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
+ plantestsuite("samba3.smbtorture_s3.crypt(s3dc).%s" % t, "s3dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
+ plantestsuite("samba3.smbtorture_s3.plain(dc).%s" % t, "dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/posix_share', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
+
env = "s3dc:local"
t = "CLEANUP3"
plantestsuite("samba3.smbtorture_s3.plain(%s).%s" % (env, t), env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', binpath('smbtorture3'), "", "-l $LOCAL_PATH"])
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 1fc80fe..08294e6 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -5402,6 +5402,13 @@ static bool run_simple_posix_open_test(int dummy)
goto out;
}
+ /* Ensure st_mode == 0600 */
+ if ((sbuf.st_ex_mode & 07777) != 0600) {
+ printf("posix_open - bad permissions 0%o != 0600\n",
+ (unsigned int)(sbuf.st_ex_mode & 07777));
+ goto out;
+ }
+
/* Test ftruncate - set file size back to zero. */
status = cli_ftruncate(cli1, fnum1, 0);
if (!NT_STATUS_IS_OK(status)) {
@@ -5632,6 +5639,26 @@ static bool run_simple_posix_open_test(int dummy)
goto out;
}
+ /* Check directory opens with a specific permission. */
+ status = cli_posix_mkdir(cli1, dname, 0700);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("POSIX mkdir of %s failed (%s)\n", dname, nt_errstr(status));
+ goto out;
+ }
+
+ /* Ensure st_mode == 0700 */
+ status = cli_posix_stat(cli1, dname, &sbuf);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("stat failed (%s)\n", nt_errstr(status));
+ goto out;
+ }
+
+ if ((sbuf.st_ex_mode & 07777) != 0700) {
+ printf("posix_mkdir - bad permissions 0%o != 0700\n",
+ (unsigned int)(sbuf.st_ex_mode & 07777));
+ goto out;
+ }
+
printf("Simple POSIX open test passed\n");
correct = true;
--
Samba Shared Repository
More information about the samba-cvs
mailing list