]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
compare: drop use of FNM_EXTMATCH for now
authorLennart Poettering <lennart@poettering.net>
Fri, 26 Aug 2022 14:31:30 +0000 (16:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 1 Sep 2022 21:15:14 +0000 (23:15 +0200)
None of our other fnmatch() calls make use of this, and the concept was
new to me at least. Given that this is only used for the recently added
SMBIOS field matches (and is not included in any release) let's disable
"extended" matches for now. We can certainly revisit this, and enable it
later if there is real demand, but if we do, we should probably add that
all over the place, not just for smbios matches.

src/shared/compare-operator.c

index 4baf57a35dfb9a39b0e6ff0ae6c5a03799cc39bf..a5b6c1ac6b97bed6f53f13141e0ccf31b5966039 100644 (file)
@@ -74,10 +74,10 @@ int version_or_fnmatch_compare(
         switch (op) {
 
         case COMPARE_FNMATCH_EQUAL:
-                return fnmatch(b, a, FNM_EXTMATCH) != FNM_NOMATCH;
+                return fnmatch(b, a, 0) != FNM_NOMATCH;
 
         case COMPARE_FNMATCH_UNEQUAL:
-                return fnmatch(b, a, FNM_EXTMATCH) == FNM_NOMATCH;
+                return fnmatch(b, a, 0) == FNM_NOMATCH;
 
         case _COMPARE_OPERATOR_ORDER_FIRST..._COMPARE_OPERATOR_ORDER_LAST:
                 return test_order(strverscmp_improved(a, b), op);