Documentation
¶
Overview ¶
Package fsutil holds small filesystem helpers that refuse to follow symlinks. App directories can contain files that did not come from SimpleDeploy (git sync pulls, container bind mounts), so reads and writes of managed files (docker-compose.yml, .env, sidecars) must never be redirected to a path outside the app directory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotRegular = errors.New("not a regular file")
ErrNotRegular is returned when a path is a symlink, directory, device or any other non-regular file.
Functions ¶
func EnsureNoSymlinks ¶
EnsureNoSymlinks verifies that every existing path component of target below root (including target itself) is not a symlink. Components that do not exist yet are allowed. target must be inside root.
func OpenRegularFile ¶
OpenRegularFile opens path read-only, refusing symlinks and non-regular files. Callers must close the returned file.
func ReadRegularFile ¶
ReadRegularFile reads path, refusing symlinks and non-regular files.
Types ¶
This section is empty.