ftpd returns 0 for all timestamps #1688
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1688
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It appears that the FTP server, unlike the SFTP server, always returns Jan 1 1970 for all timestamps.
Attachment fix_ftpd_mtime.dpatch (85756 bytes) added
That just fixes the modified time. The underlying Twisted implementation doesn't handle create or last access times.
lebek: thank you for the patch! It needs a unit test before we can commit it to trunk. Would you be willing to write on?
Eh, ignore the comment on that attachment.
Attachment fix_ftpd_size_type.dpatch (85633 bytes) added
fix_ftpd_mtime.dpatch
is obsolete,fix_ftpd_mtime_with_unit_test.dpatch
andfix_ftpd_size_type.dpatch
should be applied together.ftpd return 0 for all timestampsto ftpd returns 0 for all timestampsThese look excellent, thanks. Comments:
expected_root
, use a class attribute, e.g.self.FALL_OF_THE_BERLIN_WALL
.if name not in children: raise [NoSuchChildError](wiki/NoSuchChildError)(name)
" in_modifier
is not covered, and not needed (it's ok to let it raise aKeyError
onchildrenname
)."linkmotime"
is in the metadata is not tested. (I saw this by looking at the test coverage [*] and seeing that the relevant line "value = metadata["tahoe"]["linkmotime"]
" of source:src/allmydata/frontends/ftpd.py was not run. Of course many other lines offtpd.py
are also not tested yet, but this is a line added by the fix.)expected_root
saying that the timestamp is expected to be 0 if no timestamp metadata is present.[*] wiki/HowToWriteTests , which is currently being written, will describe how to generate test coverage reports.
Attachment fix_ftpd_mtime_with_unit_test.dpatch (90334 bytes) added
------WebKitFormBoundarytFYJYBMb7621074p
Content-Disposition: form-data; name="replace"
on
Thanks for the review davidsarah.
Replying to davidsarah:
Done, also added a
self.TURN_OF_MILLENIUM
in order to differentiate the output in the case where bothmtime
andlinkmotime
are set.Agreed.
Fixed.
I have added a note to #512.
Done.
Excellent! Good tests.
Note that fix_ftpd_size_type.dpatch is equivalent to warner's patch on #680, which we dithered about applying for three years
because of an incompatibility with one FTP client, curlftpfsbecause we misunderstood a different bug exposed by the fix. We eventually decided to apply it, but then missed the 1.9.0 deadline.Fixed by changeset:14a50f258a0cb249, changeset:be1fd9d2b501ade9 and changeset:7f6ee7e9180377bc.
with a pyflakes fix in changeset:74cfa65f0d35ea12.