Skip to content

ftplistparser: when wildcarding, skip files with slashes - #23089

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/ftp-list-slash
Closed

bagder wants to merge 1 commit into
masterfrom
bagder/ftp-list-slash

Conversation

@bagder

@bagder bagder commented Sep 24, 2026

Copy link
Copy Markdown
Member

A real file name cannot contain a slash. Skip those.

Reported-by: Fernando Gallardo

Extend the LIST response in test 2805 to verify that it gets ignored.

A real file name cannot contain a slash. Skip those.

Reported-by: Fernando Gallardo

Extend the LIST response in test 2805 to verify that it gets ignored.
@bagder bagder added the FTP label Sep 24, 2026
@github-actions github-actions Bot added the tests label Sep 24, 2026
@bagder
bagder marked this pull request as ready for review September 24, 2026 21:55
@bagder
bagder requested a balanced review from Copilot September 24, 2026 21:57

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 review overview

🟢 Approval recommended

The focused validation is correct and covered by the existing wildcard integration test.

Review effort: Balanced
Findings: None

What changed in this PR

Prevents FTP wildcard handling from treating slash-containing LIST entries as valid filenames.

Changes:

  • Rejects filenames containing / before wildcard matching.
  • Extends test 2805’s simulated listing to verify such entries are ignored.
File Description
lib/​ftplistparser.c Filters invalid slash-containing filenames.
tests/​directories.pm Adds a regression-test listing entry containing a slash.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bagder bagder closed this in d4dc5b4 Sep 24, 2026
@bagder
bagder deleted the bagder/ftp-list-slash branch September 24, 2026 22:08
@dfandrich

Copy link
Copy Markdown
Contributor

A real file name cannot contain a slash. Skip those.

Several OSes allow a slash in a file name, and RFC 959 allows it. The OSes that allow it (I know of classic mac OS, RISC OS, Commodore DOS and CP/M) are all long obsolete, but it's certainly possible that a current FTP server could use it in synthesised file names. I'd say it's unlikely to be a real issue but I also wouldn't raise my eyebrows too high if I saw someone complain in 5 years' time after an upgrade to 8.23.0.

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

Development

Successfully merging this pull request may close these issues.

3 participants