utils

package
v1.0.1-pre Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanControl

func CanControl(username string) bool

check if the current user can do "something" with the selected component

just check if running as root or if a username is specified in the config that the current user matches.

this does not however change the user to match anything, so starting a process still requires a seteuid type change

func GetIDs

func GetIDs(username string) (uid, gid int, gids []int, err error)

func IsSuperuser

func IsSuperuser() bool

func ReadPasswordFile

func ReadPasswordFile(path string) string

func ReadPasswordPrompt

func ReadPasswordPrompt() string

func SetUser

func SetUser(cmd *exec.Cmd, username string) (err error)

set-up the Cmd to set uid, gid and groups of the username given Note: does not change stdout etc. which is done later

Types

This section is empty.

Jump to

Keyboard shortcuts

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