Skip to content

Commit

Permalink
doveadm-http: Fixed crash on unknown commands.
Browse files Browse the repository at this point in the history
Also if command had already failed, don't override the existing method_err with 403.
  • Loading branch information
sirainen committed Feb 29, 2016
1 parent a81dccf commit ec862f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doveadm/client-connection-http.c
Expand Up @@ -279,7 +279,7 @@ doveadm_http_server_command_execute(struct client_connection_http *conn)
struct doveadm_cmd_context cctx;

/* final preflight check */
if (!doveadm_client_is_allowed_command(conn->client.set, conn->cmd->name))
if (conn->method_err == 0 && !doveadm_client_is_allowed_command(conn->client.set, conn->cmd->name))
conn->method_err = 403;
if (conn->method_err != 0) {
if (conn->method_err == 404) {
Expand Down

0 comments on commit ec862f5

Please sign in to comment.