mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
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>
This commit is contained in:
parent
175d194b5d
commit
f325102375
@ -2887,7 +2887,7 @@ cmd_getinfo (assuan_context_t ctx, char *line)
|
|||||||
{
|
{
|
||||||
cmdopt = line;
|
cmdopt = line;
|
||||||
if (!command_has_option (cmd, cmdopt))
|
if (!command_has_option (cmd, cmdopt))
|
||||||
rc = gpg_error (GPG_ERR_GENERAL);
|
rc = gpg_error (GPG_ERR_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2901,7 +2901,7 @@ cmd_getinfo (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
else if (!strcmp (line, "restricted"))
|
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)
|
else if (ctrl->restricted)
|
||||||
{
|
{
|
||||||
@ -2935,7 +2935,7 @@ cmd_getinfo (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
else if (!strcmp (line, "scd_running"))
|
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"))
|
else if (!strcmp (line, "std_env_names"))
|
||||||
{
|
{
|
||||||
|
@ -530,7 +530,7 @@ cmd_getinfo (assuan_context_t ctx, char *line)
|
|||||||
{
|
{
|
||||||
cmdopt = line;
|
cmdopt = line;
|
||||||
if (!command_has_option (cmd, cmdopt))
|
if (!command_has_option (cmd, cmdopt))
|
||||||
err = gpg_error (GPG_ERR_GENERAL);
|
err = gpg_error (GPG_ERR_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1162,14 +1162,14 @@ cmd_getinfo (assuan_context_t ctx, char *line)
|
|||||||
{
|
{
|
||||||
cmdopt = line;
|
cmdopt = line;
|
||||||
if (!command_has_option (cmd, cmdopt))
|
if (!command_has_option (cmd, cmdopt))
|
||||||
rc = gpg_error (GPG_ERR_GENERAL);
|
rc = gpg_error (GPG_ERR_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strcmp (line, "offline"))
|
else if (!strcmp (line, "offline"))
|
||||||
{
|
{
|
||||||
rc = ctrl->offline? 0 : gpg_error (GPG_ERR_GENERAL);
|
rc = ctrl->offline? 0 : gpg_error (GPG_ERR_FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
|
rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user