mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
sm: Emit STATUS_FAILURE for non-implemented commands.
* sm/gpgsm.c (main): Do it here.
This commit is contained in:
parent
ea28689547
commit
0d223fa9b0
16
sm/gpgsm.c
16
sm/gpgsm.c
@ -1837,11 +1837,17 @@ main ( int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case aSignEncr: /* sign and encrypt the given file */
|
case aSignEncr: /* sign and encrypt the given file */
|
||||||
log_error ("this command has not yet been implemented\n");
|
log_error ("the command '%s' has not yet been implemented\n",
|
||||||
|
"--sign --encrypt");
|
||||||
|
gpgsm_status_with_error (&ctrl, STATUS_FAILURE, "option-parser",
|
||||||
|
gpg_error (GPG_ERR_NOT_IMPLEMENTED));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case aClearsign: /* make a clearsig */
|
case aClearsign: /* make a clearsig */
|
||||||
log_error ("this command has not yet been implemented\n");
|
log_error ("the command '%s' has not yet been implemented\n",
|
||||||
|
"--clearsign");
|
||||||
|
gpgsm_status_with_error (&ctrl, STATUS_FAILURE, "option-parser",
|
||||||
|
gpg_error (GPG_ERR_NOT_IMPLEMENTED));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case aVerify:
|
case aVerify:
|
||||||
@ -2068,8 +2074,10 @@ main ( int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_error (_("invalid command (there is no implicit command)\n"));
|
log_error (_("invalid command (there is no implicit command)\n"));
|
||||||
break;
|
gpgsm_status_with_error (&ctrl, STATUS_FAILURE, "option-parser",
|
||||||
|
gpg_error (GPG_ERR_MISSING_ACTION));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print the audit result if needed. */
|
/* Print the audit result if needed. */
|
||||||
|
@ -1474,7 +1474,7 @@ gpgsm_status_with_err_code (ctrl_t ctrl, int no, const char *text,
|
|||||||
{
|
{
|
||||||
char buf[30];
|
char buf[30];
|
||||||
|
|
||||||
sprintf (buf, "%u", (unsigned int)ec);
|
snprintf (buf, sizeof buf, "%u", (unsigned int)ec);
|
||||||
if (text)
|
if (text)
|
||||||
return gpgsm_status2 (ctrl, no, text, buf, NULL);
|
return gpgsm_status2 (ctrl, no, text, buf, NULL);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user