Skip to content

Commit

Permalink
Handle proc fs as usual if mounted somewhere else than /proc
Browse files Browse the repository at this point in the history
For /proc, we need directory mode "read only",
but we only checked for fstype being "proc" and not for the path.
This meant that BenchExec would mount proc mounts
in other places than /proc as read only and ignore the directory mode
specified by the user.
This creates problems if the parent directory is hidden, for example.

Fixes #988
  • Loading branch information
PhilippWendler committed Feb 12, 2024
1 parent dfe81d6 commit bae5804
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benchexec/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def determine_directory_mode(dir_modes, path, fstype=None):
From a high-level mapping of desired directory modes, determine the actual mode
for a given directory.
"""
if fstype == b"proc":
if path == b"/proc" and fstype == b"proc":
# proc is necessary for the grandchild to read PID, will be replaced later.
return DIR_READ_ONLY
if util.path_is_below(path, b"/proc"):
Expand Down

0 comments on commit bae5804

Please sign in to comment.