From patchwork Mon Aug 10 00:15:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Spooren X-Patchwork-Id: 1342682 X-Patchwork-Delegate: mail@aparcar.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aparcar.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=20qL+D/T; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BPxPF4W8Rz9sRN for ; Mon, 10 Aug 2020 10:17:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=7Sq86pEKGFzssQd8Qq8OKKcyXRgmFJhWTJBZ41Eu4pQ=; b=20qL+D/Txkt5EQq71/F5ByZphZ L4AW9s6vFUrJu7CdwZY2g/JT3ZFdRDmxoF7gZWvRJSQAhFuL4wA8wDDyLhuc8WvFEaGHOueJW4T7k Qf/+uRhRiLB6ifV3j9zHjU8JqlMyxT+IcL1rfneMaqunsExsg+rnYy95Cn2WPf6h2M+5VVDOepBBv 5Cwqpw/Z3F0T9XLukvwlxdNNhpj4wjRnle0o1NLHDXlCniTlmMP05NYcihmSmxEORmtmSj+PMUUAl r/NGKy3fN3KyOlwUSJaBz11ERalctuONxvQSGMDj2Uqcfi8Q0xwEqXa4OwrppV2Q6QNB/LgjRh3xo YdGt/b8A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k4vTM-0006G1-7f; Mon, 10 Aug 2020 00:15:28 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k4vTI-0006FO-QI for openwrt-devel@lists.openwrt.org; Mon, 10 Aug 2020 00:15:25 +0000 X-Originating-IP: 72.234.141.215 Received: from dawn.lan (udp224251uds.hawaiiantel.net [72.234.141.215]) (Authenticated sender: mail@aparcar.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPA id 449851BF208; Mon, 10 Aug 2020 00:15:19 +0000 (UTC) From: Paul Spooren To: openwrt-devel@lists.openwrt.org Subject: [PATCH] busybox: Disable `which` command Date: Sun, 9 Aug 2020 14:15:14 -1000 Message-Id: <20200810001514.114949-1-mail@aparcar.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200809_201524_958531_27FC8555 X-CRM114-Status: GOOD ( 11.76 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.201 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.70.183.201 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Spooren Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The `which` command returns the first found path to a binary specified. It's behaviour is identical to the shell built in `command -v`. Shellcheck even prints a warning if `which` is used (SC2230). Once neither `openwrt.git` nor related repositories make use of `which`, the command should be disabled for busybox, freeing roughly 4kB. Signed-off-by: Paul Spooren --- This patch depends on the following three patches: openwrt.git: https://patchwork.ozlabs.org/project/openwrt/list/?series=194732 packages.git: https://github.com/openwrt/packages/pull/13059 luci.git: https://github.com/openwrt/luci/pull/4342 package/utils/busybox/Config-defaults.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 29724041f4..2944369a69 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -997,7 +997,7 @@ config BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_FANCY default n config BUSYBOX_DEFAULT_WHICH bool - default y + default n config BUSYBOX_DEFAULT_MINIPS bool default n