Skip to content

Fix test failures on macOS by resolving symlinks in allowed directories #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

semihbkgr
Copy link
Contributor

Tests were failing on macOS because t.TempDir() returns a directory that is a symlink. The allowedDirs configuration did not include the resolved target of the symlink, causing access checks to fail.

Solution

  • Introduced a helper function resolveAllowedDirs to handle symlink resolution for directories.
  • This function ensures that both the original paths and their resolved symlink counterparts are included in the allowedDirs list.
  • Updated all relevant tests to use resolveAllowedDirs when setting up allowedDirs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant