package openat
import "github.com/hanwen/go-fuse/v2/internal/openat"
Index ¶
Functions ¶
func OpenSymlinkAware ¶
OpenSymlinkAware is a symlink-aware syscall.Open replacement.
What it does:
Open baseDir (usually an absolute path), following symlinks.
The user may have set up the directory tree with symlinks, that's not neccessarily malicous, but a normal use case.
Open path (must be a relative path) within baseDir, rejecting symlinks with ELOOP.
On Linux, it calls openat2(2) with RESOLVE_NO_SYMLINKS. This prevents following symlinks in any component of the path.
On other platforms, it calls openat(2) with O_NOFOLLOW. TODO: This is insecure as O_NOFOLLOW only affects the final path component.
Source Files ¶
- Version
- v2.8.0 (latest)
- Published
- Jun 11, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 9 hours ago –
Tools for package owners.