Documentation
¶
Index ¶
- func CreateTempNoFollow(dir string, pattern string, perm os.FileMode) (*os.File, error)
- func CreateTempNoFollowInRoot(root *os.Root, dir string, pattern string, perm os.FileMode) (*os.File, string, error)
- func OpenAppendNoFollow(path string, perm os.FileMode) (*os.File, error)
- func OpenAppendNoFollowInRoot(root *os.Root, name string, perm os.FileMode) (*os.File, error)
- func OpenExistingAppendNoFollowInRoot(root *os.Root, name string) (*os.File, error)
- func OpenExistingNoFollow(path string) (*os.File, error)
- func OpenExistingNoFollowInRoot(root *os.Root, name string) (*os.File, error)
- func OpenExistingWritableNoFollowInRoot(root *os.Root, name string) (*os.File, error)
- func OpenNewFileNoFollow(path string, perm os.FileMode) (*os.File, error)
- func OpenNewFileNoFollowInRoot(root *os.Root, name string, perm os.FileMode) (*os.File, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTempNoFollow ¶ added in v1.260731.0
CreateTempNoFollow creates a new temporary file in dir using an unpredictable name derived from crypto/rand, an exclusive create, and no-follow semantics.
The pattern follows os.CreateTemp semantics: the last "*" is replaced with random text, or random text is appended when the pattern has no "*".
func CreateTempNoFollowInRoot ¶ added in v1.260731.0
func CreateTempNoFollowInRoot(root *os.Root, dir string, pattern string, perm os.FileMode) (*os.File, string, error)
CreateTempNoFollowInRoot creates a new temporary file beneath root and returns both the file and its root-relative name. Parent resolution stays anchored to root even if a directory is concurrently replaced by a symlink.
func OpenAppendNoFollow ¶ added in v1.260731.0
OpenAppendNoFollow opens a file for appending without following symlinks, creating it when it does not exist.
func OpenAppendNoFollowInRoot ¶ added in v1.260731.0
OpenAppendNoFollowInRoot opens a file for appending relative to root without following the final component or permitting parent traversal outside root.
func OpenExistingAppendNoFollowInRoot ¶ added in v1.260731.0
OpenExistingAppendNoFollowInRoot opens an existing file for atomic appends without following the final component.
func OpenExistingNoFollow ¶
OpenExistingNoFollow opens an existing file without following symlinks.
func OpenExistingNoFollowInRoot ¶ added in v1.260731.0
OpenExistingNoFollowInRoot opens an existing file relative to root without following the final component or permitting parent traversal outside root.
func OpenExistingWritableNoFollowInRoot ¶ added in v1.260731.0
OpenExistingWritableNoFollowInRoot opens an existing file for writing relative to root without following its final component. Opening the existing inode lets callers honor write ACLs and preserve filesystem metadata.
func OpenNewFileNoFollow ¶
OpenNewFileNoFollow creates a new file without following symlinks. Uses O_EXCL to prevent overwriting existing files and O_NOFOLLOW to prevent symlink attacks.
Types ¶
This section is empty.