mirror of
https://github.com/curl/curl.git
synced 2026-08-25 21:03:34 +03:00
netrc: support quoted strings
The .netrc parser now accepts strings within double-quotes in order to deal with for example passwords containing white space - which previously was not possible. A password that starts with a double-quote also ends with one, and double-quotes themselves are escaped with backslashes, like \". It also supports \n, \r and \t for newline, carriage return and tabs respectively. If the password does not start with a double quote, it will end at first white space and no escaping is performed. WARNING: this change is not entirely backwards compatible. If anyone previously used a double-quote as the first letter of their password, the parser will now get it differently compared to before. This is highly unfortunate but hard to avoid. Reported-by: ImpatientHippo on GitHub Fixes #8908 Closes #8937
This commit is contained in:
parent
b1f8d50a92
commit
eeaae10c0f
2 changed files with 66 additions and 10 deletions
|
|
@ -3011,7 +3011,8 @@ static CURLcode override_login(struct Curl_easy *data,
|
|||
conn->host.name, data->set.str[STRING_NETRC_FILE]);
|
||||
}
|
||||
else if(ret < 0) {
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
failf(data, ".netrc parser error");
|
||||
return CURLE_READ_ERROR;
|
||||
}
|
||||
else {
|
||||
/* set bits.netrc TRUE to remember that we got the name from a .netrc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue