From d35bb9e2d725d1ceb747dfc6487c1b89480c7e4e Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Wed, 29 Jun 2016 14:12:29 +0300 Subject: [PATCH] auth-policy: Do not allow/report when master query This way auth policy isn't consulted when e.g. doveadm is used. --- src/auth/policy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/auth/policy.c b/src/auth/policy.c index 32820f18a4..6d9fbf151f 100755 --- a/src/auth/policy.c +++ b/src/auth/policy.c @@ -495,7 +495,7 @@ void auth_policy_url(struct policy_lookup_ctx *context, const char *command) void auth_policy_check(struct auth_request *request, const char *password, auth_policy_callback_t cb, void *context) { - if (*(request->set->policy_server_url) == '\0') { + if (request->master != NULL || *(request->set->policy_server_url) == '\0') { cb(0, context); return; } @@ -518,6 +518,9 @@ void auth_policy_check(struct auth_request *request, const char *password, void auth_policy_report(struct auth_request *request) { + if (request->master != NULL) + return; + if (*(request->set->policy_server_url) == '\0') return; pool_t pool = pool_alloconly_create("auth policy", 128); -- 2.47.3