]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm-http: Fixed crash on unknown commands.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 29 Feb 2016 08:31:37 +0000 (10:31 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 29 Feb 2016 10:22:24 +0000 (12:22 +0200)
Also if command had already failed, don't override the existing method_err with 403.

src/doveadm/client-connection-http.c

index b15cb5a7b54977b68b855b9becfd72525c1bcea1..076116a1a5e457a69ed5d1fc686133190f3fc39f 100644 (file)
@@ -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) {