Skip to content

ftp: fix --ftp-force-list-hidden listing the root on FRITZ!Box - fixes #10324 - #10380

Open
sathvik8317 wants to merge 1 commit into
rclone:masterfrom
sathvik8317:ftp-force-list-hidden-cwd
Open

sathvik8317 wants to merge 1 commit into
rclone:masterfrom
sathvik8317:ftp-force-list-hidden-cwd

Conversation

@sathvik8317

@sathvik8317 sathvik8317 commented Nov 17, 2026 •

Copy link
Copy Markdown

What does this change do?

With --ftp-force-list-hidden, rclone sends LIST -a <path>. Some servers, such as the FRITZ!Box, ignore the path after -a and list the current directory, so every directory showed the contents of the root and rclone ls nested forever.

When force_list_hidden is set, the backend now does PWD, CWD <dir>, LIST -a with no path, then CWD back to the original directory so pooled connections stay where they were. It's used by both List and findItem. Without the flag nothing changes.

The reporter confirmed the cause with curl in the issue: LIST -a <path> from the root returns the root, while CWD then LIST -a returns the folder.

Linked issue

Fixes #10324

Testing

  • TestListDirForceListHidden: a fake FTP server that ignores the path after LIST -a. It fails on master (returns the root listing) and passes with this change, and it checks the connection is back in its original directory afterwards, including when CWD fails.
  • go test ./backend/ftp/ -remote against a local rclone serve ftp, with force_list_hidden both off and on: 90 pass in each mode. The only failure is FsMkdir/FsEncoding/punctuation, which also fails on master because I ran the server on a Windows disk.
  • go build, go vet and golangci-lint are clean for backend/ftp. go test ./... is clean apart from Windows-only symlink-privilege failures in backend/local that also fail on master.
  • I couldn't run test_all against the Docker FTP servers locally. The reporter tested a build of this branch on Debian 13 against their FRITZ!Box and confirmed it fixes the listing (comment). CI passes on all platforms.

Checklist

  • This change is trivial OR it has been discussed and agreed in the linked issue.
  • I have read the contribution guidelines.
  • (If I used AI tools to help write this code) I have read and understood the AI-assisted contributions guidance, and I have tested and take ownership of this change myself.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • (Backend changes only) test_all passes for this backend and if submitting a new backend can provide a test account for the integration tester - see CONTRIBUTING.md.
  • This Pull Request is ready for review.

…rclone#10324

Some FTP servers, such as the FRITZ!Box, ignore the path after
"LIST -a" and list the current directory instead. With
--ftp-force-list-hidden this made every directory show the contents
of the root, so recursive listings nested forever.

When force_list_hidden is set, change into the directory, send
"LIST -a" with no path, then change back to the previous directory
so pooled connections stay where they were.
Copilot AI balanced review requested due to automatic review settings November 17, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@sathvik8317

Copy link
Copy Markdown
Author

The reporter tested this build on Debian 13 against their FRITZ!Box and confirmed it fixes the listing: #10324 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FTP: LSD/LS with option " --ftp-force-list-hidden" lists wrong directory structure

2 participants