Wrong exit code on failed SSH signing
- From
- Sergey Kosukhin <skosukhin@gmail.com>
- Date
- Feb 6, 2024, 16:24 UTC
- Message-ID
- <CAGMF1KiFNnr1nFBg2+mRqiurXpxOOXAcoWc0GciRKDoWzpJSkA@mail.gmail.com>
Hello!
There seems to be a bug in the sign_buffer_ssh function in gpg-interface.c: a possible exit code of ssh-keygen is 255, which is returned as-is by sign_buffer_ssh. The problem is that, for example, the function build_tag_object in builtin/tag.c considers only negative values as a failure. Since 255 >= 0, the error message "unable to sign the tag" is not emitted and git exits normally with zero exit code. It might be enough to return -1 in sign_buffer_ssh if ret is not zero.
I am sorry if this has already been reported or taken care of. Thank you.
Best regards, Sergey