filepathutil

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 3 Imported by: 0

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 IsPathWithinDirectory

func IsPathWithinDirectory(path string, directory string) bool

IsPathWithinDirectory returns true when path resolves inside directory. Both values are canonicalized to handle symlinks and platform-specific case rules.

Types

This section is empty.

Jump to

Keyboard shortcuts

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