summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-04-25 19:09:55 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-04-26 09:51:08 +0900
commit2b43ab00b08a052fc0077dd20f111c474730ad52 (patch)
treefdd9c845016d42c1b396b26e821407e75bdfe8ea /src/udev
parent9203abf79f1d05fdef9b039e7addf9fc5a27752d (diff)
downloadsystemd-2b43ab00b08a052fc0077dd20f111c474730ad52.tar.gz
udev-rules: fix negative match rule for SYMLINK and TAG
Fixes #27396.
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-rules.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index e3d2adbafd..d6e701f3cc 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1896,7 +1896,7 @@ static int udev_rule_apply_token_to_event(
const char *val;
FOREACH_DEVICE_DEVLINK(dev, val)
- if (token_match_string(token, strempty(startswith(val, "/dev/"))))
+ if (token_match_string(token, strempty(startswith(val, "/dev/"))) == (token->op == OP_MATCH))
return token->op == OP_MATCH;
return token->op == OP_NOMATCH;
}
@@ -1926,7 +1926,7 @@ static int udev_rule_apply_token_to_event(
const char *val;
FOREACH_DEVICE_CURRENT_TAG(dev, val)
- if (token_match_string(token, val))
+ if (token_match_string(token, val) == (token->op == OP_MATCH))
return token->op == OP_MATCH;
return token->op == OP_NOMATCH;
}