Documentation
¶
Overview ¶
Package filepathutil provides utilities for safe filepath operations, particularly for sandboxing file access in template environments.
It includes functions to check if a path is contained within a directory, with proper canonicalization to handle symlinks and platform-specific path differences (such as case sensitivity on Windows).
TODO(dwisiswant0): This package should be moved to the github.com/projectdiscovery/utils/filepath, but let see how it goes first.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsHardLinkedRegularFile ¶ added in v3.11.0
IsHardLinkedRegularFile reports whether path is a regular file with more than one hard link. Symlinks and non-regular files return false, as does the case where the link count cannot be determined (e.g. on Windows).
func IsPathWithinAnyDirectory ¶ added in v3.9.0
IsPathWithinAnyDirectory returns true when path resolves inside any directory.
func IsPathWithinDirectory ¶
IsPathWithinDirectory returns true when path resolves inside directory. Both values are canonicalized to handle symlinks and platform-specific case rules.
An empty path or empty directory always returns false; callers that want to anchor on the working directory must pass it explicitly via os.Getwd().
Types ¶
This section is empty.