diff options
author | Werner Koch <wk@gnupg.org> | 2019-06-03 16:31:58 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2019-06-03 16:33:10 +0200 |
commit | f2ac6742d403a5a95d84ac7cdcf8913c39297bcb (patch) | |
tree | 05fd0377e546f0a8e6ed62fbadd4624415368f7b | |
parent | agent: Add A-flag for KEYINFO output for card. (diff) | |
download | gnupg2-f2ac6742d403a5a95d84ac7cdcf8913c39297bcb.tar.xz gnupg2-f2ac6742d403a5a95d84ac7cdcf8913c39297bcb.zip |
Return better error code for some getinfo IPC commands.
* agent/command.c (cmd_getinfo): Return GPG_ERR_FALSE as boolean False.
* g13/server.c (cmd_getinfo): Ditto.
* sm/server.c (cmd_getinfo): Ditto.
--
GPG_ERR_FALSE was introduced with libgpg-error 1.21 and we now require
a later version for gnupg 2. Thus we can switch to this more
descriptive code.
Signed-off-by: Werner Koch <wk@gnupg.org>
-rw-r--r-- | agent/command.c | 6 | ||||
-rw-r--r-- | g13/server.c | 2 | ||||
-rw-r--r-- | sm/server.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/agent/command.c b/agent/command.c index 460aa1dec..3c2da183c 100644 --- a/agent/command.c +++ b/agent/command.c @@ -3110,7 +3110,7 @@ cmd_getinfo (assuan_context_t ctx, char *line) { cmdopt = line; if (!command_has_option (cmd, cmdopt)) - rc = gpg_error (GPG_ERR_GENERAL); + rc = gpg_error (GPG_ERR_FALSE); } } } @@ -3124,7 +3124,7 @@ cmd_getinfo (assuan_context_t ctx, char *line) } else if (!strcmp (line, "restricted")) { - rc = ctrl->restricted? 0 : gpg_error (GPG_ERR_GENERAL); + rc = ctrl->restricted? 0 : gpg_error (GPG_ERR_FALSE); } else if (ctrl->restricted) { @@ -3158,7 +3158,7 @@ cmd_getinfo (assuan_context_t ctx, char *line) } else if (!strcmp (line, "scd_running")) { - rc = agent_scd_check_running ()? 0 : gpg_error (GPG_ERR_GENERAL); + rc = agent_scd_check_running ()? 0 : gpg_error (GPG_ERR_FALSE); } else if (!strcmp (line, "std_env_names")) { diff --git a/g13/server.c b/g13/server.c index defde6c02..780295214 100644 --- a/g13/server.c +++ b/g13/server.c @@ -530,7 +530,7 @@ cmd_getinfo (assuan_context_t ctx, char *line) { cmdopt = line; if (!command_has_option (cmd, cmdopt)) - err = gpg_error (GPG_ERR_GENERAL); + err = gpg_error (GPG_ERR_FALSE); } } } diff --git a/sm/server.c b/sm/server.c index 98505e26d..77ec07fc0 100644 --- a/sm/server.c +++ b/sm/server.c @@ -1162,14 +1162,14 @@ cmd_getinfo (assuan_context_t ctx, char *line) { cmdopt = line; if (!command_has_option (cmd, cmdopt)) - rc = gpg_error (GPG_ERR_GENERAL); + rc = gpg_error (GPG_ERR_FALSE); } } } } else if (!strcmp (line, "offline")) { - rc = ctrl->offline? 0 : gpg_error (GPG_ERR_GENERAL); + rc = ctrl->offline? 0 : gpg_error (GPG_ERR_FALSE); } else rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT"); |