* [PATCH v2] sign-file: Fix confusing error messages
@ 2021-06-24 10:48 Tianjia Zhang
2021-09-18 2:25 ` Tianjia Zhang
2022-06-17 9:24 ` Tianjia Zhang
0 siblings, 2 replies; 4+ messages in thread
From: Tianjia Zhang @ 2021-06-24 10:48 UTC (permalink / raw)
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, linux-kernel, Jia Zhang
Cc: Tianjia Zhang
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 <tianjia.zhang@linux.alibaba.com>
---
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)
--
2.19.1.3.ge56e4f7
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] sign-file: Fix confusing error messages
2021-06-24 10:48 [PATCH v2] sign-file: Fix confusing error messages Tianjia Zhang
@ 2021-09-18 2:25 ` Tianjia Zhang
2022-06-17 9:24 ` Tianjia Zhang
1 sibling, 0 replies; 4+ messages in thread
From: Tianjia Zhang @ 2021-09-18 2:25 UTC (permalink / raw)
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, linux-kernel, Jia Zhang
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 <tianjia.zhang@linux.alibaba.com>
> ---
> 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)
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] sign-file: Fix confusing error messages
2021-06-24 10:48 [PATCH v2] sign-file: Fix confusing error messages Tianjia Zhang
2021-09-18 2:25 ` Tianjia Zhang
@ 2022-06-17 9:24 ` Tianjia Zhang
2022-06-26 6:14 ` Jarkko Sakkinen
1 sibling, 1 reply; 4+ messages in thread
From: Tianjia Zhang @ 2022-06-17 9:24 UTC (permalink / raw)
To: Jarkko Sakkinen
Cc: 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, linux-kernel
Hi Jarkko,
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 <tianjia.zhang@linux.alibaba.com>
> ---
> 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)
>
Likewise, No response from David, can you pick this? thanks.
Best regards,
Tianjia
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] sign-file: Fix confusing error messages
2022-06-17 9:24 ` Tianjia Zhang
@ 2022-06-26 6:14 ` Jarkko Sakkinen
0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2022-06-26 6:14 UTC (permalink / raw)
To: Tianjia Zhang
Cc: 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, linux-kernel
On Fri, Jun 17, 2022 at 05:24:55PM +0800, Tianjia Zhang wrote:
> Hi Jarkko,
>
> 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 <tianjia.zhang@linux.alibaba.com>
> > ---
> > 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)
>
> Likewise, No response from David, can you pick this? thanks.
>
> Best regards,
> Tianjia
Ditto.
BR, Jarkko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-26 6:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-24 10:48 [PATCH v2] sign-file: Fix confusing error messages Tianjia Zhang
2021-09-18 2:25 ` Tianjia Zhang
2022-06-17 9:24 ` Tianjia Zhang
2022-06-26 6:14 ` Jarkko Sakkinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox