summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-03-11 12:37:01 -0700
committerJeremy Allison <jra@samba.org>2008-03-11 12:37:01 -0700
commit380fcfa60047e0f886ce9fdf35f304427891a7d8 (patch)
tree05205b144029111733f29f3b6e0b236ec02217fd /source3/smbd
parent3634d987840bd3ea3e679e02500fc76bb974818f (diff)
downloadsamba-380fcfa60047e0f886ce9fdf35f304427891a7d8.tar.gz
samba-380fcfa60047e0f886ce9fdf35f304427891a7d8.tar.bz2
samba-380fcfa60047e0f886ce9fdf35f304427891a7d8.zip
Fix S3 to pass the test_raw_oplock_exclusive3 test.
Jeremy. (This used to be commit 028302fac53083d66c969b876db1d831e53b8e35)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/open.c5
-rw-r--r--source3/smbd/trans2.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index cc78503379..0cc48c4f1c 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1366,7 +1366,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
se_map_generic(&access_mask, &file_generic_mapping);
open_access_mask = access_mask;
- if (flags2 & O_TRUNC) {
+ if ((flags2 & O_TRUNC) || (oplock_request & FORCE_OPLOCK_BREAK_TO_NONE)) {
open_access_mask |= FILE_WRITE_DATA; /* This will cause oplock breaks. */
}
@@ -1378,7 +1378,8 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
* mean the same thing under DOS and Unix.
*/
- if (access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) {
+ if ((access_mask & (FILE_WRITE_DATA | FILE_APPEND_DATA)) ||
+ (oplock_request & FORCE_OPLOCK_BREAK_TO_NONE)) {
/* DENY_DOS opens are always underlying read-write on the
file handle, no matter what the requested access mask
says. */
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 008ffed5a1..716f94f661 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4930,7 +4930,7 @@ static NTSTATUS smb_set_file_size(connection_struct *conn,
}
status = open_file_ntcreate(conn, req, fname, psbuf,
- FILE_WRITE_DATA,
+ FILE_READ_ATTRIBUTES|FILE_WRITE_ATTRIBUTES,
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
FILE_OPEN,
0,