Skip to content

Conversation

@plemarquand
Copy link
Contributor

Hash symbols were always treated as the beginning of a comment even if they were in the middle of a username or password. To address this require some whitespace before a hash character before a comment is parsed.

That patch also implements support for quoted fields so that passwords can contain the sequence "foo #bar" without dropping "bar" as a comment.

Issue: #8090

Hash symbols were always treated as the beginning of a comment even if
they were in the middle of a username or password. To address this
require some whitespace before a hash character before a comment is
parsed.

That patch also implements support for quoted fields so that passwords
can contain the sequence "foo #bar" without dropping "bar" as a comment.

Issue: swiftlang#8090
Issue
@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@jakepetroules
Copy link
Contributor

Is there a reference implementation or standard detailing the specific format so we can ensure we're compliant with that?

@plemarquand
Copy link
Contributor Author

@jakepetroules frustratingly, no. I went looking before picking this up and there doesn't seem to be a defined spec.

It seems like the reference implementation is generally accepted to be the Linux ftp client, however none of their documentation mentions comments.

The Python netrc library does seem to support comments, but only if they're on their own line.

Because our implementation already supports comments both on their own line and trailing declarations I think modifying our implementation to match Python's or Linux's would break the parsing of user's existing .netrc files that we successfully parse today.

@swiftlang swiftlang deleted a comment from dschaefer2 Nov 12, 2024
@swiftlang swiftlang deleted a comment from MaxDesiatov Nov 12, 2024
@swiftlang swiftlang deleted a comment from MaxDesiatov Nov 12, 2024
@plemarquand
Copy link
Contributor Author

I deleted some "please test" comments; didn't realize that'd appear as "plemarquand deleted a comment". Not trying to rewrite history here 😅

@plemarquand
Copy link
Contributor Author

@swift-ci please test macOS self hosted

@plemarquand plemarquand merged commit bdd4cfc into swiftlang:main Nov 14, 2024
5 checks passed
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.

4 participants