mirror of
https://github.com/curl/curl.git
synced 2026-07-23 23:37:22 +03:00
netrc: refactor into smaller sub functions
Fixes #20950 - test 685 is extended for this Closes #20932
This commit is contained in:
parent
a46816b4cb
commit
a327a5bded
4 changed files with 334 additions and 221 deletions
|
|
@ -35,10 +35,18 @@ On Windows two filenames in the home directory are checked: *.netrc* and
|
|||
*_netrc*, preferring the former. Older versions on Windows checked for
|
||||
*_netrc* only.
|
||||
|
||||
A quick and simple example of how to setup a *.netrc* to allow curl to FTP to
|
||||
the machine host.example.com with username 'myself' and password 'secret'
|
||||
A quick and simple example of how to setup a *.netrc* to allow curl to access
|
||||
the machine host.example.com with username `myself` and password `secret`
|
||||
could look similar to:
|
||||
|
||||
machine host.example.com
|
||||
login myself
|
||||
password secret
|
||||
|
||||
curl also supports the `default` keyword. This is the same as machine name
|
||||
except that default matches any name. There can be only one `default` token,
|
||||
and it must be after all machine tokens.
|
||||
|
||||
When providing a username in the URL and a *.netrc* file, curl looks for the
|
||||
password for that specific user for the given host if such an entry appears in
|
||||
the file before a "generic" `machine` entry without `login` specified.
|
||||
|
|
|
|||
|
|
@ -50,6 +50,11 @@ and similar things are not supported).
|
|||
The netrc file provides credentials for a hostname independent of which
|
||||
protocol and port number that are used.
|
||||
|
||||
When providing a username in the URL and a *.netrc* file, libcurl looks for
|
||||
and uses the password for that specific user for the given host if such an
|
||||
entry appears in the file before a "generic" `machine` entry without `login`
|
||||
specified.
|
||||
|
||||
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 user.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue