]> git.ipfire.org Git - pakfire.git/commitdiff
downloader: Disable all protocols except https://, http:// and file://
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 11 Mar 2021 16:48:11 +0000 (16:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 11 Mar 2021 16:48:11 +0000 (16:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/downloader.c

index c9ddba40a17dc29d2ee8bcd3a8985c85f26f4563..0b260439ae0dfcdf68e0cbad3b5594afa182217f 100644 (file)
@@ -288,6 +288,10 @@ static struct pakfire_transfer* pakfire_downloader_create_transfer(
        curl_easy_setopt(transfer->handle, CURLOPT_DEBUGDATA, downloader->pakfire);
 #endif
 
+       // Limit protocols to HTTPS, HTTP, and FILE
+       curl_easy_setopt(transfer->handle, CURLOPT_PROTOCOLS,
+               CURLPROTO_HTTPS|CURLPROTO_HTTP|CURLPROTO_FILE);
+
        // Reference back to this transfer
        curl_easy_setopt(transfer->handle, CURLOPT_PRIVATE, transfer);