]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
string-util: do not accept ',' in version strings
authorLennart Poettering <lennart@amutable.com>
Tue, 14 Jul 2026 12:42:49 +0000 (14:42 +0200)
committerLennart Poettering <lennart@amutable.com>
Tue, 14 Jul 2026 20:32:27 +0000 (22:32 +0200)
Allowing this apparently has been cargo-culted from my initial sysupdate
PR, but Claude and me could not find a single other software package
that uses "," as a character within version strings. Hence, let's remove
this, even though this is a compat breakage of a kind, in the hope
nobody notices. We can easily restore this if this later shows to be an
issue for people.

src/basic/string-util.c

index 1dc90d538ad01f5f3e259ebdddb264832de9a30d..3d3114612c36564bdd1cd2c66d5c04c01d51578f 100644 (file)
@@ -1469,8 +1469,8 @@ bool version_is_valid(const char *s) {
         if (!filename_part_is_valid(s))
                 return false;
 
-        /* This is a superset of the characters used by semver. We additionally allow "," and "_". */
-        if (!in_charset(s, ALPHANUMERICAL ".,_-+"))
+        /* This is a superset of the characters used by semver. We additionally allow "_". */
+        if (!in_charset(s, ALPHANUMERICAL "._-+"))
                 return false;
 
         return true;