package user
import "github.com/coreos/rkt/pkg/user"
Package user allows resolving user UIDs/GIDs using various methods. It also provides an implementation for shifting UIDs/GIDs.
Index ¶
- Constants
- func ShiftFiles(filesToShift []string, uidRange *UidRange) error
- type Resolver
- func IDsFromEtc(rootPath, username, group string) (Resolver, error)
- func IDsFromStat(rootPath, file string, r *UidRange) (Resolver, error)
- func NumericIDs(id string) (Resolver, error)
- type UidRange
- func NewBlankUidRange() *UidRange
- func (r *UidRange) Deserialize(uidRange []byte) error
- func (r *UidRange) Serialize() []byte
- func (r *UidRange) SetRandomUidRange(uidCount uint32)
- func (r *UidRange) ShiftRange(uid uint32, gid uint32) (uint32, uint32, error)
- func (r *UidRange) UnshiftRange(uid, gid uint32) (uint32, uint32, error)
Constants ¶
const DefaultRangeCount = 0x10000
Functions ¶
func ShiftFiles ¶
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
func (*UidRange) Deserialize ¶
func (*UidRange) Serialize ¶
func (*UidRange) SetRandomUidRange ¶
func (*UidRange) ShiftRange ¶
func (*UidRange) UnshiftRange ¶
Source Files ¶
doc.go resolver.go uid_range.go util.go
- Version
- v1.30.0 (latest)
- Published
- Apr 13, 2018
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 2 weeks ago –
Tools for package owners.