]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Fixed allow_nets=local to work correctly with non-local remote IP
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 5 Jan 2016 16:08:01 +0000 (11:08 -0500)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 5 Jan 2016 16:08:01 +0000 (11:08 -0500)
src/auth/auth-request.c

index 9d9d2274c50f5f1fb36972cdcbb10393676510d0..a61c8eb6862196b924e190031c7a93b8c8e029fb 100644 (file)
@@ -1335,12 +1335,12 @@ auth_request_validate_networks(struct auth_request *request,
                auth_request_log_debug(request, AUTH_SUBSYS_DB,
                        "%s: Matching for network %s", name, *net);
 
-               if (strcmp(*net, "local") == 0 && remote_ip->family == 0) {
-                       found = TRUE;
-                       break;
-               }
-
-               if (net_parse_range(*net, &net_ip, &bits) < 0) {
+               if (strcmp(*net, "local") == 0) {
+                       if (remote_ip->family == 0) {
+                               found = TRUE;
+                               break;
+                       }
+               } else if (net_parse_range(*net, &net_ip, &bits) < 0) {
                        auth_request_log_info(request, AUTH_SUBSYS_DB,
                                "%s: Invalid network '%s'", name, *net);
                } else if (remote_ip->family != 0 &&