From patchwork Sun Sep 20 05:31:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1367786 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=fail (p=none dis=none) header.from=gmail.com 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 4BvGTC70QVz9sTC for ; Sun, 20 Sep 2020 15:33:51 +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:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=0dA9/ZquCijTSDvNNyK6hs0oTjvwBs86HqEsJWZLnAM=; b=lPdX6H0AgKT7GLxiH/0+RH4EGr 3HTd6zTnBpp2CQ/945u1pLfz3BO40kdPGVA/z1JW+5vvaaTFM4ksf+yx3grE5g365cSXA6qt+/obZ QM46alpo3t1jT5pm+7soxs9eZFX+tRVY5OtTDjreH2kaT3L8C+/Lx4oxauEf8qnUllaqkHvu5QPB5 EDIVdU8pTybLxgKvHMQjnsuq4dIfIvvs/2jPut7y9euyPXyahBfT9Z2FT2zEJheJ5REdcGGmw74Yd 7G2E8lmfJJ/E+dXO3jLkw/OhTWRDd2am7zXkvpQw5lOP9TH9g2uJDZr9yo+hjTADbsinUQykxhkFt ZXyQSmnA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJrwz-0004Mw-Dd; Sun, 20 Sep 2020 05:31:49 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJrww-0004Lf-FT for openwrt-devel@lists.openwrt.org; Sun, 20 Sep 2020 05:31:47 +0000 Received: by mail-pl1-x643.google.com with SMTP id e4so5189757pln.10 for ; Sat, 19 Sep 2020 22:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=GuIEbixRZklzysqpRTnT1gTu+Xh15bGomVt0pLxRF9k=; b=D6p/9whvCZoUbgtUjcrMRxGY/663KmA/mrR5wjf0bT6UYLtU/GQ5PksFQJP7AUgxDX 7zzBLBrKA8HuyafLLURibNaStNN/TkqOiosCfx/uWmYWP1wkly1LO3EtrHyib2owh5yn hxHarG+tTmgi8QuRunRLtbTua/8c8HpA9StpuxNB+hGzx41Kc3IGSVK/DJW1M21BZwdu sJzDa/GHaoz18gaYW9MMsCKdGxTtFkQV5LMofP1Jxt9rMSa+d6C1WnEeDMEzMPS8wHMJ w3EXswICXhz1Ip2NqgsC1K8NviYMpHDxG//bG5FfO1DHtxbi2HvixF5ZGtShTohcek45 syCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=GuIEbixRZklzysqpRTnT1gTu+Xh15bGomVt0pLxRF9k=; b=Cgbf8umgBC2PpdXWaksQmuHkGSjjFb+98mzacj3emaHA3YxuDuY22YNrYH+2DB/wGQ KvYtNGF3R8wPyBiPt0VggZBl/Ojig7NyBUwd21Rmn6KCoJr7U6J/w0DJP3Z9+mouLPV2 dgibR6CKeinv4Xkh/Dx+tzrcNj8BK/R/dNq0xaYD94gf63kd0UZ21n+42MBizis/4WdZ J+mZD2Z6zYJiewyx1y8Z2wntCF5368OSnbuUo1r5RCbxHG5SRYTKzCPhzj+UXWOiHEby oI0vq07cTyUvHp47XBXdmdqGtoh5HLeukg36qmB7aO5XUnyyA8Syn6tBL3BNnkpyHz2N KUmA== X-Gm-Message-State: AOAM533zh/R0StmBk2T0RJDWxEJ2VM0rdtK9VLxpt8s8gieinhSl97U/ cSvHTUJJwvkR6Vg8jTw2kmMcazCgUFBdgw== X-Google-Smtp-Source: ABdhPJx3+oPc26fWKcjKvHUyfPvh9oL6rbvcOLSDayGZgE/2eFKk6mJ8fztfyI+JpxfCKzDsUC0UQw== X-Received: by 2002:a17:902:e9d3:b029:d1:f370:1e90 with SMTP id 19-20020a170902e9d3b02900d1f3701e90mr17949281plk.76.1600579902294; Sat, 19 Sep 2020 22:31:42 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id 25sm8052450pfj.35.2020.09.19.22.31.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 22:31:41 -0700 (PDT) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/4] base-files/functions.sh: read grep output by line Date: Sat, 19 Sep 2020 22:31:37 -0700 Message-Id: <20200920053140.35255-1-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200920_013146_577842_EA9B00CE X-CRM114-Status: GOOD ( 12.35 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:643 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rosenp[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: https://github.com/koalaman/shellcheck/wiki/SC2013 For loops by default (subject to $IFS) read word by word. Additionally, glob expansion will occur. I believe the intended use case of these loops is to read lines. Signed-off-by: Rosen Penev --- package/base-files/files/lib/functions.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 7da0c872fa..59bb0fe711 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -182,7 +182,8 @@ default_prerm() { fi local shell="$(command -v bash)" - for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do + grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list" | while IFS= read -r i + do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable else @@ -260,7 +261,8 @@ default_postinst() { if grep -m1 -q -s "^/etc/uci-defaults/" "$filelist"; then [ -d /tmp/.uci ] || mkdir -p /tmp/.uci - for i in $(grep -s "^/etc/uci-defaults/" "$filelist"); do + grep -s "^/etc/uci-defaults/" "$filelist" | while IFS= read -r i + do ( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i" done uci commit @@ -270,7 +272,8 @@ default_postinst() { fi local shell="$(command -v bash)" - for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do + grep -s "^/etc/init.d/" "$root$filelist" | while IFS= read -r i + do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable else From patchwork Sun Sep 20 05:31:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1367784 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=fail (p=none dis=none) header.from=gmail.com 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 4BvGT96vHvz9sT6 for ; Sun, 20 Sep 2020 15:33:49 +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:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hP7NUk3H7Un+IMAsgeQ7rgs0i0LhEQCFcvCFNK51Isk=; b=hmDTStIbuOI8f2KZ+Sj3Yqkk3q fNEvYmkLFUi0E0PUqUw2Q1vvHA/PexmHR4Z5B0ngK/s2fS1/ZWxmVvvKxB8kj0dUajHSDLodY58kE ytXF3ncBrA/dKa77nlNp1GJRqiGv6XLk1i1lAo/oPSSWNlQLw2O/of71F26+nI7K2B2OW+LYp8PT2 BOKnxcfMFjrph8cgLvALS1wuqtujZgfF5rQUVGtrLZp0BP5RN6hjO0jYJWmbkd59OamSi//lvXu5S sY/YxHUdxwfRFhbs3N3kDTs4jJQlEQinPtwgkaeHnJ4Rlf5/U0splAww9EE28BmmZhvejDh6YXYFG MccPGy5w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJrx1-0004N5-9k; Sun, 20 Sep 2020 05:31:51 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJrww-0004Lg-Gj for openwrt-devel@lists.openwrt.org; Sun, 20 Sep 2020 05:31:47 +0000 Received: by mail-pl1-x643.google.com with SMTP id bd2so5193275plb.7 for ; Sat, 19 Sep 2020 22:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=E8dVCxhmBYruUz8P65PPHoYLp56JWX4QzBNGh0rpjUA=; b=ttYVHMpZAaRKHzqrRgfwcBPOE51Yj6wbTHlNSM22qtAVVoIuvTFbmJ5KN7y42b2p6y /+18iov1KLs7hVGArFP7mdYBm2OnzZgd/oWqIm+lDIPDaT9MdMWX/KlvC1BO1xGGtzti Y2UcXDQu8t3WeWY6TXrLcTWcm3CaiL/poWm30ClAkREPjvMNM2WAePiTb9zCGAkMNX0m tO44ueQPWra5Qj90HY5E+FGe9oHP0DHt1+VFx9DAI2mw+nWB8TAZzuZIoW+tLLXCPTul uUa4L8O6m2O5MuLAPeTuybbWp5Xg0xVm77k+W7OlLJOVA+xYfnZavM3Z7IMKt+85gIFJ Qfww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E8dVCxhmBYruUz8P65PPHoYLp56JWX4QzBNGh0rpjUA=; b=WjxVNnykbQM5ANNb2qTmAVV3hDojukvatRuUSnRY1Gd8trTFaGpairlKXJY1mYuOqH Lpe4VGwmdIJMr/C2EOUE3SCz0tBtRhswHt+brRKjwdCZbfn/SGLQ6tA4L87rpXHMTV+j 2jCzloADJ09CDeyR7bGeaQNNSKatHTwKYV83qmaGgG0PViJLsf7I0wYcipsyYe1VwNPR dRgqJOJ6KkT53c6mhKpvs0nsgV27/tbR0VqViUiVhPkpaOJGJpq9J1fdnodiRPR/uji6 ynnVrVaCJll9QdkoCjVcXUuOE3d1vi+7lL/K1tPmj37foWjZwsSH1439DolAxunFFs5e 15Zw== X-Gm-Message-State: AOAM5301RX57WJMCLm1GXBK3wy+Frc996+Y30CuyGaLpbsVa9UFc5qhf OQKL2PZPDA8kF/Gn0I6EvgEk3nLlprE8jA== X-Google-Smtp-Source: ABdhPJw7kniICUd6I9Cyt3bWEKdYP7LSq3MDWSrnucJ8AlV595fXId5bvAGfv7jBgaMlo2c4Ph+pWA== X-Received: by 2002:a17:902:b186:b029:d1:cc21:9a7d with SMTP id s6-20020a170902b186b02900d1cc219a7dmr27753953plr.8.1600579903179; Sat, 19 Sep 2020 22:31:43 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id 25sm8052450pfj.35.2020.09.19.22.31.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 22:31:42 -0700 (PDT) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/4] base-files/functions.sh: do not iterate over ls Date: Sat, 19 Sep 2020 22:31:38 -0700 Message-Id: <20200920053140.35255-2-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920053140.35255-1-rosenp@gmail.com> References: <20200920053140.35255-1-rosenp@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200920_013146_579209_DFC5DFA5 X-CRM114-Status: GOOD ( 13.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:643 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rosenp[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From https://github.com/koalaman/shellcheck/wiki/SC2045 : When looping over a set of files, it's always better to use globs when possible. Using command expansion causes word splitting and glob expansion, which will cause problems for certain filenames (typically first seen when trying to process a file with spaces in the name). Signed-off-by: Rosen Penev --- package/base-files/files/lib/functions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 59bb0fe711..0f56387244 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -290,8 +290,9 @@ default_postinst() { include() { local file - for file in $(ls $1/*.sh 2>/dev/null); do - . $file + for file in "$1"/*.sh; do + [ -e "$file" ] || break + . "$file" done } From patchwork Sun Sep 20 05:31:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1367787 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=fail (p=none dis=none) header.from=gmail.com 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 4BvGTD381gz9sTH for ; Sun, 20 Sep 2020 15:33:52 +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:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LbO30WVWSwIYtrzzDeqjKUycLFyBAB3DA5qM2lappwY=; b=ubNQVvEYiStaECxo10FsgeYhxE EbpwOyihDzC8tNiNYzoKtIvkPtxwwIoEdqcEOt+mtFgQmRXnOnTd4wAeCjxCET0LfHs9+nU16lzlF pUIOVtmIKSlNVUfUiPGVHC7kI1hjXW+s9hejlOZJW4wYLrshqgpWCe0lxtmvddz4hoP1r/+SLaCIh lyI1jxPUV5fOgvzVzGnr7DBbFD8LlNQA7FExOJ5DksKy3fZQbS7+Gc8mQME/hNMjhykwjQIDW3uoj 667nh+CY++x7Lqdf7ZufLuYwk/gAe7y61aLbX2feEt9eUmG24tRaNM3mbz/4wiU6PA6rK423J7i+e TZNFq7Ew==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJrx3-0004NE-6v; Sun, 20 Sep 2020 05:31:53 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJrww-0004Lh-Uu for openwrt-devel@lists.openwrt.org; Sun, 20 Sep 2020 05:31:48 +0000 Received: by mail-pj1-x102e.google.com with SMTP id s14so5649536pju.1 for ; Sat, 19 Sep 2020 22:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=h2d9aXO/DUnOtDT22fxM3vJJMaRukbTdYpEZkIff5QI=; b=jaXo48QeSjqGR3INeg2YjRDHIWXpuOZ0XPWTVpvMn9uP0lEJ+QXBjtcYnC967bADyf VMRseaW+wDhd9lE4n5fZZintCMTS2Lga/RVoTrQMYc4tMQPCBWcXA2/y6HWd/OCMGNvA f2Xu7ihA2qDwFQeCWISNxMycTbV8vDXnt+gYMnJw09CqV+QNeXdk6cz6et3mJnDhxb15 +fQ0w0yg3peJfCcXQsNQ3gQteJRjxiRZMK2ojMGnZZbqmUDcuMHIVZbxK9VRb2KttSAq nlyGnZ3xD1kZrX5wD8b2LYTlueEMlOzg97ZtnfcEDU4P0KNwA/roaRveuUjfdcv6d1B9 nmUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h2d9aXO/DUnOtDT22fxM3vJJMaRukbTdYpEZkIff5QI=; b=hSlqhufC5d/hmCcwNk5K1jC5FlB85dzG2IKoCMJBEZXOh4UZZ1HYTkt7Q/iv95Jt/J PjUMj88j69QQpm9Yum54lw4kzFtFaaDfDF4DPQ0x+WJ34NA8JdJzxl6mmfbAMRXrLGOn c55l0M6FNhFHmwlOW21gZshUjYghSrgQM30XvGX4y8ES8+/tFwPUu5Pzw9hLy0OfYZdd Towu/kslhtQajXTE1J+niLuCkqkhIfc8fldIXbNjmz4kfflzeA/VYf2ETjPb6uZ4Q9Bz /JMcK+r8L01fOwFOL33gKDCYJiYDRHiEYG86ASh6klImYUxONKDdF3iXKp4FBGPNNNGb 3tUw== X-Gm-Message-State: AOAM532pXNjcsZVxXiE4EmYNAVwZrDy7zJsxTFIhSWZB2ZqbM/RtbihR Kfw2g8SL7hd9XChgFm2TIVsmMZ7735QpWw== X-Google-Smtp-Source: ABdhPJxh0/GsblgXNfSlcv7fxVbDaIhxtAlXYApG0R8DFZ/U0K+rGQ1CnUpFAsk9RIwteJv9t4cb5w== X-Received: by 2002:a17:90a:2ecb:: with SMTP id h11mr18947300pjs.195.1600579904184; Sat, 19 Sep 2020 22:31:44 -0700 (PDT) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id 25sm8052450pfj.35.2020.09.19.22.31.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 22:31:43 -0700 (PDT) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Subject: [PATCH 3/4] base-files/functions.sh: replace ^ with ! in [] Date: Sat, 19 Sep 2020 22:31:39 -0700 Message-Id: <20200920053140.35255-3-rosenp@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200920053140.35255-1-rosenp@gmail.com> References: <20200920053140.35255-1-rosenp@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200920_013146_994203_58D9A845 X-CRM114-Status: GOOD ( 13.31 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102e listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rosenp[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Strictly speaking, ash does not support it. From https://wiki.ubuntu.com/DashAsBinSh#A.5B.5E.5D : Not to be confused by sed's and other program's regular expression syntax. Uses of [^] in case (parameter/word expansion in general) need to be replaced with [!]. Found with shellcheck: https://github.com/koalaman/shellcheck/wiki/SC2169 Signed-off-by: Rosen Penev --- package/base-files/files/lib/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 0f56387244..a7ff50cb1a 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -108,7 +108,7 @@ config_unset() { # config_get