Skip to content

Commit

Permalink
preload: Don't read udev cache data from system
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hadess authored Jul 17, 2023
1 parent dee9939 commit 4ee8c5c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libumockdev-preload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4ee8c5c

Please sign in to comment.