Using Windows 7 and Office 2K3, I'm seeing an inconsistency with Samba's DOS attribute handling when compared with a Windows server. I have enabled "store dos attributes" in my configuration. To reproduce: 1) Create a .txt file in a Samba file share. The archive bit should set. 2) Unset the archive bit. 3) Open, modify, and save the file in Microsoft Word. At this point, the archive bit should be set again on the file, but it is not. I have verified that the archive bit is set after doing the same operations against a Windows server. If I use notepad instead of Word to modify the file, the archive bit does get set properly. It looks like the problem stems from Word's usage of temporary files.
Can you attach a wireshark trace of the problem please ? Just want to make sure I can see the exact issue (just in case I have trouble repeating it). Jeremy.
Created attachment 5566 [details] Wireshark capture of modifying and saving the file from Word
Ok, spotted the bug. Should have a fix for you very shortly... Jeremy.
Created attachment 5567 [details] Test patch... Try this - should work (compiles but I haven't done a make test yet). Jeremy.
Created attachment 5568 [details] git-am patch for 3.5.2 Ok - here is a git-am simple patch for 3.5.2 - fixes the specific issue. More complete patch will be added to master. Jeremy.
Created attachment 5569 [details] git-am patch for 3.4.x. Same patch for 3.4.x. Jeremy.
From my testing, both patches get the archive bit set on modification, but they have the unfortunate side-effect of not allowing me to unset the archive bit once it's already been set.
These patches aren't quite right yet. Still working on getting the behavior right. Jeremy.
Created attachment 5570 [details] git-am format patch for 3.5.2 Ok, I think this one does the trick. We were not setting the archive bit on a newly renamed file. Jeremy.
Created attachment 5571 [details] git-am format patch for 3.5.2 Arg. Get the patch right :-). We need to do a VFS_STAT before calling dos_mode() to ensure the stat struct is filled correctly. Jeremy.
Created attachment 5572 [details] git-am format patch for 3.4.x. Similar patch for 3.4.x. Justin please test ! Jeremy.
Created attachment 5573 [details] git-am patch for 3.5.2 Sigh. Eventually I'll get this right. I need to set the "newfile" flag to file_set_dosmode() - if I don't I break the notify tests on rename of directories. Jeremy.
Created attachment 5574 [details] git-am format patch for 3.4.x Same fix to the patch (set newfile = true) for 3.4.x. Jeremy.
Ok, finally everything passes "make test". If I get confirmation from Justin I'll apply to master and get these reviewed and into 3.5.2 and 3.4.x. Jeremy.
These most recent patches now work perfectly for me in all my test cases. Thanks!
Comment on attachment 5573 [details] git-am patch for 3.5.2 Requesting review by volker so we can get this into 3.5.2 on freeze day :-).
Comment on attachment 5574 [details] git-am format patch for 3.4.x Requesting review by vl...
Comment on attachment 5573 [details] git-am patch for 3.5.2 Ack, but it's too late for 3.5.2, timezones killed it...
Re-assigning to Karolin...
It's still the same day here (March 31st) so I'm hoping Karolin will see fit to consider this one (it's safer than some of the stuff that went into 3.5.2 today :-). Plus it needs to go into 3.4.x too... Jeremy.
Pushed to v3-5-test and v3-4-test. Closing out bug report. Thanks!