[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 339/411: curl: only warn not fail, if not finding the home dir
From: |
gnunet |
Subject: |
[gnurl] 339/411: curl: only warn not fail, if not finding the home dir |
Date: |
Wed, 13 Jan 2021 01:22:34 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 0362944a2eeee417c61c458e9000806dafe475d4
Author: Daniel Stenberg <daniel@haxx.se>
AuthorDate: Fri Nov 13 00:37:21 2020 +0100
curl: only warn not fail, if not finding the home dir
... as there's no good reason to error out completely.
Reported-by: Andreas Fischer
Fixes #6200
Closes #6201
---
src/tool_operate.c | 35 +++++++++++++++--------------------
1 file changed, 15 insertions(+), 20 deletions(-)
diff --git a/src/tool_operate.c b/src/tool_operate.c
index bc9dc058b..90522e1e9 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1711,30 +1711,25 @@ static CURLcode single_transfer(struct GlobalConfig
*global,
if(config->path_as_is)
my_setopt(curl, CURLOPT_PATH_AS_IS, 1L);
- if(built_in_protos & (CURLPROTO_SCP|CURLPROTO_SFTP)) {
- if(!config->insecure_ok) {
- char *home;
- char *file;
- result = CURLE_FAILED_INIT;
- home = homedir(NULL);
- if(home) {
- file = aprintf("%s/.ssh/known_hosts", home);
- if(file) {
- /* new in curl 7.19.6 */
- result = res_setopt_str(curl, CURLOPT_SSH_KNOWNHOSTS, file);
- curl_free(file);
- if(result == CURLE_UNKNOWN_OPTION)
- /* libssh2 version older than 1.1.1 */
- result = CURLE_OK;
- }
- Curl_safefree(home);
- }
- else {
- errorf(global, "Failed to figure out user's home dir!");
+ if((built_in_protos & (CURLPROTO_SCP|CURLPROTO_SFTP)) &&
+ !config->insecure_ok) {
+ char *home = homedir(NULL);
+ if(home) {
+ char *file = aprintf("%s/.ssh/known_hosts", home);
+ if(file) {
+ /* new in curl 7.19.6 */
+ result = res_setopt_str(curl, CURLOPT_SSH_KNOWNHOSTS, file);
+ curl_free(file);
+ if(result == CURLE_UNKNOWN_OPTION)
+ /* libssh2 version older than 1.1.1 */
+ result = CURLE_OK;
}
+ Curl_safefree(home);
if(result)
break;
}
+ else
+ warnf(global, "No home dir, couldn't find known_hosts file!");
}
if(config->no_body || config->remote_time) {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 387/411: NEW-PROTOCOL: document what needs to be done to add one, (continued)
- [gnurl] 387/411: NEW-PROTOCOL: document what needs to be done to add one, gnunet, 2021/01/12
- [gnurl] 383/411: ntlm: avoid malloc(0) on zero length user and domain, gnunet, 2021/01/12
- [gnurl] 355/411: cmake: use libcurl.rc in all Windows builds, gnunet, 2021/01/12
- [gnurl] 360/411: curl: add compatibility for Amiga and GCC 6.5, gnunet, 2021/01/12
- [gnurl] 345/411: KNOWN_BUGS: make a new section for cmake topics, gnunet, 2021/01/12
- [gnurl] 274/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 330/411: THANKS-filter: ignore autobuild links, gnunet, 2021/01/12
- [gnurl] 368/411: asyn: use 'struct thread_data *' instead of 'void *', gnunet, 2021/01/12
- [gnurl] 305/411: rtsp: fixed the RTST Session ID mismatch in test 570, gnunet, 2021/01/12
- [gnurl] 371/411: infof/failf calls: fix format specifiers, gnunet, 2021/01/12
- [gnurl] 339/411: curl: only warn not fail, if not finding the home dir,
gnunet <=
- [gnurl] 319/411: tool_operate: set HSTS with CURLOPT_HSTS to pass on filename, gnunet, 2021/01/12
- [gnurl] 272/411: alt-svc: enable by default, gnunet, 2021/01/12
- [gnurl] 391/411: docs: fix typos and markup in ETag manpage sections, gnunet, 2021/01/12
- [gnurl] 334/411: curl_easy_escape: limit output string length to 3 * max input, gnunet, 2021/01/12
- [gnurl] 384/411: openssl: remove #if 0 leftover, gnunet, 2021/01/12
- [gnurl] 403/411: cmake: don't use reserved target name 'test', gnunet, 2021/01/12
- [gnurl] 382/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 394/411: openssl: use OPENSSL_init_ssl() with >= 1.1.0, gnunet, 2021/01/12
- [gnurl] 380/411: ngtcp2: use the minimal version of QUIC supported by ngtcp2, gnunet, 2021/01/12
- [gnurl] 409/411: gnurl: rename new files, gnunet, 2021/01/12