From: Harlan Stenn Date: Fri, 28 Feb 2014 06:37:01 +0000 (+0000) Subject: [Bug 2561] Allow wildcards in the target of the "interface" command X-Git-Tag: NTP_4_2_7P426~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1aa10bf6ca443fba0e3304e8c6ab5d05bf9a173;p=thirdparty%2Fntp.git [Bug 2561] Allow wildcards in the target of the "interface" command bk: 53102e8d4Oxgk_urZmpOCRvDtn1kGA --- diff --git a/ChangeLog b/ChangeLog index 399dcd8ae..d91f7c2fe 100644 --- 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 * [Bug 2536] ntpd sandboxing support (libseccomp2). (4.2.7p421) 2014/02/10 Released by Harlan Stenn diff --git a/configure.ac b/configure.ac index dcf9ac7d1..7613bea59 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 28074bc76..10dd92527 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -9,6 +9,9 @@ #include #include +#ifdef HAVE_FNMATCH_H +# include +#endif #ifdef HAVE_SYS_PARAM_H # include #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)));