Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
curl: enable netrc and add compatibility with libfetch variable
Baptiste Daroussin committed 2 years ago
commit 5adf7b04aaa719b1353e778d232345274f1a8a94
parent f6dba9c
1 file changed +4 -0
modified libpkg/fetch_libcurl.c
@@ -364,6 +364,7 @@ curl_fetch(struct pkg_repo *repo, int dest, struct fetch_item *fi)
	const char *sslkey = getenv("SSL_CLIENT_KEY_FILE");
	const char *sslcert = getenv("SSL_CLIENT_CERT_FILE");
	const char *ssl_ca_cert_file = getenv("SSL_CA_CERT_FILE");
+
	const char *netrc_file = getenv("NETRC");

	struct curl_repodata *cr = (struct curl_repodata *)repo->fetch_priv;

@@ -454,6 +455,9 @@ retry:
		curl_easy_setopt(cl, CURLOPT_SSLCERT, sslcert);
	if (ssl_ca_cert_file != NULL)
		curl_easy_setopt(cl, CURLOPT_CAINFO, ssl_ca_cert_file);
+
	if (netrc_file != NULL)
+
		curl_easy_setopt(cl, CURLOPT_NETRC_FILE, netrc_file);
+
	curl_easy_setopt(cl, CURLOPT_NETRC, 1L);

	if (repo->ip == IPV4)
		curl_easy_setopt(cl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);