[Samba] Merely Opening Excel Files Increments Last-Modification date on Samba Shares

RRuegner robert at ruegner.org
Sat Apr 17 22:32:37 GMT 2004

Eric Heintzberger schrieb:

> Thank you for responding to my post. 
> As for your question, my concern is not that (as you
> put it) "the date of last modification [is] the date
> of the file". It is, rather, this:
> If today I do "cat file.txt" on a text file whose
> last-modifiation date is December 23, 2003, I would
> not expect "ls -l file.txt" to display April 17, 2004
> as the last-modification date.
> Similarly, if right now I simply open, then close an
> xls file, without saving any changes, I would not
> expect its last-modification date to change to now. 
> The last-modification date should not change as a
> result of just reading the file. There would have to
> be some writing too.    
> Are you saying that MS-Excel is designed so that
> reading an xls file in MS-excel actually writes
> changes to the file, even if the end-user does not
> save or auto-save any changes?
> Regards, 
> --- RRuegner <robert at ruegner.org> wrote:
>>Eric Heintzberger schrieb:
>>>Hello Everyone!
>>>Perhaps some of you have some advice for dealing
>>>this problem? I've done quite a bit of googling on
>>>this one, but I can't find anything useful. 
>>>Ever since I started using Samba as PDC, I have
>>>this problem: when users merely open MS-Excel
>>files on
>>>samba shares, the file's Last-Modification date 
>>>incremented to the current time. 
>>>I have seen similar behavior with MS-Word files
>>>ago when using WINNT4 as PDC, and it was caused by
>>>macro-virus, but in this case, it doesn't seem to
>>>If the same Excel file is copied to a user's local
>>>drive, the problem ceases.
>>>The problem of modifying-by-merely-opening began,
>>>think, when I  changed the PDC to samba.  
>>>I had this problem using Samba 2.7* on RedHat 7.2
>>>a year ago. I'm currently using samba 2.2.8a on
>>>FreeBSD 4.9 with a similar configuration, and I
>>>have the problem. 
>>>Is it possible to stop this problem using
>>>configuration parameters in smb.conf? 
>>>Here's my smb.conf, in case it's needed:
>>>netbios name = netbiosname
>>>workgroup = workgroup
>>>security = user
>>>domain logons = yes
>>>time server = yes
>>>server string = Samba %v on %L
>>>log file = /var/log/samba/%m.log
>>>max log size = 2000
>>>### Security Settings ###
>>>hosts allow = [omitted for this post] 127.
>>>hosts deny = ALL
>>>invalid users = root
>>>;Unreadable files shouldn't even appear
>>>;hide unreadable = yes
>>>;Prevent browsing by default
>>>browseable = no
>>>### Users and Passwords ###
>>>[omitted for this post]
>>>### Performance ###
>>>deadtime = 15
>>>getwd cache = yes
>>>lpq cache time = 45
>>>socket options = IPTOS_LOWDELAY TCP_NODELAY
>>>oplocks = yes
>>>level2 oplocks = yes
>>>#veto oplock files = /*.xls/*.XLS/
>>>### Domain ###
>>>local master = yes
>>>os level = 65
>>>domain master = yes
>>>preferred master = yes
>>>domain logons = yes
>>>logon script = %U.bat
>>>logon drive = M:
>>>logon path = \\netbiosname\profiles\%U
>>># Name Resolution
>>>wins support = yes
>>>wins proxy = yes
>>>dns proxy = yes
>>># Case
>>>preserve case = yes
>>>short preserve case = yes
>>>default case = lower
>>>case sensitive = no
>>>#Sample  Share Definition:
>>>  comment = Client Directory
>>>  path = /usr/local/samba/clients
>>>  browseable = yes
>>>  force create mode = 0664
>>>  force directory mode = 0775
>>>  force group = users
>>>  invalid users = invlink
>>>  map archive = no
>>>  printable = no
>>>  public = no
>>>  valid users = @users
>>>  writable = yes
>>>Do you Yahoo!?
>>>Yahoo! Tax Center - File online by April 15th
>>hi, theres is detailed info in the official howto
>>about ms-office,
>>at last i remember this features are by design of ms
>>office, and why 
>>should not the date of last modification be the date
>>of the file?
>>Best Regards
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25¢
> http://photos.yahoo.com/ph/print_splash
Oh i understand your problem now,
perhaps its related to stuff in the faq
otherwise i dont know more tips


MS Word with Samba Changes Owner of File
Question: “When user B saves a word document that is owned by user A the 
updated file is now owned by user B. Why is Samba doing this? How do I 
fix this?”

Answer: Word does the following when you modify/change a Word document: 
MS Word creates a NEW document with a temporary name, Word then closes 
the old document and deletes it, Word then renames the new document to 
the original document name. There is no mechanism by which Samba can in 
any way know that the new document really should be owned by the owners 
of the original file. Samba has no way of knowing that the file will be 
renamed by MS Word. As far as Samba is able to tell, the file that gets 
created is a NEW file, not one that the application (Word) is updating.

There is a work-around to solve the permissions problem. That 
work-around involves understanding how you can manage file system 
behavior from within the smb.conf file, as well as understanding how 
UNIX file systems work. Set on the directory in which you are changing 
Word documents: chmod g+s `directory_name' This ensures that all files 
will be created with the group that owns the directory. In smb.conf 
share declaration section set:

force create mode = 0660
force directory mode = 0770

These two settings will ensure that all directories and files that get 
created in the share will be read/writable by the owner and group set on 
the directory itself.

More information about the samba mailing list