]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2561] Allow wildcards in the target of the "interface" command
authorHarlan Stenn <stenn@ntp.org>
Fri, 28 Feb 2014 06:37:01 +0000 (06:37 +0000)
committerHarlan Stenn <stenn@ntp.org>
Fri, 28 Feb 2014 06:37:01 +0000 (06:37 +0000)
bk: 53102e8d4Oxgk_urZmpOCRvDtn1kGA

ChangeLog
configure.ac
ntpd/ntp_io.c

index 399dcd8ae182d7fb5b2065d4fc31871f9857a8a1..d91f7c2fe860a77fded8f4ccb339db2989f069ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 2561] Allow wildcards in the target of the "interface" command.
 (4.2.7p422) 2014/02/17 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2536] ntpd sandboxing support (libseccomp2).
 (4.2.7p421) 2014/02/10 Released by Harlan Stenn <stenn@ntp.org>
index dcf9ac7d1a9ce585a2bade473885bedef7ba90f3..7613bea59bdf2d2f2b4f67e12dea7fb80113a14d 100644 (file)
@@ -247,7 +247,7 @@ AC_CHECK_HEADER(
            [Use Rendezvous/DNS-SD registration])]
     )]
 )
-AC_CHECK_HEADERS([fcntl.h ieeefp.h inttypes.h kvm.h math.h])
+AC_CHECK_HEADERS([fcntl.h fnmatch.h ieeefp.h inttypes.h kvm.h math.h])
 
 AC_CHECK_HEADERS([memory.h netdb.h poll.h])
 AC_CHECK_HEADERS([sgtty.h stdlib.h string.h termio.h])
@@ -772,7 +772,7 @@ AC_CHECK_FUNCS(
     )]
 )
 
-AC_CHECK_FUNCS([getbootfile getuid getrusage nanosleep strsignal])
+AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal])
 
 # kvm_open() is only used by tickadj.  Also see above.
 case "$ac_cv_header_kvm_h" in
index 28074bc76003d41d81f2e928a8502f6a6fe5149b..10dd92527b153c003f51d627a1ddb8c9eba9cf7c 100644 (file)
@@ -9,6 +9,9 @@
 
 #include <stdio.h>
 #include <signal.h>
+#ifdef HAVE_FNMATCH_H
+# include <fnmatch.h>
+#endif
 #ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #endif
@@ -1356,7 +1359,12 @@ interface_action(
 
                case MATCH_IFNAME:
                        if (if_name != NULL
-                           && !strcasecmp(if_name, rule->if_name)) {
+#ifdef HAVE_FNMATCH
+                           && !fnmatch(rule->if_name, if_name, FNM_CASEFOLD)
+#else
+                           && !strcasecmp(if_name, rule->if_name)
+#endif
+                           ) {
 
                                DPRINTF(4, ("interface name match - %s\n",
                                    action_text(rule->action)));