[PATCH 1/2] smbd: Also handle ucf create mode for FILE_OVERWRITE_IF.
Andreas Schneider
asn at samba.org
Tue Dec 3 05:20:16 MST 2013
If FILE_OVERWRITE_IF is set and the file doesn't exist it will create
it. So we need to handle it too.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297
---
source3/smbd/nttrans.c | 3 ++-
source3/smbd/reply.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index e901ff2..20d70bf 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -538,7 +538,8 @@ void reply_ntcreate_and_X(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- (create_disposition == FILE_CREATE)
+ ((create_disposition == FILE_CREATE) ||
+ (create_disposition == FILE_OVERWRITE_IF))
? UCF_CREATING_FILE : 0,
NULL,
&smb_fname);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index ce1a127..6d9e0ed 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2086,7 +2086,8 @@ void reply_open_and_X(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- (create_disposition == FILE_CREATE)
+ ((create_disposition == FILE_CREATE) ||
+ (create_disposition == FILE_OVERWRITE_IF))
? UCF_CREATING_FILE : 0,
NULL,
&smb_fname);
--
1.8.5
More information about the samba-technical
mailing list