]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix S3 to pass the test_raw_oplock_exclusive3 test.
authorJeremy Allison <jra@samba.org>
Tue, 11 Mar 2008 19:37:01 +0000 (12:37 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 11 Mar 2008 19:37:01 +0000 (12:37 -0700)
Jeremy.

source/smbd/open.c
source/smbd/trans2.c

index cc7850337900af2cf360f529b526d3fd9f38ac46..0cc48c4f1c36842633b87424be38a6669f25b68f 100644 (file)
@@ -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. */
index 008ffed5a11112663f4419b0895ecf2481943d29..716f94f661cc03fd59c73ffb329a24cdf57ccafe 100644 (file)
@@ -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,