Author: jra
Date: 2006-07-26 02:15:01 +0000 (Wed, 26 Jul 2006)
New Revision: 17248

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17248

Log:
Ensure we definately add the WRITE_DATA on O_TRUNC.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/open.c
   branches/SAMBA_3_0_23/source/smbd/open.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/open.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/open.c       2006-07-26 01:53:23 UTC (rev 
17247)
+++ branches/SAMBA_3_0/source/smbd/open.c       2006-07-26 02:15:01 UTC (rev 
17248)
@@ -1297,9 +1297,6 @@
        /* This is a nasty hack - must fix... JRA. */
        if (access_mask == MAXIMUM_ALLOWED_ACCESS) {
                open_access_mask = access_mask = FILE_GENERIC_ALL;
-               if (flags2 & O_TRUNC) {
-                       open_access_mask |= FILE_WRITE_DATA; /* This will cause 
oplock breaks. */
-               }
        }
 
        /*
@@ -1309,6 +1306,10 @@
        se_map_generic(&access_mask, &file_generic_mapping);
        open_access_mask = access_mask;
 
+       if (flags2 & O_TRUNC) {
+               open_access_mask |= FILE_WRITE_DATA; /* This will cause oplock 
breaks. */
+       }
+
        DEBUG(10, ("open_file_ntcreate: fname=%s, after mapping "
                   "access_mask=0x%x\n", fname, access_mask ));
 

Modified: branches/SAMBA_3_0_23/source/smbd/open.c
===================================================================
--- branches/SAMBA_3_0_23/source/smbd/open.c    2006-07-26 01:53:23 UTC (rev 
17247)
+++ branches/SAMBA_3_0_23/source/smbd/open.c    2006-07-26 02:15:01 UTC (rev 
17248)
@@ -1292,9 +1292,6 @@
        /* This is a nasty hack - must fix... JRA. */
        if (access_mask == MAXIMUM_ALLOWED_ACCESS) {
                open_access_mask = access_mask = FILE_GENERIC_ALL;
-               if (flags2 & O_TRUNC) {
-                       open_access_mask |= FILE_WRITE_DATA; /* This will cause 
oplock breaks. */
-               }
        }
 
        /*
@@ -1304,6 +1301,10 @@
        se_map_generic(&access_mask, &file_generic_mapping);
        open_access_mask = access_mask;
 
+       if (flags2 & O_TRUNC) {
+               open_access_mask |= FILE_WRITE_DATA; /* This will cause oplock 
breaks. */
+       }
+
        DEBUG(10, ("open_file_ntcreate: fname=%s, after mapping "
                   "access_mask=0x%x\n", fname, access_mask ));
 

Reply via email to