mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:57:28 +03:00
parent
665138b2dd
commit
4d4eb8e587
4 changed files with 23 additions and 6 deletions
|
|
@ -54,6 +54,10 @@ nss, openssl, rustls, schannel, secure-transport, wolfssl
|
|||
When the netrc feature is used (\fICURLOPT_NETRC(3)\fP), this variable is
|
||||
checked as the primary way to find the "current" home directory in which
|
||||
the .netrc file is likely to exist.
|
||||
.IP USERPROFILE
|
||||
When the netrc feature is used (\fICURLOPT_NETRC(3)\fP), this variable is
|
||||
checked as the secondary way to find the "current" home directory (on Windows
|
||||
only) in which the .netrc file is likely to exist.
|
||||
.IP LOGNAME
|
||||
User name to use when invoking the ntlm-wb tool, if NTLMUSER was not set.
|
||||
.IP NO_PROXY
|
||||
|
|
|
|||
|
|
@ -361,9 +361,11 @@ similar to the \fICURLOPT_USERPWD(3)\fP option like this:
|
|||
curl_easy_setopt(easyhandle, CURLOPT_PROXYUSERPWD, "myname:thesecret");
|
||||
|
||||
There's a long time Unix "standard" way of storing FTP user names and
|
||||
passwords, namely in the $HOME/.netrc file. The file should be made private
|
||||
so that only the user may read it (see also the "Security Considerations"
|
||||
chapter), as it might contain the password in plain text. libcurl has the
|
||||
passwords, namely in the $HOME/.netrc file (on Windows, libcurl also checks
|
||||
the %USERPROFILE% environment variable if %HOME% is unset, and tries
|
||||
_netrc as name). The file should be made private so that only the user may
|
||||
read it (see also the "Security Considerations" chapter),
|
||||
as it might contain the password in plain text. libcurl has the
|
||||
ability to use this file to figure out what set of user name and password to
|
||||
use for a particular host. As an extension to the normal functionality,
|
||||
libcurl also supports this file for non-FTP protocols such as HTTP. To make
|
||||
|
|
|
|||
|
|
@ -32,9 +32,13 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NETRC, long level);
|
|||
.SH DESCRIPTION
|
||||
This parameter controls the preference \fIlevel\fP of libcurl between using
|
||||
user names and passwords from your \fI~/.netrc\fP file, relative to user names
|
||||
and passwords in the URL supplied with \fICURLOPT_URL(3)\fP. On Windows,
|
||||
libcurl will use the file as \fI%HOME%/_netrc\fP, but you can also tell
|
||||
libcurl a different file name to use with \fICURLOPT_NETRC_FILE(3)\fP.
|
||||
and passwords in the URL supplied with \fICURLOPT_URL(3)\fP.
|
||||
|
||||
On Windows, libcurl will use the file as \fI%HOME%/_netrc\fP. If \fI%HOME%\fP
|
||||
is not set on Windows, libcurl falls back to \fI%USERPROFILE%\fP.
|
||||
|
||||
You can also tell libcurl a different file name to use with
|
||||
\fICURLOPT_NETRC_FILE(3)\fP.
|
||||
|
||||
libcurl uses a user name (and supplied or prompted password) supplied with
|
||||
\fICURLOPT_USERPWD(3)\fP or \fICURLOPT_USERNAME(3)\fP in preference to any of
|
||||
|
|
|
|||
|
|
@ -313,6 +313,13 @@ int Curl_parsenetrc(const char *host,
|
|||
if(pw) {
|
||||
home = pw->pw_dir;
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
}
|
||||
else {
|
||||
homea = curl_getenv("USERPROFILE");
|
||||
if(homea) {
|
||||
home = homea;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue