Bug 6506 - SMBD server doesn't set EAs when a file is overwritten in NT_TRANSACT_CREATE
Summary: SMBD server doesn't set EAs when a file is overwritten in NT_TRANSACT_CREATE
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.3
Classification: Unclassified
Component: File services (show other bugs)
Version: 3.3.4
Hardware: x86 Windows 7
: P3 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
: 4670 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-24 18:17 UTC by Long Li
Modified: 2009-09-17 15:35 UTC (History)
2 users (show)

See Also:
vl: review+


Attachments
PAtch for master (483 bytes, patch)
2009-06-24 20:02 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Long Li 2009-06-24 18:17:56 UTC
When a client sends a NT_TRANSACT_CREATE with extended attributes in the packet, the server should store those EAs if the file is being created or overwritten. The server sets EAs in the following code snippet:

"smbd/open.c" line 3175 of 3496     

        if ((ea_list != NULL) && (info == FILE_WAS_CREATED)) {
                status = set_ea(conn, fsp, fname, ea_list);
                if (!NT_STATUS_IS_OK(status)) {
                        goto fail;
                }
        }

The code only sets the EAs when a new file is created. It should include the case where a file is being overwritten.

This was found using the Microsoft common file system test tools.
Comment 1 Jeremy Allison 2009-06-24 20:02:37 UTC
Created attachment 4348 [details]
PAtch for master

Can you let me know if this fixes the problem ? The Microsoft common file system test tools seem to be very useful, any chance of them being released ?

Cheers,

Jeremy.
Comment 2 Long Li 2009-06-25 13:47:56 UTC
Jeremy, your patch is verified. Thanks!

The common file system test tools are developed by the NTFS team. It covers all the Windows file system APIs. It is used by many groups within Microsoft for file I/O related regression tests. The SMB team is an active user of the tool.

We will talk to the NTFS team on the possible release of the test tools.

Thanks,

Long
Comment 3 Jeremy Allison 2009-06-25 15:05:44 UTC
Pushed for master. Volker, do we want this for 3.4.0 ? Seems low risk, but I'll let you assess.
Jeremy.
Comment 4 Volker Lendecke 2009-07-27 05:46:45 UTC
Didn't make it to 3.4.0, but I think this is low-risk enough for 3.4.1.

Thanks,

Volker
Comment 5 Karolin Seeger 2009-07-28 02:10:33 UTC
Pushed to v3-4-test. Will be included in 3.4.1.
Closing out bug report.

Thanks!
Comment 6 Björn Jacke 2009-09-17 15:35:33 UTC
*** Bug 4670 has been marked as a duplicate of this bug. ***