From patchwork Wed Jan 25 06:28:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 1731526 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=c5b/Si43; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=nQA5FXK0; 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 4P1vBM6D53z23gY for ; Wed, 25 Jan 2023 17:31:39 +1100 (AEDT) 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: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:In-Reply-To:References: List-Owner; bh=QNYIEonZlcjAH7ViKKYlb21oODSSSkuru0Nz/USnvew=; b=c5b/Si43Fl5i8I S41FkAKdDD0oVvLwitZUK2z9yTafEj/5KJIjWC4LuD2NEV923ymHCkkUBjzbGHiKaiKrinmHOIY38 vqUckyD2ZQ3wQqrxbAxHj/akwr+sFBCQvYR3aT99Nbp7O3DU7TZeZE0qXrnvInq0F0/1SAyXinRFU DesJ/AA/GwokXtZYKPJTg/KiJjaXqwDu/JnVZOyQsfOpB2mDxQzZZbG7KcLxJTjeaIAFOOS9AtWln 6y5Huz71RsJtjoytzQxU8y63JEmTHX5B3iIX+J2pDfHxFEGfZdxpAfVuQkBE6y2zwf8Guhpdvmfqa vkswRslQaj/AxJsuZ+HA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKZGl-0067k5-Nw; Wed, 25 Jan 2023 06:28:27 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKZGi-0067jc-HP for openwrt-devel@lists.openwrt.org; Wed, 25 Jan 2023 06:28:25 +0000 Received: by mail-pf1-x430.google.com with SMTP id i1so12770742pfk.3 for ; Tue, 24 Jan 2023 22:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=R6UjWvwpz0VF9HxkMnGTKh6qAhoGBCki500+3RY7RpQ=; b=nQA5FXK0ef72AdeYtshZD/5AhpMYCg2HND+bz+UkqrIrepnZG/IzCRl4nIRrkdicjW FNFpdbwffLwkInQa2LbB6P9jNjBMT1e+SazhaDCHSDTAI0Y5ciao+yodSnZsJ3rztb1Z 4RCW8CZXytQlRFBNLqWesmDeZEouVm2x0oyzwXvTEg/PGvuKdGWLfhot0pBkjLuUGBun IM2Z38V/keis3rlr8r7WIkeWBfFPHvSWTJOK65edWn0WW/DYOx2mit6AZhNOgiYqTFlC 7v4lWCOwy1jCopcNlFa9k33PFIIyTzWBuAjAqg20nzFUgRMNutOhOMxpc62GC3yki0ka mgtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R6UjWvwpz0VF9HxkMnGTKh6qAhoGBCki500+3RY7RpQ=; b=j5yIWApmbfudR+rxEDSLYVf/4SghfFrjQ9EzY7gh5tgTUkmLozHG8GnK8NcGxRj/vf zm0ZFZN8ZouD2NfjThPxdZeQnTs5z10fw44RWE+Hp8vk+9bA+k8LCVrNA0G+34MSc3G2 18Js4ukroWVeo/gHvGljI0mRA1MnqpC2o+57nSiR95rhKW82woTvFToQ+jCc6xmHsGqY RO8lzaEZyIw27zIOnPfBcyaaPgburU1t/iix6u83AJsA8eibh7c318MlkV61O5NdHRQN LQBL5FWtWzLHO1P3roQO6ezWv532VUm6blKW1BiMBalCcIVFOr/Tj2hgeviLVW7cUV3+ PUOg== X-Gm-Message-State: AFqh2krn111GT3xBsUx3eZTH2rNer3l7tRVJA+q+1rN/V8DPpCuON2Fc GJRjUnge16H1dGN9fErn3JYx68LJciA= X-Google-Smtp-Source: AMrXdXuR5hgV/2/ZZ2kL9atWNWcBLfc0RQgv9E+k8BiuQYOm9PXJDY9pOGpv0cFue/Q6q1ruEErLtg== X-Received: by 2002:a62:6003:0:b0:58d:a981:b97c with SMTP id u3-20020a626003000000b0058da981b97cmr29515422pfb.34.1674628102572; Tue, 24 Jan 2023 22:28:22 -0800 (PST) Received: from localhost ([2600:1700:38c1:1d7f:f66d:4ff:fe3c:3ceb]) by smtp.gmail.com with ESMTPSA id b3-20020aa78703000000b005821db4fd84sm2685316pfo.131.2023.01.24.22.28.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2023 22:28:22 -0800 (PST) From: Brian Norris To: openwrt-devel@lists.openwrt.org Cc: Ansuel Smith , Brian Norris Subject: [PATCH fstools] partname: Correct fstools_partname_fallback_scan comparison Date: Tue, 24 Jan 2023 22:28:14 -0800 Message-Id: <20230125062814.2517900-1-computersforpeace@gmail.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230124_222824_614406_BFC71CC3 X-CRM114-Status: GOOD ( 10.83 ) 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: We want to return NULL if the param does *not* match 1 -- i.e., a non-zero strcmp(). Fixes: 1ea5855e980c ("partname: Introduce fstools_partname_fallback_scan option") Signed-off-by: Brian Norris --- Content analysis details: (-0.2 points, 5.0 required) 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:430 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 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 [computersforpeace[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 We want to return NULL if the param does *not* match 1 -- i.e., a non-zero strcmp(). Fixes: 1ea5855e980c ("partname: Introduce fstools_partname_fallback_scan option") Signed-off-by: Brian Norris --- libfstools/partname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfstools/partname.c b/libfstools/partname.c index f42322a49d5b..82c723c02097 100644 --- a/libfstools/partname.c +++ b/libfstools/partname.c @@ -143,7 +143,7 @@ static struct volume *partname_volume_find(char *name) if (!get_var_from_file("/proc/cmdline", "fstools_partname_fallback_scan", rootparam, sizeof(rootparam))) return NULL; - if (!strcmp("1", rootparam)) + if (strcmp("1", rootparam)) return NULL; /* no useful 'root=' kernel cmdline parameter, find on any block device */