]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Match local_name using dns-util
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 11 Nov 2016 11:40:55 +0000 (13:40 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 18 Nov 2016 11:44:21 +0000 (13:44 +0200)
This way it correctly handles wildcards.

src/config/Makefile.am
src/config/config-filter.c

index 5b2166e78ba31aa56d0b992765a859e4d60671ba..4861786315fb721dff13c4244a758f487f8a36ba 100644 (file)
@@ -6,6 +6,7 @@ pkglibexec_PROGRAMS = config
 
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/lib \
+       -I$(top_srcdir)/src/lib-dns \
        -I$(top_srcdir)/src/lib-settings \
        -I$(top_srcdir)/src/lib-master \
        -DPKG_RUNDIR=\""$(rundir)"\" \
index 87a24da26cd7ea1b9fff0028d9a76682f4c225c5..426a32639a65262764cb8007d3ad9f000284e8cb 100644 (file)
@@ -6,6 +6,7 @@
 #include "master-service-settings.h"
 #include "config-parser.h"
 #include "config-filter.h"
+#include "dns-util.h"
 
 struct config_filter_context {
        pool_t pool;
@@ -36,7 +37,7 @@ static bool config_filter_match_rest(const struct config_filter *mask,
        if (mask->local_name != NULL) {
                if (filter->local_name == NULL)
                        return FALSE;
-               if (strcasecmp(filter->local_name, mask->local_name) != 0)
+               if (dns_match_wildcard(filter->local_name, mask->local_name) != 0)
                        return FALSE;
        }
        /* FIXME: it's not comparing full masks */