fileperm

package
v0.0.0-...-785270f Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fileperm contains functions to check permissions on files.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWriteable is returned for files that are writeable by somebody other than root and process owner.
	ErrWriteable = errors.New("other than user can write")
	// ErrIrregular is returned for files that are not regular files, including symlinks.
	ErrIrregular = errors.New("not a regular file")
	// ErrOwner is returned for files that are owned by anybody but root or process owner.
	ErrOwner = errors.New("not owned by root or process")
)

Functions

func PermissionCheck

func PermissionCheck(file *os.File) error

PermissionCheck verifies that an open file is 1) Regular 2) Not writeable by group/other 3) Owned by root or eUID. Both the file handle and the full path to file are required. The file must have been opened by absolute path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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