Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp364943pxb; Sat, 18 Sep 2021 05:11:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx4UA/1bNBs/9IOtgSiIuxJVoJRM4P34NAyAp6RxzYRz9V4A+1s+pnCpBSdaOrjV3MNEeU X-Received: by 2002:a02:630f:: with SMTP id j15mr12539251jac.62.1631967114896; Sat, 18 Sep 2021 05:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631967114; cv=none; d=google.com; s=arc-20160816; b=hh2LbfK0Yzrt9bi1+fDiF4e/AIOk2ilpquAeNsS25IjRdTIg1CA9OjiHq3NMk1DHye HCg/TVwwJirX+iir6ToyPWsPWm94C3zxHqeB6cXIdFcA8eN2ELT3RlTJdWGc0n3IOyI9 HUGDq/Enxpo7JCUmsXvjsOaIWBia3p7VprlAHnSguSMLM0bDD/SeZQtLQm+BmgdSDarb GUEUXmKLJofmxW/ayIRLkEM1RMwOvDxJo/OXHqyLYIsV/s5Z5V7K/lodsrHDSqao5uhT lbMjDKbsCMCa4y7uTzWnybJL3bSJ9Yb+ELwyL7CR/Wuhiga97XiZbwRIU897aNHNKF78 Nr8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=q199CiUVBlIdAJT610Kq4A0Jc7wiSceRqAMwnzZ6+GI=; b=tG5UMi2A9nuXVJJUzxsd+Z9Lbu75QZPSrgG2Ky01bkFn3U0P9/xN5Y0Y/zM13I8m3E 1J9IKiE1JUnTbmUjFV4aL29/Z/ex1hFOtv8AIYME3hzqgSBh2EIw63Z/ydpRMGWcGmwd gQZcq3vQAD+vXyn4yamTeY6Sxpay3wOdvb6Se/pe0V4oZQrfZvWWCJlOjQEYRn2spP3a OKFvU5Tk3By9zUOgD16H7ynByMLPTSFaFRswaZE/ze6ydgTH2uun8DiF6H2ucypOIfIE JujBdMa8DJCdaRifYTv9LjeW3pBus8LrWVKbLrtbbmCGGGwJjlRpz2cE01OjTo0MVVok dZiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 15si9957041ilt.96.2021.09.18.05.11.43; Sat, 18 Sep 2021 05:11:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240260AbhIRC13 (ORCPT + 99 others); Fri, 17 Sep 2021 22:27:29 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:52834 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238376AbhIRC12 (ORCPT ); Fri, 17 Sep 2021 22:27:28 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0Uojdl5R_1631931951; Received: from B-455UMD6M-2027.local(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0Uojdl5R_1631931951) by smtp.aliyun-inc.com(127.0.0.1); Sat, 18 Sep 2021 10:25:52 +0800 Subject: Re: [PATCH v2] sign-file: Fix confusing error messages To: David Howells , David Woodhouse , Herbert Xu , "David S. Miller" , Eric Biggers , Eric Biggers , Mimi Zohar , Vitaly Chikunov , Gilad Ben-Yossef , Pascal van Leeuwen , James Morris , James Morris , keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, Jia Zhang References: <20210624104824.82616-1-tianjia.zhang@linux.alibaba.com> From: Tianjia Zhang Message-ID: Date: Sat, 18 Sep 2021 10:25:50 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210624104824.82616-1-tianjia.zhang@linux.alibaba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ping. On 6/24/21 6:48 PM, Tianjia Zhang wrote: > When an error occurs, use errx() instead of err() to display the > error message, because openssl has its own error record. When an > error occurs, errno will not be changed, while err() displays the > errno error message. It will cause confusion. For example, when > CMS_add1_signer() fails, the following message will appear: > > sign-file: CMS_add1_signer: Success > > errx() ignores errno and does not cause such issue. > > Signed-off-by: Tianjia Zhang > --- > scripts/sign-file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/sign-file.c b/scripts/sign-file.c > index fbd34b8e8f57..37d8760cb0d1 100644 > --- a/scripts/sign-file.c > +++ b/scripts/sign-file.c > @@ -107,7 +107,7 @@ static void drain_openssl_errors(void) > bool __cond = (cond); \ > display_openssl_errors(__LINE__); \ > if (__cond) { \ > - err(1, fmt, ## __VA_ARGS__); \ > + errx(1, fmt, ## __VA_ARGS__); \ > } \ > } while(0) > >