Documentation ¶
Overview ¶
Package user allows resolving user UIDs/GIDs using various methods. It also provides an implementation for shifting UIDs/GIDs.
Index ¶
Constants ¶
const DefaultRangeCount = 0x10000
Variables ¶
This section is empty.
Functions ¶
func ShiftFiles ¶ added in v1.16.0
ShiftFiles shifts filesToshift by the amounts specified in uidRange
Types ¶
type Resolver ¶
Resolver defines the interface for resolving a UID/GID.
func IDsFromEtc ¶
IDsFromEtc returns a new UID/GID resolver by parsing etc/passwd, and etc/group relative from the given rootPath looking for the given username, or group. If username is empty string the etc/passwd lookup will be omitted. If group is empty string the etc/group lookup will be omitted.
func IDsFromStat ¶
IDsFromStat returns a new UID/GID resolver deriving the UID/GID from file attributes and unshifts the UID/GID if the given range is not nil. If the given id does not start with a slash "/" an error is returned.
func NumericIDs ¶
NumericIDs returns a resolver that will resolve constant UID/GID values. If the given id equals to "root" the resolver always resolves UID=0 and GID=0. If the given id is a numeric literal i it always resolves UID=i and GID=i. If the given id is neither "root" nor a numeric literal an error is returned.
type UidRange ¶
A UidRange structure used to set uidshift and its range.
func NewBlankUidRange ¶
func NewBlankUidRange() *UidRange