From 4ee8c5c7a168c4e26afda83f3f87e4f6ef84c5f2 Mon Sep 17 00:00:00 2001 From: hadess <hadess@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:26:46 +0200 Subject: [PATCH] preload: Don't read udev cache data from system Never read the udev cache data from the system, as this might make properties of system devices leak through our mocked udev, such as headsets showing up as internal devices. Fixes #213 --- src/libumockdev-preload.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libumockdev-preload.c b/src/libumockdev-preload.c index db6e310..e83b06f 100644 --- a/src/libumockdev-preload.c +++ b/src/libumockdev-preload.c @@ -185,6 +185,8 @@ trap_path(const char *path) if (strncmp(abspath, "/dev/", 5) == 0 || strcmp(abspath, "/dev") == 0 || strncmp(abspath, "/proc/", 6) == 0) check_exist = 1; + else if (strncmp(abspath, "/run/udev/data", 14) == 0) + check_exist = 0; else if (strncmp(abspath, "/sys/", 5) != 0 && strcmp(abspath, "/sys") != 0) return path;