Documentation ¶
Overview ¶
Package fdfs is like os.DirFS, but with a file descriptor and openat(2), fchownat(2), etc, to ensure symlinks do not escape.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS uses a file descriptor for a directory as the base of a fs.FS.
func DirFS ¶
DirFS opens the directory dir, and returns an FS rooted at that directory. It uses open(2) with O_RDONLY+O_DIRECTORY+O_CLOEXEC. Note that this will resolve symlinks in the path, so only use this to open a trusted base path.
func (*FS) Open ¶
Open wraps openat2(2) with O_RDONLY+O_NOFOLLOW+O_CLOEXEC, and prohibits symlinks etc within the path.
func (*FS) RecursiveChown ¶
RecursiveChown lchowns everything within the receiver.
Click to show internal directories.
Click to hide internal directories.