secureopen

package
v0.4.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecureOpen

func SecureOpen(path string, allowedDirs ...string) (*os.File, error)

SecureOpen opens a file after verifying it resolves within one of the allowedDirs. It cleans the path, resolves symlinks, and checks the resolved path is within bounds.

func SecureOpenFile

func SecureOpenFile(path string, flag int, perm os.FileMode, allowedDirs ...string) (*os.File, error)

SecureOpenFile opens a file with custom flags and permissions after path validation.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL