#include <config.h>
-#include <fnmatch.h>
-
#include "qemu_firmware.h"
#include "qemu_interop_config.h"
#include "configmake.h"
continue;
for (j = 0; j < fw->targets[i]->nmachines; j++) {
- if (fnmatch(fw->targets[i]->machines[j], machine, 0) == 0)
+ if (g_pattern_match_simple(fw->targets[i]->machines[j], machine))
return true;
}
}
#
# "C=GB,ST=London,L=London,O=Red Hat,CN=*"
#
-# See the POSIX fnmatch function for the format of the wildcards.
+# See the g_pattern_match function for the format of the wildcards:
+#
+# https://developer.gnome.org/glib/stable/glib-Glob-style-pattern-matching.html
#
# NB If this is an empty list, no client can connect, so comment out
# entirely rather than using empty list to disable these checks
#
# "*@EXAMPLE.COM"
#
-# See the POSIX fnmatch function for the format of the wildcards.
+# See the g_pattern_match function for the format of the wildcards.
+#
+# https://developer.gnome.org/glib/stable/glib-Glob-style-pattern-matching.html
#
# NB If this is an empty list, no client can connect, so comment out
# entirely rather than using empty list to disable these checks
#include <config.h>
-#include <fnmatch.h>
-
#include "virnetsaslcontext.h"
#include "virnetmessage.h"
}
while (*wildcards) {
- int rv = fnmatch(*wildcards, identity, 0);
- if (rv == 0) {
+ if (g_pattern_match_simple(*wildcards, identity)) {
ret = 1;
goto cleanup; /* Successful match */
}
- if (rv != FNM_NOMATCH) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Malformed TLS whitelist regular expression '%s'"),
- *wildcards);
- goto cleanup;
- }
wildcards++;
}
#include <config.h>
#include <unistd.h>
-#include <fnmatch.h>
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
const char *const*wildcards)
{
while (*wildcards) {
- int ret = fnmatch(*wildcards, dname, 0);
- if (ret == 0) /* Successful match */
+ if (g_pattern_match_simple(*wildcards, dname))
return 1;
- if (ret != FNM_NOMATCH) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Malformed TLS whitelist regular expression '%s'"),
- *wildcards);
- return -1;
- }
wildcards++;
}
#if HAVE_SYS_UN_H
# include <sys/un.h>
#endif
-#include <fnmatch.h>
#include "virerror.h"
#include "virlog.h"
size_t i;
for (i = 0; i < virLogNbFilters; i++) {
- if (fnmatch(virLogFilters[i]->match, source->name, 0) == 0) {
+ if (g_pattern_match_simple(virLogFilters[i]->match, source->name)) {
priority = virLogFilters[i]->priority;
break;
}
return NULL;
}
- /* We must treat 'foo' as equiv to '*foo*' for fnmatch
+ /* We must treat 'foo' as equiv to '*foo*' for g_pattern_match
* todo substring matches, so add 2 extra bytes
*/
if (VIR_ALLOC_N_QUIET(mdup, mlen + 3) < 0)
#
# "C=GB,ST=London,L=London,O=Red Hat,CN=*"
#
-# See the POSIX fnmatch function for the format of the wildcards.
+# See the g_pattern_match function for the format of the wildcards.
+#
+# https://developer.gnome.org/glib/stable/glib-Glob-style-pattern-matching.html
#
# NB If this is an empty list, no client can connect, so comment out
# entirely rather than using empty list to disable these checks
#
# "*@EXAMPLE.COM"
#
-# See the POSIX fnmatch function for the format of the wildcards.
+# See the g_pattern_match function for the format of the wildcards.
+#
+# https://developer.gnome.org/glib/stable/glib-Glob-style-pattern-matching.html
#
# NB If this is an empty list, no client can connect, so comment out
# entirely rather than using empty list to disable these checks
#
# "C=GB,ST=London,L=London,O=Red Hat,CN=*"
#
-# See the POSIX fnmatch function for the format of the wildcards.
+# See the g_pattern_match function for the format of the wildcards.
+#
+# https://developer.gnome.org/glib/stable/glib-Glob-style-pattern-matching.html
#
# NB If this is an empty list, no client can connect, so comment out
# entirely rather than using empty list to disable these checks
#
# "*@EXAMPLE.COM"
#
-# See the POSIX fnmatch function for the format of the wildcards.
+# See the g_pattern_match function for the format of the wildcards.
+#
+# https://developer.gnome.org/glib/stable/glib-Glob-style-pattern-matching.html
#
# NB If this is an empty list, no client can connect, so comment out
# entirely rather than using empty list to disable these checks
*/
#include <config.h>
-#include <fnmatch.h>
#include <getopt.h>
#include <signal.h>
#include <stdarg.h>
for (i = 0; i < ngroups; i++) {
if (!(gname = virGetGroupName(groups[i])))
continue;
- if (fnmatch(entry, gname, 0) == 0) {
+ if (g_pattern_match_simple(entry, gname)) {
ret = 0;
goto cleanup;
}
VIR_FREE(gname);
}
} else {
- if (fnmatch(entry, name, 0) == 0) {
+ if (g_pattern_match_simple(entry, name)) {
ret = 0;
goto cleanup;
}