From 047ae1974ba40f8a3e3b390f14264086c64a2005 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 28 Nov 2013 16:16:19 +0100 Subject: [PATCH] smbd: Fix a regression putting a file into a dir with perm -wx. The code calling unix_convert doesn't hanlde the return codes which has been introduced with 0150086d44e90351634a68aced1e44ad076a693c. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297 Signed-off-by: Andreas Schneider --- source3/smbd/reply.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ce1a127..4095b66 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); @@ -2097,8 +2098,14 @@ void reply_open_and_X(struct smb_request *req) ERRSRV, ERRbadpath); goto out; } - reply_nterror(req, status); - goto out; + if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_PATH_NOT_FOUND) + && (create_disposition == FILE_CREATE || + create_disposition == FILE_OVERWRITE_IF)) { + /* Gracefully create the file, this is a -wx dropbox */ + } else { + reply_nterror(req, status); + goto out; + } } status = SMB_VFS_CREATE_FILE( -- 1.8.4.3