fsperm

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirPerm  os.FileMode = 0700
	FilePerm os.FileMode = 0600
)

Variables

This section is empty.

Functions

func SecureDir

func SecureDir(dir string) error

SecureDir creates dir (and any parents) if needed and sets it to owner-only access (DirPerm, 0700). The Chmod also applies to a pre-existing directory, remediating installs created with looser permissions.

func SecureFile

func SecureFile(path string) error

SecureFile sets an existing file to owner-only read/write (FilePerm, 0600). It is a no-op if the file does not exist yet, so callers may invoke it defensively on optional files.

Types

This section is empty.

Jump to

Keyboard shortcuts

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