]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth-policy: Do not allow/report when master query
authorAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 29 Jun 2016 11:12:29 +0000 (14:12 +0300)
committerGitLab <gitlab@git.dovecot.net>
Wed, 29 Jun 2016 11:14:25 +0000 (14:14 +0300)
This way auth policy isn't consulted when e.g. doveadm is used.

src/auth/policy.c

index 32820f18a4936a17bab4f207aa11ef75f6af5fda..6d9fbf151fdb981f13a67c30de46019e5197e5b9 100755 (executable)
@@ -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);