Repository navigation
Conversation
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.
There was a problem hiding this comment.
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.
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. |
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.