Discover Packages
github.com/cloud-exit/exitmesh-agent
internal
privdrop
package
Version:
v0.11.0
Opens a new window with list of versions in this module.
Published: Oct 2, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package privdrop re-executes the process as an unprivileged user that keeps selected capabilities as ambient capabilities.
Exec switches the calling thread to t and executes path with argv and env in its place. It returns only on failure,
after which the process must exit because the thread may hold a partial identity.
type Identity struct {
UID int `json:"uid"`
GID int `json:"gid"`
Capabilities []string `json:"capabilities"`
}
Identity is the running process's user and effective capabilities.
Current reads the identity of the running process from /proc/self/status.
Root reports whether the process runs as UID 0.
type Target struct {
UID, GID int
Keep []int
}
Target is the identity to switch to.
ParseTarget parses UID:GID; both must be non-zero.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.