changeset 21301:e39750012d11

auth-policy: Allow unsupported attributes in response 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.
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Wed, 14 Dec 2016 11:42:56 +0200
parents 3f4770a7b27c
children f677d31a8211
files src/auth/auth-policy.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth-policy.c	Wed Dec 14 10:32:44 2016 +0200
+++ b/src/auth/auth-policy.c	Wed Dec 14 11:42:56 2016 +0200
@@ -243,12 +243,13 @@
 	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;