mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 02:01:31 +00:00
SFTP: possible fix for metadata times being shown as the epoch.
This commit is contained in:
parent
c9984c40e9
commit
2dcb62de90
@ -236,14 +236,13 @@ def _populate_attrs(childnode, metadata, size=None):
|
||||
if metadata.get('no-write', False):
|
||||
perms &= S_IFDIR | S_IFREG | 0555 # clear 'w' bits
|
||||
|
||||
# see webapi.txt for what these times mean
|
||||
# See webapi.txt for what these times mean.
|
||||
# We would prefer to omit atime, but SFTP version 3 can only
|
||||
# accept mtime if atime is also set.
|
||||
if 'linkmotime' in metadata.get('tahoe', {}):
|
||||
attrs['mtime'] = _to_sftp_time(metadata['tahoe']['linkmotime'])
|
||||
attrs['mtime'] = attrs['atime'] = _to_sftp_time(metadata['tahoe']['linkmotime'])
|
||||
elif 'mtime' in metadata:
|
||||
# We would prefer to omit atime, but SFTP version 3 can only
|
||||
# accept mtime if atime is also set.
|
||||
attrs['mtime'] = _to_sftp_time(metadata['mtime'])
|
||||
attrs['atime'] = attrs['mtime']
|
||||
attrs['mtime'] = attrs['atime'] = _to_sftp_time(metadata['mtime'])
|
||||
|
||||
if 'linkcrtime' in metadata.get('tahoe', {}):
|
||||
attrs['createtime'] = _to_sftp_time(metadata['tahoe']['linkcrtime'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user