pathsafe

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsNUL

func ContainsNUL(p string) bool

ContainsNUL reports whether the input contains a NUL byte.

func IsWindowsDrivePath

func IsWindowsDrivePath(p string) bool

IsWindowsDrivePath reports whether p starts with a Windows drive prefix. Examples: C:\\tmp\\a.txt, D:/tmp/a.txt, E:

func SafeJoin

func SafeJoin(root string, rel string) (string, error)

SafeJoin validates rel and joins it under a trusted root with containment checks.

func ValidatePathHasNoSymlinkComponents

func ValidatePathHasNoSymlinkComponents(p string) error

ValidatePathHasNoSymlinkComponents rejects paths that traverse existing symlink components. Missing suffix components are allowed.

func ValidateSafeFileName

func ValidateSafeFileName(name string) error

ValidateSafeFileName validates an opaque filename intended to be joined under a trusted directory.

func ValidateStoredRelativePath

func ValidateStoredRelativePath(p string) error

ValidateStoredRelativePath validates a stored/snapshot-style relative path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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