From: Luca Boccassi Date: Fri, 10 Apr 2026 23:15:13 +0000 (+0100) Subject: importd: harden curl file protocol handling X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=275ec1160b62c90dad3264e484e976213b0ada30;p=thirdparty%2Fsystemd.git importd: harden curl file protocol handling With old libcurl versions file:// can get redirects which can be messy, while the new version rejects them. Set an option to explicit block them. --- diff --git a/src/import/curl-util.c b/src/import/curl-util.c index 48842a20b70..52321d08e1a 100644 --- a/src/import/curl-util.c +++ b/src/import/curl-util.c @@ -293,6 +293,8 @@ int curl_glue_make(CURL **ret, const char *url, void *userdata) { if (curl_easy_setopt(c, CURLOPT_PROTOCOLS_STR, "HTTP,HTTPS,FILE") != CURLE_OK) #else if (curl_easy_setopt(c, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_FILE) != CURLE_OK) + return -EIO; + if (curl_easy_setopt(c, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS) != CURLE_OK) #endif return -EIO;