Bug 4978 - Store DOS Attributes fails when copying folders
Summary: Store DOS Attributes fails when copying folders
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.23c
Hardware: x86 Windows XP
: P3 critical
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
: 4385 (view as bug list)
Depends on:
Reported: 2007-09-17 12:32 UTC by Francis Kelly
Modified: 2007-11-12 12:50 UTC (History)
2 users (show)

See Also:

Patch (912 bytes, patch)
2007-09-27 18:30 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Kelly 2007-09-17 12:32:42 UTC
Our samba server has been configured with the "Store DOS Attributes" option for a some time now (instead of the old x bit mapping method). However, I was doing some file admin tasks today and discovered a serious problem...

When accessing samba shares using Windows Explorer, I noticed that *folder* archive, system and hidden attributes are *lost* after a copy operation! I know my setup is fine as I can manually change these flags using the Windows Explorer folder property dialog. This problem also rears its ugly head when running batch files containing XCOPY /s commands so it is not just a Windows Explorer issue.

File attributes seem to copy okay so I would focus attention on *folders* only. We still have an old NT server on-hand and it does *not* have this problem.

Is it possible that this bug is a throwback to the x-bit mapping method which only worked for files (not folders). Perhaps when the EA mechanism was introduced, someone forgot to modify the "folder copy/create" routine which was previously expected to disregard *folder* attributes. I know nothing about the underlying SMB/CIFS protocol so this is just a wild guess....sorry if I'm way off the mark.

To put this bug in context, it is now pretty common practice to hide application folders on Windows shares to prevent accidental deletion of critical files to which users must have write access. Our payroll application also expects faithful behaviour vis-a-vis the archive flag. It is simply not practical to have to go around fixing these folder flags manually.

We use Debian Etch with Samba 3.0.23 and Windows XP clients and, apart from this particular problem, we have a very reliable setup.
Comment 1 Jeremy Allison 2007-09-27 18:30:32 UTC
Created attachment 2931 [details]
Comment 2 Jeremy Allison 2007-09-27 18:31:13 UTC
Patch attached. Will be fixed in 3.0.x (next release) and 3.2.0 and beyond.
Thanks !
Comment 3 Francis Kelly 2007-09-28 05:46:01 UTC
(In reply to comment #2)
> Patch attached. Will be fixed in 3.0.x (next release) and 3.2.0 and beyond.
> Thanks !
> Jeremy.

Thanks for quick action, Jeremy.
BTW, This may a duplicate of https://bugzilla.samba.org/show_bug.cgi?id=4385

As a temporary workaround until fix arrives, I would suggest using WinZip, whose compress and extract phases preserve folder attributes (but watch out for folders starting with a dot, which XP's bundled version of WinZip ignores!). If you have convenient access to the Samba server, use a recent version of the star utility (by Jorg Schilling) in -copy mode with the -p and -xattr options.
Comment 4 Jeremy Allison 2007-11-12 12:50:36 UTC
*** Bug 4385 has been marked as a duplicate of this bug. ***