From: Karel Zak Date: Tue, 28 Feb 2023 10:56:44 +0000 (+0100) Subject: libmount: treat comma as terminator in mnt_match_options() X-Git-Tag: v2.39-rc1~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ffe45d3bfba9f94e1b3ceb8bf5da4697208286a5;p=thirdparty%2Futil-linux.git libmount: treat comma as terminator in mnt_match_options() An alone "no" in the pattern is interpreted as an error; it should be also valid in case the keyword is followed by a comma, e.g. mnt_match_options("bla", "no,,"); Suggested-by: Sören Tempel Signed-off-by: Karel Zak --- diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c index 4fbbb08595..a0056c767f 100644 --- a/libmount/src/optstr.c +++ b/libmount/src/optstr.c @@ -865,7 +865,7 @@ int mnt_match_options(const char *optstr, const char *pattern) name++, namesz--; else if ((no = (startswith(name, "no") != NULL))) { name += 2, namesz -= 2; - if (!*name) { + if (!*name || *name == ',') { match = 0; break; /* alone "no" keyword is error */ }