1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 17:31:46 -05:00

James Cone added CURLOPT_NETRC / --netrc / --netrc-optional descriptions

This commit is contained in:
Daniel Stenberg 2002-05-21 22:20:16 +00:00
parent 654be65590
commit 51fcee6f81
2 changed files with 36 additions and 7 deletions

View File

@ -716,9 +716,9 @@ NETRC
passwords, so therefor most unix programs won't read this file unless it is passwords, so therefor most unix programs won't read this file unless it is
only readable by yourself (curl doesn't care though). only readable by yourself (curl doesn't care though).
Curl supports .netrc files if told so (using the -n/--netrc option). This is Curl supports .netrc files if told so (using the -n/--netrc and
not restricted to only ftp, but curl can use it for all protocols where --netrc-optional options). This is not restricted to only ftp,
authentication is used. but curl can use it for all protocols where authentication is used.
A very simple .netrc file could look something like: A very simple .netrc file could look something like:

View File

@ -181,10 +181,39 @@ A non-zero parameter tells the library to append to the remote file instead of
overwrite it. This is only useful when uploading to a ftp site. overwrite it. This is only useful when uploading to a ftp site.
.TP .TP
.B CURLOPT_NETRC .B CURLOPT_NETRC
A non-zero parameter tells the library to scan your \fI~/.netrc\fP file to This parameter controls the preference of libcurl between using user names and
find user name and password for the remote site you are about to access. Only passwords from your \fI~/.netrc\fP file, relative to user names and passwords
machine name, user name and password is taken into account (init macros and in the URL supplied with \fICURLOPT_URL\fP.
similar things aren't supported).
\fBNote:\fP libcurl uses a user name (and supplied or prompted password)
supplied with \fICURLOPT_USERPWD\fP in preference to any of the options
controlled by this parameter.
Pass a long, set to one of the values described below.
.RS
.TP 5
.B CURL_NETRC_OPTIONAL
The use of your \fI~/.netrc\fP file is optional,
and information in the URL is to be preferred. The file will be scanned
with the host and user name (to find the password only) or with the host only,
to find the first user name and password after that \fImachine\fP,
which ever information is not specified in the URL.
Undefined values of the option will have this effect.
.TP
.B CURL_NETRC_IGNORED
The library will ignore the file and use only the information in the URL.
This is the default.
.TP
.B CURL_NETRC_REQUIRED
This value tells the library that use of the file is required,
to ignore the information in the URL,
and to search the file with the host only.
.RE
.TP
Only machine name, user name and password are taken into account
(init macros and similar things aren't supported).
\fBNote:\fP libcurl does not verify that the file has the correct properties \fBNote:\fP libcurl does not verify that the file has the correct properties
set (as the standard Unix ftp client does). It should only be readable by set (as the standard Unix ftp client does). It should only be readable by