[Samba] copying over an existing file when not owner

Dragan Krnic dkrnic at lycos.com
Wed Aug 25 10:44:19 GMT 2004


SuSE 8.2/Samba 3.0.4-SerNet-SuSE

One expects file's owner and date to be preserved
when copying a file to an SMB share. But if a file
with the same name is already there there are two
different ways as to who will ultimately own the
new file and what date will be stamped depending
upon whether the file belongs to the copier or to
someone else.

If I try to copy a file to a samba share which 
already contains an earlier version of the same
file, the file will still belong to me and the
date will be the date of the source file.

But if I copy a file over an existing homonymous
file which belongs to someone else, then the file
fill still belong to that other user but the date
will be the date at the moment of copying.

I've noticed that in both cases an overwritten
file keeps the same i-Node number (xfs), which is
a little unexpected. I'd expect the old file to be 
deleted and a new one created but perhaps 
accidentally it's always the same free i-Node 
which gets assigned to it.

Is there a way to correct this behaviour?

I mean, if a file with the same name gets overwritten
by copying it should belong to the copier and carry 
its original modification date, not the update time.



More information about the samba mailing list