From b0cbd1a0282e4fc31e46406ca873e074b7b8ade3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 23 Nov 2009 10:26:48 -0800 Subject: [PATCH] Fix bug #6898 - Samba duplicates file content on appending Clients using a Windows open call should not be able to set FILE_FLAG_POSIX_SEMANTICS in an open. Jeremy. --- source/smbd/nttrans.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c index 0bd37a5..002f162 100644 --- a/source/smbd/nttrans.c +++ b/source/smbd/nttrans.c @@ -418,6 +418,11 @@ void reply_ntcreate_and_X(struct smb_request *req) flags = IVAL(req->inbuf,smb_ntcreate_Flags); access_mask = IVAL(req->inbuf,smb_ntcreate_DesiredAccess); file_attributes = IVAL(req->inbuf,smb_ntcreate_FileAttributes); + /* + * Bug #6898 - clients using Windows opens should + * never be able to set this attribute. + */ + file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS; share_access = IVAL(req->inbuf,smb_ntcreate_ShareAccess); create_disposition = IVAL(req->inbuf,smb_ntcreate_CreateDisposition); create_options = IVAL(req->inbuf,smb_ntcreate_CreateOptions); @@ -855,6 +860,11 @@ static void call_nt_transact_create(connection_struct *conn, flags = IVAL(params,0); access_mask = IVAL(params,8); file_attributes = IVAL(params,20); + /* + * Bug #6898 - clients using Windows opens should + * never be able to set this attribute. + */ + file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS; share_access = IVAL(params,24); create_disposition = IVAL(params,28); create_options = IVAL(params,32); -- 1.5.4.3