]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
condition: allow literal string compares in SMBIOS condition
authorLennart Poettering <lennart@poettering.net>
Mon, 29 Aug 2022 09:10:38 +0000 (11:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 1 Sep 2022 21:16:13 +0000 (23:16 +0200)
This ensures that "=" and "!=" are now interpreted as literal string
compares, and "==" and "<>" are for version compares.

This is not a compat break, since the SMBIOS stuff has not been included
in any release yet.

Main reason to do this, is to be systematic with the other conditions
that check for text stuff.

src/shared/condition.c

index f893937156fa25d05c29f5716716d42ce97b2dc7..6c8023143b821ecf37dae7e087feb78a36868af7 100644 (file)
@@ -528,7 +528,7 @@ static int condition_test_firmware_smbios_field(const char *expression) {
         delete_trailing_chars(field, WHITESPACE);
 
         /* Parse operator */
-        operator = parse_compare_operator(&expression, COMPARE_ALLOW_FNMATCH);
+        operator = parse_compare_operator(&expression, COMPARE_ALLOW_FNMATCH|COMPARE_EQUAL_BY_STRING);
         if (operator < 0)
                 return operator;