bytecodealliance / bytecodealliance/cap-std
Use O_NOFOLLOW_ANY on macOS
Open
enhancement
- Dominant language
- Rust
- Stars
- 821
- Forks
- 57
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 4
Description
According to [this blog post](https://blog.malwarebytes.com/mac/2021/08/macos-11s-hidden-security-improvements/#O_NOFOLLOW_ANY), macos 11 has a new `O_NOFOLLOW_ANY` flag that causes `open` to fail if any path component is a symlink. Assuming symlinks are relatively rare, cap-std could use this as a fast path -- check that the path contains no explicit `..` and then open with `O_NOFOLLOW_ANY`; if that succeeds, then we're done. If either of those fails, open with the slow path.
Contributor guide
Assessment
This issue has not been assessed yet.