From 53b6bb337d8af77006638b351e4df27fb668c7af Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sun, 14 Sep 2014 13:58:16 -0400 Subject: [PATCH] Fix potentially returning the wrong RC. --- src/commands.c | 2 +- src/pwmd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands.c b/src/commands.c index e5cf4f3a..659b0006 100644 --- a/src/commands.c +++ b/src/commands.c @@ -4101,7 +4101,7 @@ command_finalize (assuan_context_t ctx, gpg_error_t rc) if (!(client->flags & FLAG_LOCK_CMD)) unlock_file_mutex (client, 0); - log_write1 (_("command completed: rc=%u"), client->last_rc); + log_write1 (_("command completed: rc=%u"), rc ? rc : client->last_rc); client->last_rc = gpg_error (GPG_ERR_UNKNOWN_COMMAND); #ifdef WITH_GNUTLS client->thd->buffer_timeout = client->thd->last_buffer_size = 0; diff --git a/src/pwmd.c b/src/pwmd.c index 9c07b5b2..f576b7b7 100644 --- a/src/pwmd.c +++ b/src/pwmd.c @@ -637,7 +637,7 @@ do_validate_peer (assuan_context_t ctx, const char *section, strv_free (users); } - return allowed ? 0 : GPG_ERR_INV_USER_ID; + return allowed ? 0 : rc ? rc : GPG_ERR_INV_USER_ID; } gpg_error_t -- 2.11.4.GIT