[apps/genpkey] exit status should not be 0 on output errors #12305
Conversation
If the key is to be serialized or printed as text and the framework returns an error, the app should signal the failure to the user using a non-zero exit status.
|
@mattcaswell this command has been "misbehaving" this way for a very long time and across releases. Yet I don't think these 2 error paths have been triggered often, as excluding the current status of Anyway, one could argue that fixing this bug is changing an established behavior of
|
|
I would rather move |
I like it! I actually fixed it like that first, but later changed to use Fixup pushed! |
|
Travis failure is due to #12306 (the failure was already there, both in 1.1.1 and master, this PR just bring it to the surface!) |
|
|
@richsalz either works for me, I guess both 1 and 2 are valid "failure" exit statuses, but I agree that it does not add much more information than is already reported on the screen to know which of the two is failing. |
|
I only brought it up because there are very few instances where an exit code is meaningful. (Verify, maybe?) |
|
@paulidale Yes, the failures are due to #12306 I'll soon open PRs to fix it in both |
|
Travis failures are expected!
|
|
24 hours has passed since 'approval: done' was set, but this PR has failing CI tests. Once the tests pass it will get moved to 'approval: ready to merge' automatically, alternatively please review and set the label manually. |
If the key is to be serialized or printed as text and the framework returns an error, the app should signal the failure to the user using a non-zero exit status. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from openssl#12305) (cherry picked from commit 5858b18)
If the key is to be serialized or printed as text and the framework returns an error, the app should signal the failure to the user using a non-zero exit status. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from openssl#12305)
If the key is to be serialized or printed as text and the framework returns an error, the app should signal the failure to the user using a non-zero exit status. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from #12305)
TL;DR
If the key is to be serialized or printed as text and the framework returns an error, the app should signal the failure to the user using a non-zero exit status.
History
From
1.1.1-stable(this snippet did not change inmaster, only shifted by a few lines):openssl/apps/genpkey.c
Lines 180 to 199 in 7bdf1ee
The code above has been unchanged (apart from formatting) for the last 14 years.
In case of an error writing the key to a file or in textual form to the terminal, the exit status of the command is still reset to 0.
Branches
This should be fixed both in
masterand in1.1.1