Skip to content

Commit f962ddf

Browse files
bmwillgitster
authored andcommitted
http: always warn if libcurl version is too old
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>
1 parent 85e4205 commit f962ddf

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

http.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,8 @@ static CURL *get_curl_handle(void)
583583
curl_easy_setopt(result, CURLOPT_REDIR_PROTOCOLS, allowed_protocols);
584584
curl_easy_setopt(result, CURLOPT_PROTOCOLS, allowed_protocols);
585585
#else
586-
if (transport_restrict_protocols())
587-
warning("protocol restrictions not applied to curl redirects because\n"
588-
"your curl version is too old (>= 7.19.4)");
586+
warning("protocol restrictions not applied to curl redirects because\n"
587+
"your curl version is too old (>= 7.19.4)");
589588
#endif
590589

591590
if (getenv("GIT_CURL_VERBOSE"))

transport.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -629,11 +629,6 @@ void transport_check_allowed(const char *type)
629629
die("transport '%s' not allowed", type);
630630
}
631631

632-
int transport_restrict_protocols(void)
633-
{
634-
return !!protocol_whitelist();
635-
}
636-
637632
struct transport *transport_get(struct remote *remote, const char *url)
638633
{
639634
const char *helper;

transport.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,6 @@ int is_transport_allowed(const char *type);
153153
*/
154154
void transport_check_allowed(const char *type);
155155

156-
/*
157-
* Returns true if the user has attempted to turn on protocol
158-
* restrictions at all.
159-
*/
160-
int transport_restrict_protocols(void);
161-
162156
/* Transport options which apply to git:// and scp-style URLs */
163157

164158
/* The program to use on the remote side to send a pack */

0 commit comments

Comments
 (0)