lxd: github.com/lxc/lxd/shared/idmap Index | Files

package idmap

import "github.com/lxc/lxd/shared/idmap"

Index

Package Files

empty.go idmapset_linux.go shift_linux.go

Constants

const VFS3FscapsSupported int32 = 1
const VFS3FscapsUnknown int32 = -1
const VFS3FscapsUnsupported int32 = 0

Variables

var ErrHostIdIsSubId = fmt.Errorf("Host id is in the range of subids")
var VFS3Fscaps int32 = VFS3FscapsUnknown

func GetCaps Uses

func GetCaps(path string) ([]byte, error)

GetCaps extracts the list of capabilities effective on the file

func SetCaps Uses

func SetCaps(path string, caps []byte, uid int64) error

SetCaps applies the caps for a particular root uid

func ShiftACL Uses

func ShiftACL(path string, shiftIds func(uid int64, gid int64) (int64, int64)) error

ShiftACL updates uid and gid for file ACLs when entering/exiting a namespace

func ShiftOwner Uses

func ShiftOwner(basepath string, path string, uid int, gid int) error

ShiftOwner updates uid and gid for a file when entering/exiting a namespace

func SupportsVFS3Fscaps Uses

func SupportsVFS3Fscaps(prefix string) bool

type ByHostid Uses

type ByHostid []*IdmapEntry

func (ByHostid) Len Uses

func (s ByHostid) Len() int

func (ByHostid) Less Uses

func (s ByHostid) Less(i, j int) bool

func (ByHostid) Swap Uses

func (s ByHostid) Swap(i, j int)

type IdRange Uses

type IdRange struct {
    Isuid   bool
    Isgid   bool
    Startid int64
    Endid   int64
}

func (*IdRange) Contains Uses

func (i *IdRange) Contains(id int64) bool

type IdmapEntry Uses

type IdmapEntry struct {
    Isuid    bool
    Isgid    bool
    Hostid   int64 // id as seen on the host - i.e. 100000
    Nsid     int64 // id as seen in the ns - i.e. 0
    Maprange int64
}

* One entry in id mapping set - a single range of either * uid or gid mappings.

func Extend Uses

func Extend(slice []IdmapEntry, element IdmapEntry) []IdmapEntry

taken from http://blog.golang.org/slices (which is under BSD licence)

func (*IdmapEntry) HostidsIntersect Uses

func (e *IdmapEntry) HostidsIntersect(i IdmapEntry) bool

func (*IdmapEntry) Intersects Uses

func (e *IdmapEntry) Intersects(i IdmapEntry) bool

func (*IdmapEntry) ToLxcString Uses

func (e *IdmapEntry) ToLxcString() []string

func (*IdmapEntry) Usable Uses

func (e *IdmapEntry) Usable() error

type IdmapSet Uses

type IdmapSet struct {
    Idmap []IdmapEntry
}

func CurrentIdmapSet Uses

func CurrentIdmapSet() (*IdmapSet, error)

* Create an idmap of the current allocation

func DefaultIdmapSet Uses

func DefaultIdmapSet(rootfs string, username string) (*IdmapSet, error)

* Create a new default idmap

func (*IdmapSet) AddSafe Uses

func (m *IdmapSet) AddSafe(i IdmapEntry) error

AddSafe adds an entry to the idmap set, breaking apart any ranges that the * new idmap intersects with in the process.

func (IdmapSet) Append Uses

func (m IdmapSet) Append(s string) (IdmapSet, error)

func (*IdmapSet) Equals Uses

func (m *IdmapSet) Equals(other *IdmapSet) bool

func (IdmapSet) HostidsIntersect Uses

func (m IdmapSet) HostidsIntersect(i IdmapEntry) bool

func (IdmapSet) Intersects Uses

func (m IdmapSet) Intersects(i IdmapEntry) bool

func (IdmapSet) Len Uses

func (m IdmapSet) Len() int

func (IdmapSet) Less Uses

func (m IdmapSet) Less(i, j int) bool

func (*IdmapSet) ShiftFile Uses

func (set *IdmapSet) ShiftFile(p string) error

func (IdmapSet) ShiftFromNs Uses

func (m IdmapSet) ShiftFromNs(uid int64, gid int64) (int64, int64)

func (IdmapSet) ShiftIntoNs Uses

func (m IdmapSet) ShiftIntoNs(uid int64, gid int64) (int64, int64)

func (*IdmapSet) ShiftRootfs Uses

func (set *IdmapSet) ShiftRootfs(p string, skipper func(dir string, absPath string, fi os.FileInfo) bool) error

func (IdmapSet) Swap Uses

func (m IdmapSet) Swap(i, j int)

func (IdmapSet) ToLxcString Uses

func (m IdmapSet) ToLxcString() []string

func (*IdmapSet) UidshiftFromContainer Uses

func (set *IdmapSet) UidshiftFromContainer(dir string, testmode bool) error

func (*IdmapSet) UidshiftIntoContainer Uses

func (set *IdmapSet) UidshiftIntoContainer(dir string, testmode bool) error

func (*IdmapSet) UnshiftRootfs Uses

func (set *IdmapSet) UnshiftRootfs(p string, skipper func(dir string, absPath string, fi os.FileInfo) bool) error

func (IdmapSet) Usable Uses

func (m IdmapSet) Usable() error

func (IdmapSet) ValidRanges Uses

func (m IdmapSet) ValidRanges() ([]*IdRange, error)

Package idmap imports 19 packages (graph) and is imported by 39 packages. Updated 2019-07-14. Refresh now. Tools for package owners.