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

Consult %APPDATA% also for _netrc #4016

Closed
raspy opened this issue Jun 12, 2019 · 1 comment
Closed

Consult %APPDATA% also for _netrc #4016

raspy opened this issue Jun 12, 2019 · 1 comment

Comments

@raspy
Copy link

@raspy raspy commented Jun 12, 2019

I did this

I have set up %HOMEDRIVE%%HOMEPATH%\_netrc and %APPDATA%\_netrc for the server I want to connect, but it seems that neither is consulted:

curl.exe -nv _url_requiring_authentication_
* Couldn't find host _host_ in the _netrc file; using defaults
...
< HTTP/1.1 401 Unauthorized

I expected the following

As %HOME% is not commonly set on Windows, I expected curl to consult also %APPDATA%. It is done for _curlrc, but not for _netrc. It would be good to resolve _netrc the same way. Currently it looks like no path is considered due to %HOME% not being set.

The change would not impact non-Windows platforms and would not affect current behavior when %HOME% is set, since it's the first considered in homedir() function.

curl/libcurl version

> curl.exe -V
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL

operating system

Microsoft Windows [Version 10.0.18362.175]

@bagder
Copy link
Member

@bagder bagder commented Jun 12, 2019

Maybe do it as a step in the #3989 work? What do you think @captain-caveman2k ?

@bagder bagder closed this in 67bb792 Oct 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants