osutil – github.com/tredoe/osutil Index | Files | Directories

package osutil

import "github.com/tredoe/osutil"

Index

Variables

var ErrNoRoot = errors.New("MUST have administrator privileges")

Functions

func Exec

func Exec(cmd string, args ...string) error

Exec executes a command setting both standard input, output and error.

func ExecSudo

func ExecSudo(cmd string, args ...string) error

ExecSudo executes a command under "sudo".

func MustbeRoot

func MustbeRoot() error

MustbeRoot returns an error message if the user is not root.

func Sudo

func Sudo() error

Sudo executes command "sudo". If some command needs to use "sudo", then could be used this function at the beginning so there is not to wait until that it been requested later.

Source Files

osutil.go

Directories

PathSynopsis
config
config/envPackage env implements the setting of persistent environment variables.
config/shconfPackage shconf implements a parser and scanner for the configuration in format shell-variable.
distroPackage distro detects the Linux distribution.
filePackage file handles common operations in files.
internal
pkgutilPackage pkgutil handles basic operations in the management of packages in operating systems.
shPackage sh interprets a command line just like it is done in the Bash shell.
userPackage user provides access to UNIX users database in local files.
user/cryptPackage crypt provides interface for password crypt functions and collects common constants.
user/crypt/apr1_cryptPackage apr1_crypt implements the standard Unix MD5-crypt algorithm created by Poul-Henning Kamp for FreeBSD, and modified by the Apache project.
user/crypt/commonPackage common contains routines used by multiple password hashing algorithms.
user/crypt/md5_cryptPackage md5_crypt implements the standard Unix MD5-crypt algorithm created by Poul-Henning Kamp for FreeBSD.
user/crypt/sha256_cryptPackage sha256_crypt implements Ulrich Drepper's SHA256-crypt password hashing algorithm.
user/crypt/sha512_cryptPackage sha512_crypt implements Ulrich Drepper's SHA512-crypt password hashing algorithm.
Version
v1.5.0 (latest)
Published
Jun 4, 2024
Platform
linux/amd64
Imports
3 packages
Last checked
1 day ago

Tools for package owners.