[Samba] Strange behaviour regarding timestamps when copying files
Peter Woelfel
pwoelfel at leistritz.com
Tue Apr 29 14:38:38 GMT 2008
Hi all,
we observed a strange effect when copying an file within a samba
share: Both atime an mtime of the target file are set to the mtime
of the original file. The atime of the original file is updated to
the current time.
1. Status of the original file:
# stat test.txt
File: `test.txt'
Size: 3 Blocks: 8 IO Block: 4096 regular file
Device: 811h/2065d Inode: 58721415 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 609/ testuser) Gid: ( 800/testgroup)
Access: 2008-04-25 11:10:38.876386411 +0200
Modify: 2008-04-24 13:31:52.554637383 +0200
Change: 2008-04-24 13:49:26.615046291 +0200
2. Copying the file using a Windows XP SP2 box:
X:\> copy test.txt test2.txt
3. Status of the target file:
# stat test2.txt
File: `test2.txt'
Size: 3 Blocks: 8 IO Block: 4096 regular file
Device: 811h/2065d Inode: 58721425 Links: 1
Access: (0775/-rwxrwxr-x) Uid: ( 609/ testuser) Gid: ( 800/testgroup)
Access: 2008-04-24 13:31:52.000000000 +0200
Modify: 2008-04-24 13:31:52.000000000 +0200
Change: 2008-04-25 11:10:38.881383030 +0200
When copying the same file on the server with 'cp', all timestamps
of the target file are updated.
# cp test.txt test3.txt
# stat test.txt
File: `test.txt'
Size: 3 Blocks: 8 IO Block: 4096 regular file
Device: 811h/2065d Inode: 58721415 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 609/ testuser) Gid: ( 800/testgroup)
Access: 2008-04-29 10:39:42.676283318 +0200
Modify: 2008-04-24 13:31:52.554637383 +0200
Change: 2008-04-24 13:49:26.615046291 +0200
# stat test3.txt
File: `test3.txt'
Size: 3 Blocks: 8 IO Block: 4096 regular file
Device: 811h/2065d Inode: 58721426 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2008-04-29 10:39:42.675283834 +0200
Modify: 2008-04-29 10:39:42.675283834 +0200
Change: 2008-04-29 10:39:42.675283834 +0200
We verified this behaviour with several samba versions beginning
with 2.2.3 up to 3.0.26. This is the minimalistic smb.conf we used
for testing (with samba 3.x):
[global]
workgroup = TEST
passdb backend = ldapsam:ldaps://172.16.112.1
preferred master = No
local master = No
domain master = No
ldap admin dn = cn=admin,o=leistritz
ldap suffix = o=leistritz
printing = bsd
[data]
comment = data
path = /data
read only = No
A Windows Server behaves differently:
here, only the atime of the target file is updated on copy, along
with the creation time which sadly is not available on Unix.
One of our applications appears to get confused by this behaviour,
so we are looking for a way to mimic the MS Windows handling of
timestamps (or at least how Unix does it).
Thanks,
--
| LEISTRITZ Aktiengesellschaft Tel.: +49 (0) 911 4306 559
| Peter Wölfel, EDV-Abteilung (ITO) Fax: +49 (0) 911 4306 685
| Markgrafenstraße 29-39 eMail: pwoelfel at leistritz.com
| D-90459 Nürnberg Web: http://www.leistritz.com
--
LEISTRITZ Aktiengesellschaft
Markgrafenstr. 29-39, D-90459 Nuernberg
Telefon/Phone: +49 911 4306-0 Fax: +49 911 4306-420
Internet: www.leistritz.com
Vorsitzender des Aufsichtsrates/
Chairman of the Supervisory Board:
Dipl.-Ing. Helmuth Schaak
Vorstand/Board of Directors:
Dipl.-Kfm. Dr. Heiko Neumann
Dr.-Ing. Michael Radke
Dr.-Ing. Ernst Rothstein
Sitz der Gesellschaft/Registered Office: Nuernberg
Handelsregister/Commercial Register: HRB 7679, Registergericht Nuernberg
USt-IdNr./VAT-No.: DE133500743 St.-Nr.: 241/115/90148
More information about the samba
mailing list