Documentation
¶
Overview ¶
Package localuser resolves the local account a privileged installer or supervisor drops privileges to. It exists because two callers need the same answer and the same refusals: the macOS LaunchDaemon installer (pkg/cli/cmd/launchd.go) and the edge add-on supervisor, which launches a code-execution child from a root agent.
The refusals are the point. uid 0 is rejected, and so is a home directory that is relative or is "/" — a state directory created under "/" would scatter owner-only files across the filesystem root.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
// Username as it appears in the account database.
Username string
// Group is the canonical PRIMARY GROUP NAME, not a gid string: launchd's
// GroupName key is a name field, and numeric values are not portable across
// macOS releases.
Group string
// Home is an absolute, cleaned home directory that is not "/".
Home string
// UID and GID of the account.
UID int
GID int
}
Account is a resolved non-root local account.
func Current ¶
Current resolves the account the calling process already runs as. It applies the same refusals, so a root process never gets an Account back.