Documentation
¶
Index ¶
Constants ¶
View Source
const ( PermDir = 0o755 // Directory permission PermOwner = 0o600 // Owner permission PermGroup = 0o640 // Group permission PermPublic = 0o644 // Public permission PermReadOnly = 0o444 // Read-only permission )
Variables ¶
View Source
var ( ErrInvalidFilePath = errors.New("invalid file path") ErrPathTraversal = errors.New("path traversal detected") )
Functions ¶
func InBasePath ¶ added in v0.76.0
InBasePath checks if the given path is within the base path, preventing path traversal attacks.
func IsFile ¶ added in v0.74.0
IsFile checks if the given path is a regular file without any mode bits set (like symlink, socket, named pipe, etc.).
func VerifyAndSanitizePath ¶
VerifyAndSanitizePath checks if a file path is valid and sanitizes it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.