From patchwork Wed Mar 6 04:36:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Unai Martinez Corral X-Patchwork-Id: 10840369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6F76139A for ; Wed, 6 Mar 2019 04:37:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEFD52CA60 for ; Wed, 6 Mar 2019 04:37:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0F2E2CB87; Wed, 6 Mar 2019 04:37:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8F7D62CA60 for ; Wed, 6 Mar 2019 04:37:56 +0000 (UTC) Received: from localhost ([127.0.0.1]:54160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1OJX-0004Z1-I6 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 05 Mar 2019 23:37:55 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) -- 2.20.1 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="" - if [ "$CREDENTIAL" = "yes" ] ; then + if [ "x$CREDENTIAL" = "xyes" ] ; then flags="OC" fi - if [ "$PERSISTENT" = "yes" ] ; then + if [ "x$PERSISTENT" = "xyes" ] ; then flags="${flags}F" fi @@ -296,18 +296,18 @@ qemu_set_binfmts() { mask=$(eval echo \$${cpu}_mask) family=$(eval echo \$${cpu}_family) - if [ "$magic" = "" ] || [ "$mask" = "" ] || [ "$family" = "" ] ; then + if [ "x$magic" = "x" ] || [ "x$mask" = "x" ] || [ "x$family" = "x" ] ; then echo "INTERNAL ERROR: unknown cpu $cpu" 1>&2 continue fi qemu="$QEMU_PATH/qemu-$cpu" - if [ "$cpu" = "i486" ] ; then + if [ "x$cpu" = "xi486" ] ; then qemu="$QEMU_PATH/qemu-i386" fi qemu="$qemu$QEMU_SUFFIX" - if [ "$host_family" != "$family" ] ; then + if [ "x$host_family" != "x$family" ] ; then $BINFMT_SET fi done