]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http: always warn if libcurl version is too old
authorBrandon Williams <bmwill@google.com>
Wed, 14 Dec 2016 22:39:51 +0000 (14:39 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Dec 2016 17:28:37 +0000 (09:28 -0800)
Always warn if libcurl version is too old because:

1. Even without a protocol whitelist, newer versions of curl have all
   non-standard protocols disabled by default.
2. A future patch will introduce default "known-good" and "known-bad"
   protocols which are allowed/disallowed by 'is_transport_allowed'
   which older version of libcurl can't respect.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c
transport.c
transport.h

diff --git a/http.c b/http.c
index 5cd3ffd67f40e7e377bf688211105c1b966d4d60..034426e746f81a69c387705a0ad93bedb52e8aaa 100644 (file)
--- a/http.c
+++ b/http.c
@@ -583,9 +583,8 @@ static CURL *get_curl_handle(void)
        curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS, allowed_protocols);
        curl_easy_setopt(result, CURLOPT_PROTOCOLS, allowed_protocols);
 #else
-       if (transport_restrict_protocols())
-               warning("protocol restrictions not applied to curl redirects because\n"
-                       "your curl version is too old (>= 7.19.4)");
+       warning("protocol restrictions not applied to curl redirects because\n"
+               "your curl version is too old (>= 7.19.4)");
 #endif
 
        if (getenv("GIT_CURL_VERBOSE"))
index 41eb82c6f3f4de956225eb8afd65d0684be68eec..dff929ec01fdb8a51e74cd7c2036fd998208b513 100644 (file)
@@ -629,11 +629,6 @@ void transport_check_allowed(const char *type)
                die("transport '%s' not allowed", type);
 }
 
-int transport_restrict_protocols(void)
-{
-       return !!protocol_whitelist();
-}
-
 struct transport *transport_get(struct remote *remote, const char *url)
 {
        const char *helper;
index c68140892c6258925104f7dda385e635fcf95e20..3396e1d434062b884521a490707f48c2c91a205b 100644 (file)
@@ -153,12 +153,6 @@ int is_transport_allowed(const char *type);
  */
 void transport_check_allowed(const char *type);
 
-/*
- * Returns true if the user has attempted to turn on protocol
- * restrictions at all.
- */
-int transport_restrict_protocols(void);
-
 /* Transport options which apply to git:// and scp-style URLs */
 
 /* The program to use on the remote side to send a pack */