From 4973287d50e0653d053eef6061f4d8d4b15d312a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 23 Nov 2009 10:29:01 -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 920b0ec..328449b 100644 --- a/source/smbd/nttrans.c +++ b/source/smbd/nttrans.c @@ -452,6 +452,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); @@ -897,6 +902,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