You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?
Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.
the # symbol in the password causes it to be not read entirely, it gets processed as just 'first', with the remaining characters "second" treated as a comment.
I understand comments need to be handled, but i think I would expect that if the password is all one 'word', i.e. no spaces, that it should still be treated as part of the password
Expected behavior
Values in .netrc containing hash symbols are processed as they are, including hash symbols, i.e. in the above example, the password value of "first#second" is used
Actual behavior
Value are truncated at the point of the location of the hash symbol due to the following characters being treated as comments, i.e. in the above example, the password value of "first" is used
Capture "Authorisation" header used in request from SPM to fetch binary target
Notice that it has the password truncated, so be "first", and does not include the entire value "first#second"
Sample unit test added to NetrcTests.swift to reproduce it :
Swift & OS version (output of swift --version ; uname -a)
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx15.0
Darwin mb-garyo 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered:
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
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?swift build
,swift test
,swift package
etc.Description
if i use a sample .netrc file as below:
the # symbol in the password causes it to be not read entirely, it gets processed as just 'first', with the remaining characters "second" treated as a comment.
I believe this comes from this function
I understand comments need to be handled, but i think I would expect that if the password is all one 'word', i.e. no spaces, that it should still be treated as part of the password
Expected behavior
Values in .netrc containing hash symbols are processed as they are, including hash symbols, i.e. in the above example, the password value of "first#second" is used
Actual behavior
Value are truncated at the point of the location of the hash symbol due to the following characters being treated as comments, i.e. in the above example, the password value of "first" is used
Steps to reproduce
Have a .netrc file containing the following:
Capture "Authorisation" header used in request from SPM to fetch binary target
Notice that it has the password truncated, so be "first", and does not include the entire value "first#second"
Sample unit test added to
NetrcTests.swift
to reproduce it :See output below:
Swift Package Manager version/commit hash
main (0b569a1)
Swift & OS version (output of
swift --version ; uname -a
)swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx15.0
Darwin mb-garyo 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: