cp -p fails to preserve time

Rungta, Vandana vrungta at amazon.com
Tue Jul 31 20:39:07 UTC 2018


Windows behaves the same way as Samba.  If mounted from a Linux client with vers=3.0 cp -p does NOT preserve time, if mounted with vers=1.0 cp -p preserves time.

´╗┐On 7/31/18, 11:43 AM, "Jeremy Allison" <jra at samba.org> wrote:

    On Tue, Jul 31, 2018 at 05:56:32PM +0000, Rungta, Vandana wrote:
    > Hello,
 
    > 
    > cp   -p   <file>  <smbshare>/<destfile>
    > 
    > fails to preserve the time on the copied file, when we send the request from a
    > Linux client that mounts a Samba share on a Linux server because
    > update_write_time_on_close resets the dest file time to the current time.
    >
    > BTW:  If the share is mounted using vers=1.0 time is preserved.
    > 
    
    What happens if you do the same set of operations to a Windows
    server ? Does the same thing happen ? Once we know what
    Windows does in this situation we can code up a client
    test and then ensure smbd passes it.
    
    My gut feeling is that the setinfo on the second handle
    should overwrite the 'update write time on close' behavior,
    but tests will show what the "correct" behavior is.
    
    Jeremy.
    
    



More information about the samba-technical mailing list