]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth-policy: Allow unsupported attributes in response
authorAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 14 Dec 2016 09:42:56 +0000 (11:42 +0200)
committerGitLab <gitlab@git.dovecot.net>
Wed, 14 Dec 2016 15:33:39 +0000 (17:33 +0200)
Do not choke if we receive unsupported attributes in
response. This allows better interoperability with
different systems that are getting signals from
auth policy server that are not (yet) supported by
dovecot.

src/auth/auth-policy.c

index ff37b196afbf42fd1d77681aec33af3771041921..7bee37643241c0ba72793245db5700032629efe6 100755 (executable)
@@ -243,12 +243,13 @@ void auth_policy_parse_response(struct policy_lookup_ctx *context)
        while((ret = json_parse_next(context->parser, &type, &value)) == 1) {
                if (context->parse_state == POLICY_RESULT) {
                        if (type != JSON_TYPE_OBJECT_KEY)
-                               break;
+                               continue;
                        else if (strcmp(value, "status") == 0)
                                context->parse_state = POLICY_RESULT_VALUE_STATUS;
                        else if (strcmp(value, "msg") == 0)
                                context->parse_state = POLICY_RESULT_VALUE_MESSAGE;
-                       else break;
+                       else
+                               continue;
                } else if (context->parse_state == POLICY_RESULT_VALUE_STATUS) {
                        if (type != JSON_TYPE_NUMBER || str_to_int(value, &(context->result)) != 0)
                                break;