overlayutils

package
v26.0.0-rc3+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrDTypeNotSupported

func ErrDTypeNotSupported(driver, backingFs string) error

ErrDTypeNotSupported denotes that the backing filesystem doesn't support d_type.

func GenerateID

func GenerateID(l int, logger *log.Entry) string

GenerateID creates a new random string identifier with the given length

func GetOverlayXattr

func GetOverlayXattr(name string) string

GetOverlayXattr combines the overlay module's xattr class with the named xattr -- `user` when mounted inside a user namespace, and `trusted` when mounted in the 'root' namespace.

func NeedsUserXAttr

func NeedsUserXAttr(d string) (bool, error)

NeedsUserXAttr returns whether overlayfs should be mounted with the "userxattr" mount option.

The "userxattr" option is needed for mounting overlayfs inside a user namespace with kernel >= 5.11.

The "userxattr" option is NOT needed for the initial user namespace (aka "the host").

Also, Ubuntu (since circa 2015) and Debian (since 10) with kernel < 5.11 can mount the overlayfs in a user namespace without the "userxattr" option.

The corresponding kernel commit: https://github.com/torvalds/linux/commit/2d2f2d7322ff43e0fe92bf8cccdc0b09449bf2e1 > ovl: user xattr > > Optionally allow using "user.overlay." namespace instead of "trusted.overlay." > ... > Disable redirect_dir and metacopy options, because these would allow privilege escalation through direct manipulation of the > "user.overlay.redirect" or "user.overlay.metacopy" xattrs. > ...

The "userxattr" support is not exposed in "/sys/module/overlay/parameters".

func SupportsOverlay

func SupportsOverlay(d string, checkMultipleLowers bool) error

SupportsOverlay checks if the system supports overlay filesystem by performing an actual overlay mount.

checkMultipleLowers parameter enables check for multiple lowerdirs, which is required for the overlay2 driver.

Types

This section is empty.

Jump to

Keyboard shortcuts

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