Skip to content

netrc: Use the password from lines without login#9248

Closed
orgads wants to merge 1 commit intocurl:masterfrom
orgads:netrc-no-login
Closed

netrc: Use the password from lines without login#9248
orgads wants to merge 1 commit intocurl:masterfrom
orgads:netrc-no-login

Conversation

@orgads
Copy link
Copy Markdown
Contributor

@orgads orgads commented Aug 4, 2022

If netrc entry has password with empty login, use it for any username.

Example:
.netrc:
machine example.com password 123456

curl -vn http://user@example.com/

Fix it by initializing state_our_login to TRUE, and reset it only when
finding an entry with the same host and different login.

If netrc entry has password with empty login, use it for any username.

Example:
.netrc:
machine example.com password 123456

curl -vn http://user@example.com/

Fix it by initializing state_our_login to TRUE, and reset it only when
finding an entry with the same host and different login.
@orgads
Copy link
Copy Markdown
Contributor Author

orgads commented Aug 4, 2022

I'm not sure how to add tests for this.

@cvengler
Copy link
Copy Markdown
Contributor

cvengler commented Aug 6, 2022

I'm personally a bit in doubt of this feature, because it implicates that a default user password is a usable approach, whereas in reality, this is a security nightmare.

orgads added a commit to orgads/curl that referenced this pull request Aug 8, 2022
orgads added a commit to orgads/curl that referenced this pull request Aug 18, 2022
@orgads orgads mentioned this pull request Aug 18, 2022
@bagder bagder closed this in 943fb2b Aug 29, 2022
bagder pushed a commit that referenced this pull request Aug 29, 2022
@orgads orgads deleted the netrc-no-login branch August 29, 2022 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants