Skip to content
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

netrc: address several netrc parser flaws #15586

Closed
wants to merge 4 commits into from
Closed

Conversation

bagder
Copy link
Member

@bagder bagder commented Nov 15, 2024

  • make sure that a match that returns a username also returns a password, that should be blank if no password is found

  • fix handling of multiple logins for same host where the password/login order might be reversed.

  • reject credentials provided in the .netrc if they contain ASCII control codes - if the used protocol does not support such (like HTTP and WS do)

Reported-by: Harry Sintonen

Add test 478, 479 and 480 to verify. Updated unit 1304.

@testclutch
Copy link

Analysis of PR #15586 at f45134cf:

Test 283 failed, which has NOT been flaky recently, so there could be a real issue in this PR.

Generated by Testclutch

- make sure that a match that returns a username also returns a
  password, that should be blank if no password is found

- fix handling of multiple logins for same host where the password/login
  order might be reversed.

- reject credentials provided in the .netrc if they contain ASCII control
  codes - if the used protocol does not support such (like HTTP and WS do)

Reported-by: Harry Sintonen

Add test 478, 479 and 480 to verify. Updated unit 1304.
@bagder bagder force-pushed the bagder/netrc-again branch from f45134c to f7aa239 Compare November 16, 2024 17:38
@bagder bagder closed this in e9b9bba Nov 17, 2024
@bagder bagder deleted the bagder/netrc-again branch November 17, 2024 10:36
vszakats added a commit to vszakats/curl that referenced this pull request Nov 17, 2024
vszakats added a commit that referenced this pull request Nov 17, 2024
with MSVC 2008 and 2010:
```
lib/netrc.c(107): error C2440: 'initializing' : cannot convert from 'char *' to 'bool'
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51002792/job/jtoxd4mk984oi6fd#L164
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51002792/job/0wxlw9a8g04e56vt#L177

Follow-up to e9b9bba #15586
Closes #15601
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.

2 participants