svn commit: samba r3180 - in branches/SAMBA_4_0/source: ntvfs/posix
script/tests torture/raw
tridge at samba.org
tridge at samba.org
Mon Oct 25 02:36:13 GMT 2004
Author: tridge
Date: 2004-10-25 02:36:12 +0000 (Mon, 25 Oct 2004)
New Revision: 3180
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3180&nolog=1
Log:
- basic support for SEC_RIGHT_MAXIMUM_ALLOWED in pvfs
- RAW-CONTEXT test now passes
Modified:
branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c
branches/SAMBA_4_0/source/script/tests/test_posix.sh
branches/SAMBA_4_0/source/torture/raw/context.c
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c 2004-10-25 01:56:29 UTC (rev 3179)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c 2004-10-25 02:36:12 UTC (rev 3180)
@@ -283,6 +283,10 @@
return NT_STATUS_CANNOT_DELETE;
}
+ if (access_mask & SEC_RIGHT_MAXIMUM_ALLOWED) {
+ access_mask = GENERIC_RIGHTS_FILE_READ | GENERIC_RIGHTS_FILE_WRITE;
+ }
+
flags = O_RDWR;
f = talloc_p(req, struct pvfs_file);
@@ -355,7 +359,7 @@
f->lock_count = 0;
f->create_options = io->generic.in.create_options;
f->share_access = io->generic.in.share_access;
- f->access_mask = io->generic.in.access_mask;
+ f->access_mask = access_mask;
f->seek_offset = 0;
f->position = 0;
@@ -429,6 +433,14 @@
share_access = io->generic.in.share_access;
access_mask = io->generic.in.access_mask;
+ if (access_mask & SEC_RIGHT_MAXIMUM_ALLOWED) {
+ if (name->dos.attrib & FILE_ATTRIBUTE_READONLY) {
+ access_mask = GENERIC_RIGHTS_FILE_READ;
+ } else {
+ access_mask = GENERIC_RIGHTS_FILE_READ | GENERIC_RIGHTS_FILE_WRITE;
+ }
+ }
+
/* certain create options are not allowed */
if ((create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) &&
!(access_mask & STD_RIGHT_DELETE_ACCESS)) {
@@ -551,7 +563,7 @@
f->lock_count = 0;
f->create_options = io->generic.in.create_options;
f->share_access = io->generic.in.share_access;
- f->access_mask = io->generic.in.access_mask;
+ f->access_mask = access_mask;
f->seek_offset = 0;
f->position = 0;
Modified: branches/SAMBA_4_0/source/script/tests/test_posix.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/test_posix.sh 2004-10-25 01:56:29 UTC (rev 3179)
+++ branches/SAMBA_4_0/source/script/tests/test_posix.sh 2004-10-25 02:36:12 UTC (rev 3180)
@@ -36,12 +36,12 @@
tests="$tests BASE-DELETE BASE-PROPERTIES BASE-MANGLE"
tests="$tests BASE-CHKPATH BASE-SECLEAK"
tests="$tests RAW-QFSINFO RAW-QFILEINFO RAW-SFILEINFO-BUG"
-tests="$tests RAW-LOCK RAW-SEEK"
+tests="$tests RAW-LOCK RAW-SEEK RAW-CONTEXT"
soon="BASE-DIR1 BASE-DENY1 BASE-VUID BASE-OPEN BASE-DEFER_OPEN BASE-RENAME BASE-OPENATTR BASE-CHARSET"
-soon="$soon RAW-SFILEINFO RAW-SEARCH RAW-CLOSE RAW-OPEN RAW-MKDIR RAW-OPLOCK RAW-NOTIFY RAW-MUX RAW-IOCTL"
-soon="$soon RAW-CHKPATH RAW-UNLINK RAW-READ RAW-WRITE RAW-CONTEXT RAW-RENAME"
+soon="$soon RAW-SFILEINFO RAW-SEARCH RAW-OPEN RAW-MKDIR RAW-OPLOCK RAW-NOTIFY RAW-MUX RAW-IOCTL"
+soon="$soon RAW-CHKPATH RAW-UNLINK RAW-READ RAW-WRITE RAW-RENAME RAW-CLOSE"
for t in $tests; do
if [ ! -z "$start" -a "$start" != $t ]; then
Modified: branches/SAMBA_4_0/source/torture/raw/context.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/context.c 2004-10-25 01:56:29 UTC (rev 3179)
+++ branches/SAMBA_4_0/source/torture/raw/context.c 2004-10-25 02:36:12 UTC (rev 3180)
@@ -24,24 +24,24 @@
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
- printf("(%d) Incorrect status %s - should be %s\n", \
- __LINE__, nt_errstr(status), nt_errstr(correct)); \
+ printf("(%s) Incorrect status %s - should be %s\n", \
+ __location__, nt_errstr(status), nt_errstr(correct)); \
ret = False; \
goto done; \
}} while (0)
#define CHECK_VALUE(v, correct) do { \
if ((v) != (correct)) { \
- printf("(%d) Incorrect value %s=%d - should be %d\n", \
- __LINE__, #v, v, correct); \
+ printf("(%s) Incorrect value %s=%d - should be %d\n", \
+ __location__, #v, v, correct); \
ret = False; \
goto done; \
}} while (0)
#define CHECK_NOT_VALUE(v, correct) do { \
if ((v) == (correct)) { \
- printf("(%d) Incorrect value %s=%d - should not be %d\n", \
- __LINE__, #v, v, correct); \
+ printf("(%s) Incorrect value %s=%d - should not be %d\n", \
+ __location__, #v, v, correct); \
ret = False; \
goto done; \
}} while (0)
More information about the samba-cvs
mailing list