Page MenuHome GnuPG

gpg --edit-key silently does nothing
Closed, ResolvedPublic

Description

Good day,

I'm helping a litle with the gnupg package on Debian. We think, we found a bug
in gnupg, a normal bug.

  • Starts forwarded bug --

Package: gnupg
Version: 1.4.12
Severity: normal

If you try to edit a key with an unrecognized id, GPG doesn't print
anything other than its usual copyright banner, and exits zero. With
`--no-greeting', it prints nothing at all.

[ponder ~]gpg --no-greeting --edit-key notexist
[ponder ~]echo $?
0

This isn't a helpful indication that one has typed a keyid wrongly. By
contrast, `--list-keys notexist' reports

gpg: error reading key: public key not found

and exits with status 2.

  • End of forwarded bug --

Hope this could be solved soon.

Details

Version
1.4.12

Event Timeline

gatuno added projects: gnupg, Bug Report.
gatuno added a subscriber: gatuno.

For backward compatibility I don't think it is a good idea to change the exit
code. However, printing a diagnostic is a good idea.

Well, then gpg will print a diagnostic message?

Sounds ok.

Yes, we can do this for 2.1. In case there is an already translated string
available we can backport this also to 1.4 and 2.0.

Done for 1.4.15 and 2.0.22 to be released today.

werner claimed this task.