systemd/backport-udev-do-not-use-exact-match-of-file-permission.patch
2023-12-06 16:52:45 +08:00

31 lines
1.0 KiB
Diff

From 7a182f10343796eab92a8256e347c11b4be78ea7 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Tue, 7 Jan 2020 19:22:59 +0900
Subject: [PATCH 1154/1760] udev: do not use exact match of file permission
This partially reverts 25de7aa7b90c23d33ea50ada1e50c5834a414237.
Fixes #14473.
Reference: https://github.com/systemd/systemd/commit/7a182f10343796eab92a8256e347c11b4be78ea7
Conflict: NA
---
src/udev/udev-rules.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 6168b33..b9b350d 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1654,7 +1654,7 @@ static int udev_rule_apply_token_to_event(
if (mode == MODE_INVALID)
return token->op == OP_MATCH;
- match = (((statbuf.st_mode ^ mode) & 07777) == 0);
+ match = (statbuf.st_mode & mode) > 0;
return token->op == (match ? OP_MATCH : OP_NOMATCH);
}
case TK_M_PROGRAM: {
--
1.8.3.1