-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle hash characters (#) in netrc fields #8109
base: main
Are you sure you want to change the base?
Conversation
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
@swift-ci test windows |
Is there a reference implementation or standard detailing the specific format so we can ensure we're compliant with that? |
@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. |
@swift-ci please test macOS self hosted |
@swift-ci please test Windows |
I deleted some "please test" comments; didn't realize that'd appear as "plemarquand deleted a comment". Not trying to rewrite history here 😅 |
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