ftp "ls" command is broken #2394
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#2394
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
While testing the fix for #2388, I noticed that FTP's "ls" command is broken. Apparently it was broken in 1.10.0 too, so I'm marking this as a release-blocking regression. I suspect it has to do with a change in Twisted, though, so maybe it worked at one point and we just got caught by an API change.
twistd.log:
I'm guessing this involves
allmydata.frontends.ftpd.Handler._populate_row
, where it returns a fake (int)0600
as the "permissions" key for all rows. I'm further guessing that Twisted's changed the API to require some sort of Permissions object.We need to check the range of Twisteds with which we claim compatibility, look at the variety of
ftp.IFTPShell
interfaces required by that set, and find a way to be compatible with all of them.This looks like it might be due to https://twistedmatrix.com/trac/changeset/42473/trunk/twisted/protocols/ftp.py, which changed the permissions to be represented as a
twisted.python.filepath.Permissions
object.Yeah, I think that's it. Twisted-14.0.2 expected an int, Twisted-15.0.0 expects a
Permissions
(and the docstring is still out of date: https://twistedmatrix.com/trac/ticket/7833).I don't see any clean way to test which version of Twisted is calling us, so I think I'm going to use an ugly hack. The old Twisted uses this function to render the integer mode value (https://github.com/twisted/twisted/blob/twisted-14.0.2/twisted/protocols/ftp.py#L428):
and the new Twisted uses this (https://github.com/twisted/twisted/blob/twisted-15.0.0/twisted/protocols/ftp.py#L464)
So I'm thinking we create a subclass of
Permissions
that overrides the*and*
operator to return an int for the first form, but has a.shorthand()
for the second form.Evil! :-)
Hrm, we support back to Twisted-11.0.0 (on windows), which didn't have
Permissions
(it was introduced in 11.1.0).(https://github.com/tahoe-lafs/tahoe-lafs/pull/148) has a branch for review. The evil hack seems to work, but if someone could also test it on a box with Twisted-11.0.0 (which will require windows, I think), I'd appreciate it.
We decided to simplify the hack by requiring Twisted >= 11.1.0 on Windows. This also simplifies the test in
test_ftp.test_list
, because we don't need to account for the permissions value being either anIntishPermissions
or anint
.Landed in d7b763c