pathutil

package
v0.0.0-...-cae741c Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package pathutil provides shared relative-path validation for the sync tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanRel

func CleanRel(rel string) (string, error)

CleanRel validates and normalizes a slash-separated relative path for use as an index key and os.Root name. It rejects empty, absolute, non-local, and "." paths, and any reserved path component.

CleanRel does not bind to a root directory; callers that need escape checks against a concrete Dir should join and re-validate with filepath.Rel.

func IsReservedComponent

func IsReservedComponent(name string) bool

IsReservedComponent reports whether a single path component is reserved for tailsync state. Scan skips these directories; peer path validation rejects any path that contains them so StateDir (Dir/.tailsync) cannot be targeted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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