From patchwork Mon Aug 2 09:50:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Danzberger X-Patchwork-Id: 1512343 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) 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=bombadil.20210309 header.b=vAxM4rLX; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=dd-wrt.com header.i=@dd-wrt.com header.a=rsa-sha256 header.s=mikd header.b=QotFkPos; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 4GdYHr6yVJz9sT6 for ; Mon, 2 Aug 2021 19:54:16 +1000 (AEST) 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:Subject:MIME-Version:Message-Id:Date: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=kNcXQWszINnSx/2FRGQIBm7wtkmnSjlCRXEAMCJ0mRU=; b=vAxM4rLXtaSbL4 thi7c5fQl517zq5mQiO1cP+6q+Eg6HrC/D4JfpLrVX42NQ+J28Y9+bK77RcqK0uF9rCW+g/b0XgCB hNS8JOvsEPobRktSl2WxHmUxWkP8n1szrEYS6dZNDwHktFnCduNYoF1189t7WZdYnL080MYaB+Eq4 JtlDzCsg70loYG2Gpleb77xS4tABGDXKgv5Gq9oPA4GY/XxfXvZSTVIqCUp+AegV21OKzFuJARK52 t7gIzmcAg9Ilwj9rfFmGAWjVLR/UY3KLcC/3LnvbE0ijyAXkjlEBWrONiS+IHcGUEMMgpyaXxa8Mt HTlZRasFLSacD92he8vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAUaU-00Fc1H-AC; Mon, 02 Aug 2021 09:50:22 +0000 Received: from smtps.newmedia-net.de ([2a05:a1c0:0:de::167] helo=webmail.newmedia-net.de) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAUaK-00Fc0Q-Ml for openwrt-devel@lists.openwrt.org; Mon, 02 Aug 2021 09:50:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dd-wrt.com; s=mikd; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To:From; bh=pmz4N01nFJQNzFJEjIn95uc7uPQ2lOhGfEkmvxd4aqg=; b=QotFkPosML/q5ZXPkP0MCBdmoOmAiQhW4VrqMRD4AAcdnALp1bIYulgYYja6yXh9GP0R4h5wfVfFmyTuh8bMPL+aOXCGgAAXWZxy95yILlYRzQ/c5y+ZDDbFRBFdo7CmNLJybZ2IPj9v809h7gfnUOjO3KD6hSNG7oJb9Y8OVSY=; From: Daniel Danzberger To: openwrt-devel@lists.openwrt.org Cc: Daniel Danzberger Date: Mon, 2 Aug 2021 11:50:00 +0200 Message-Id: <20210802095000.3601969-1-daniel@dd-wrt.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a02:908:2610:8050::151 X-SA-Exim-Mail-From: daniel@dd-wrt.com Subject: [PATCH] fstools: libblkid-tiny: fix invalid open syscall return check X-SA-Exim-Version: 4.2.1 (built Thu, 26 May 2011 15:22:33 +0200) X-SA-Exim-Scanned: No (on webmail.newmedia-net.de); Unknown failure X-NMN-MailScanner-Information: Please contact the ISP for more information X-NMN-MailScanner-ID: 1mAUaC-000FIb-8o X-NMN-MailScanner: Found to be clean X-NMN-MailScanner-From: daniel@dd-wrt.com X-Spam-Status: No X-Received: from [2a02:908:2610:8050::151] (helo=lappi.lan) by webmail.newmedia-net.de with esmtpa (Exim 4.72) (envelope-from ) id 1mAUaC-000FIb-8o; Mon, 02 Aug 2021 11:50:07 +0200 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_025012_983225_DF799529 X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. 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: open() returns -1 on error, not 0 (stdin). Signed-off-by: Daniel Danzberger --- libblkid-tiny/libblkid-tiny.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libblkid-tiny/libblkid-tiny.c b/libblkid-tiny/libblkid-tiny.c index 18db4ef..6e8cd81 100644 --- a/libblkid-tiny/libblkid-tiny.c +++ b/libblkid-tiny/libblkid-tiny.c @@ -196,7 +196,7 @@ int [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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 open() returns -1 on error, not 0 (stdin). Signed-off-by: Daniel Danzberger --- libblkid-tiny/libblkid-tiny.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libblkid-tiny/libblkid-tiny.c b/libblkid-tiny/libblkid-tiny.c index 18db4ef..6e8cd81 100644 --- a/libblkid-tiny/libblkid-tiny.c +++ b/libblkid-tiny/libblkid-tiny.c @@ -196,7 +196,7 @@ int probe_block(char *block, struct blkid_struct_probe *pr) pr->err = -1; pr->fd = open(block, O_RDONLY); - if (!pr->fd) + if (pr->fd == -1) return -1; for (i = 0; i < ARRAY_SIZE(idinfos); i++) {