Fix bug #6898 - Samba duplicates file content on appending
authorJeremy Allison <jra@samba.org>
Mon, 23 Nov 2009 18:09:47 +0000 (10:09 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 23 Nov 2009 18:09:47 +0000 (10:09 -0800)
Clients using a Windows open call should not be able to set
FILE_FLAG_POSIX_SEMANTICS in an open.
Jeremy.

source3/smbd/nttrans.c

index bacb9cb0b2fdaa620ea3fa9f7cb2bd8bffe1f02f..5c6d78089d71077f2cea4d44c32130f7500e3138 100644 (file)
@@ -418,6 +418,11 @@ void reply_ntcreate_and_X(struct smb_request *req)
        flags = IVAL(req->vwv+3, 1);
        access_mask = IVAL(req->vwv+7, 1);
        file_attributes = IVAL(req->vwv+13, 1);
+       /*
+        * Bug #6898 - clients using Windows opens should
+        * never be able to set this attribute.
+        */
+       file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS;
        share_access = IVAL(req->vwv+15, 1);
        create_disposition = IVAL(req->vwv+17, 1);
        create_options = IVAL(req->vwv+19, 1);
@@ -913,6 +918,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);