sanitizer

package
v0.0.0-...-70159a5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package sanitizer is a lightweight library that facilitates the safearchive libraries to prevent path traversal attempts by sanitize file paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizePath

func SanitizePath(in string) string

SanitizePath sanitizes the supplied path by purely lexical processing. The return value is safe to be joined together with a base directory (if the basedir is empty and no symlinks are present there). Join(base, SanitizePath(path)) will always produce a path contained within base and Clean(path) will always produce an unrooted path with no ".." path elements. If the input path had a directory separator at the end, the sanitized version will preserve that.

Types

This section is empty.

Jump to

Keyboard shortcuts

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