Documentation
¶
Overview ¶
Package osutil pkg/util/osutil/errors.go c0-com-util
Package osutil pkg/util/osutil/osutil.go c0-com-util
Package osutil pkg/util/osutil/path_check_unix.go c0-com-util
Package osutil pkg/util/osutil/privileges_unix.go c0-com-util
Package osutil pkg/util/osutil/run.go c0-com-util
Index ¶
- func GainRoot() (int, error)
- func ReleaseRoot(oldUID int) error
- func Run(bin string, args ...string) error
- func RunElevated(bin string, args ...string) error
- func RunElevatedWithResult(bin string, args ...string) ([]byte, error)
- func RunElevatedWithResultReader(bin string, args ...string) (io.Reader, error)
- func RunWithResult(bin string, args ...string) ([]byte, error)
- func RunWithResultReader(bin string, args ...string) (io.Reader, error)
- func UnlinkSocketFiles(socketFiles ...string) error
- type ErrorWithStderr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReleaseRoot ¶
ReleaseRoot releases root privileges, setting `oldUID`.
func RunElevated ¶
RunElevated runs binary with escalation (admin / root)
func RunElevatedWithResult ¶
RunElevatedWithResult runs binary `bin` with `args` returning stdout contents as bytes.
func RunElevatedWithResultReader ¶
RunElevatedWithResultReader runs binary `bin` with `args` returning stdout contents as `io.Reader`
func RunWithResult ¶
RunWithResult runs binary `bin` with `args` returning stdout contents as bytes.
func RunWithResultReader ¶
RunWithResultReader runs binary `bin` with `args` returning stdout contents as `io.Reader`.
func UnlinkSocketFiles ¶
UnlinkSocketFiles removes unix socketFiles from file system
Types ¶
type ErrorWithStderr ¶
ErrorWithStderr is an error raised by the external process. `Err` is an actual error coming from `exec`, while `Stderr` contains stderr output of the process.
func NewErrorWithStderr ¶
func NewErrorWithStderr(err error, stderr []byte) *ErrorWithStderr
NewErrorWithStderr constructs new `ErrorWithStderr`.