From ffe45d3bfba9f94e1b3ceb8bf5da4697208286a5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 28 Feb 2023 11:56:44 +0100 Subject: [PATCH] libmount: treat comma as terminator in mnt_match_options() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- libmount/src/optstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ } -- 2.47.3