From: Luca Boccassi Date: Fri, 10 Apr 2026 23:15:13 +0000 (+0100) Subject: importd: harden curl file protocol handling X-Git-Tag: v260.2~249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cb8d612ef25ce08b0ba0054730562cdde6fa681;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. (cherry picked from commit 275ec1160b62c90dad3264e484e976213b0ada30) --- diff --git a/src/import/curl-util.c b/src/import/curl-util.c index 4747d0993a8..066d3b3f802 100644 --- a/src/import/curl-util.c +++ b/src/import/curl-util.c @@ -291,6 +291,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;