From nobody Wed Apr 2 06:46:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551847092970281.99521756259526; Tue, 5 Mar 2019 20:38:12 -0800 (PST) Received: from localhost ([127.0.0.1]:54160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OJl-0004Z1-Nj for importer@patchew.org; Tue, 05 Mar 2019 23:38:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OIn-0004Ft-T3 for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:37:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1OIm-0003cj-Db for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:37:09 -0500 Received: from smtp.lg.ehu.es ([158.227.0.66]:16173 helo=smtp.ehu.eus) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1OIm-0003Yx-0D for qemu-devel@nongnu.org; Tue, 05 Mar 2019 23:37:08 -0500 Received: from imsva2.lgp.ehu.es (imsva2.lgp.ehu.es [10.0.3.246]) by postfix.smtp2.imsva2 (Postfix) with ESMTPS id C517C2C22; Wed, 6 Mar 2019 05:37:03 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 829D65A04F; Wed, 6 Mar 2019 05:37:03 +0100 (CET) Received: from imsva2.lgp.ehu.es (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 775285A045; Wed, 6 Mar 2019 05:37:03 +0100 (CET) Received: from smtp.ehu.eus (unknown [10.0.100.76]) by imsva2.lgp.ehu.es (Postfix) with ESMTPS; Wed, 6 Mar 2019 05:37:03 +0100 (CET) Received: from 03612eec87fc (unknown [139.47.78.33]) by smtp2 (Postfix) with ESMTPSA id 00B1D2C22; Wed, 6 Mar 2019 05:37:02 +0100 (CET) Date: Wed, 6 Mar 2019 04:36:58 +0000 From: Unai Martinez-Corral To: qemu-devel@nongnu.org Message-ID: <20190306043658.GA75@03612eec87fc> References: <20190306031221.GA53@03612eec87fc> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190306031221.GA53@03612eec87fc> User-Agent: Mutt/1.11.2 (2019-01-07) X-Greylist: ACL 174 matched, not delayed by milter-greylist-4.4.3 (smtp2); Wed, 06 Mar 2019 05:37:03 +0100 (CET) X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1631-8.2.0.1013-24472.004 X-TM-AS-Result: No--0.243-7.0-31-10 X-imss-scan-details: No--0.243-7.0-31-10 X-TMASE-Version: IMSVA-9.1.0.1631-8.2.1013-24472.004 X-TMASE-Result: 10--0.242600-10.000000 X-TMASE-MatchedRID: hwtUKlde9zE8mRT0SYY6fkvrB8UvzFr4viRliDV2nyzwQK0wGZW4tHch tJI6MELjokpikGcAFFsIlsaZLrUbOKF2E6v/FJwhNs3S39zaoXbXLq4lttlH/0oCplsay+SBo8W MkQWv6iVj9cVL65Yctebxq0gs7dfTFezSmIXNZTn6C0ePs7A07ba607moR85RN5GbtXMz3chhZB 5F+gtDHAfvC1/H7kAaWoO14E53yBTbP4Ukg5Z1NcpkOT2+SI/VyzU5gSE+geSN0Y3cVvY9CgMus 59lw9sBN9HE2rn+OTxnqPY47TFuQjOrSe5xQZ+QjkBRO3QBaBSwFMlIPaIBbQ== X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 X-Greylist: Sender IP whitelisted, Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (postfix.smtp2.imsva2); Wed, 06 Mar 2019 05:37:03 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 158.227.0.66 Subject: [Qemu-devel] [PATCH v3 1/10] qemu-binfmt-conf.sh: enforce safe style consistency X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: riku.voipio@iki.fi, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Spaces are added before '; then', for consistency. All the tests are prefixed with 'x', in order to avoid risky comparisons (i.e. a user deliberately trying to provoke a syntax error). Signed-off-by: Unai Martinez-Corral Reviewed-by: Laurent Vivier --- scripts/qemu-binfmt-conf.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index b5a16742a1..0009385be2 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -219,12 +219,12 @@ qemu_check_access() { qemu_check_bintfmt_misc() { # load the binfmt_misc module - if [ ! -d /proc/sys/fs/binfmt_misc ]; then + if [ ! -d /proc/sys/fs/binfmt_misc ] ; then if ! /sbin/modprobe binfmt_misc ; then exit 1 fi fi - if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then + if [ ! -f /proc/sys/fs/binfmt_misc/register ] ; then if ! mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc ; then exit 1 fi @@ -255,10 +255,10 @@ qemu_check_systemd() { qemu_generate_register() { flags=3D"" - if [ "$CREDENTIAL" =3D "yes" ] ; then + if [ "x$CREDENTIAL" =3D "xyes" ] ; then flags=3D"OC" fi - if [ "$PERSISTENT" =3D "yes" ] ; then + if [ "x$PERSISTENT" =3D "xyes" ] ; then flags=3D"${flags}F" fi @@ -296,18 +296,18 @@ qemu_set_binfmts() { mask=3D$(eval echo \$${cpu}_mask) family=3D$(eval echo \$${cpu}_family) - if [ "$magic" =3D "" ] || [ "$mask" =3D "" ] || [ "$family" =3D ""= ] ; then + if [ "x$magic" =3D "x" ] || [ "x$mask" =3D "x" ] || [ "x$family" = =3D "x" ] ; then echo "INTERNAL ERROR: unknown cpu $cpu" 1>&2 continue fi qemu=3D"$QEMU_PATH/qemu-$cpu" - if [ "$cpu" =3D "i486" ] ; then + if [ "x$cpu" =3D "xi486" ] ; then qemu=3D"$QEMU_PATH/qemu-i386" fi qemu=3D"$qemu$QEMU_SUFFIX" - if [ "$host_family" !=3D "$family" ] ; then + if [ "x$host_family" !=3D "x$family" ] ; then $BINFMT_SET fi done -- 2.20.1