From patchwork Tue Sep 13 06:22:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1677121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=gFEmZw3A; dkim=fail reason="key not found in DNS" header.d=true.cz header.i=@true.cz header.a=rsa-sha256 header.s=xnet header.b=kbeLAcBG; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MRYP118ssz1ynm for ; Tue, 13 Sep 2022 16:25:24 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n1E6Api8Dgd/d9kMavqUK0kBrx3N5WwF8e0oeVtI9k0=; b=gFEmZw3Al+na9b OikSMyfK1x3HTFOZl+NY5ORIayYtIFWDzYo7VB0LgmkJPdkckuTD5vYjRCbHBu5vmwcNqzFVrfG5t Ai/RhDICX3JqeQlXpXpDgpRDZkquaKQT1y0olLKeaD9LFd2/Il8T2S1h90kJ14pI5H65HOyDCY9Lc 6iac1UwBPmazCJ36fiEZvqnogrpLQSucGe9qHX8Ef4ZRFV++I7Q8C1viQo4Htj5JVV6ZJSEb1jhGQ 9yEMdV0J3dfWk0om61XGPBQpXMrNG5VSzOw9PA0kR0P3dZiN31vABYL6E1or3bqNLxVCpxUFszcZV bmli1KOq3VVZX50aFjYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXzJp-002vXI-JM; Tue, 13 Sep 2022 06:22:49 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXzJR-002vCZ-SP for openwrt-devel@lists.openwrt.org; Tue, 13 Sep 2022 06:22:28 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 008831816B; Tue, 13 Sep 2022 08:22:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=true.cz; s=xnet; t=1663050139; bh=Li/tDHI7h4xsnSjRT/aggWvrQb8tiNOipmIKqglunoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kbeLAcBGabgRn2Ia95Dn6KJu/GWya5J8Dt/EhBJrMDWzuIbpoCtCxbo7liu66HXbR lAPRxG5lxsBIVSDNIMRktqJe2Y5LuC/c7TW0GLmWIVxSvXRkqiDW8bJXdQfZ3M05N+ vJ4CdaCZCMFp+5umckVvG/0GeUjYiRjrZDHG/gVQ= Received: by meh.true.cz (OpenSMTPD) with ESMTP id 2981c15a; Tue, 13 Sep 2022 08:21:55 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Subject: [PATCH 2/2] scripts/download.pl: fix downloads with wget Date: Tue, 13 Sep 2022 08:22:13 +0200 Message-Id: <20220913062213.9059-2-ynezz@true.cz> In-Reply-To: <20220913062213.9059-1-ynezz@true.cz> References: <20220913062213.9059-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220912_232226_519772_6F7C68EB X-CRM114-Status: UNSURE ( 7.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Several users of wget for downloads (curl is not available in the system) have reported broken download functionality: wget --tries=5 --timeout=20 --output-document=- https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.142.tar.xz http://: Invalid host name. Content analysis details: (0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Several users of wget for downloads (curl is not available in the system) have reported broken download functionality: wget --tries=5 --timeout=20 --output-document=- https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.142.tar.xz http://: Invalid host name. Fix it by properly handling of shell arguments with shellwords(). Fixes: #10692 Fixes: 90c6e3aedf16 ("scripts: always check certificates") Signed-off-by: Petr Štetiar --- scripts/download.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/download.pl b/scripts/download.pl index 90a1be4e2614..6bca126a9735 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -82,8 +82,14 @@ sub download_cmd($) { } return $have_curl - ? (qw(curl -f --connect-timeout 20 --retry 5 --location), $check_certificate ? '' : '--insecure', shellwords($ENV{CURL_OPTIONS} || ''), $url) - : (qw(wget --tries=5 --timeout=20 --output-document=-), $check_certificate ? '' : '--no-check-certificate', shellwords($ENV{WGET_OPTIONS} || ''), $url) + ? (qw(curl -f --connect-timeout 20 --retry 5 --location), + shellwords($check_certificate ? '' : '--insecure'), + shellwords($ENV{CURL_OPTIONS} || ''), + $url) + : (qw(wget --tries=5 --timeout=20 --output-document=-), + shellwords($check_certificate ? '' : '--no-check-certificate'), + shellwords($ENV{WGET_OPTIONS} || ''), + $url) ; }