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

Comments

@raspy
Copy link

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

This comment has been minimized.

Copy link
Member

commented Jun 12, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.