acl

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TypeNone = iota
	TypeAccess
	TypeDefault
)
View Source
const None = 0
View Source
const Version uint8 = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Put(id uint32, r *Rule)
	Get(id uint32) *Rule
	GetAll() map[uint32]*Rule
	GetId(r *Rule) uint32
	Size() int
	GetMissIds() []uint32
	Clear()
}

Cache all rules - cache all rules when meta init. - on getfacl failure, read and cache rule from meta. - on setfacl success, read and cache all missed rules from meta. (considered as a low-frequency operation) - concurrent mounts may result in duplicate rules.

func NewCache

func NewCache() Cache

type Entries

type Entries []Entry

func (*Entries) Decode

func (es *Entries) Decode(data []byte)

func (*Entries) Encode

func (es *Entries) Encode() []byte

func (*Entries) IsEqual

func (es *Entries) IsEqual(other *Entries) bool

func (*Entries) Len

func (es *Entries) Len() int

func (*Entries) Less

func (es *Entries) Less(i, j int) bool

func (*Entries) Swap

func (es *Entries) Swap(i, j int)

type Entry

type Entry struct {
	Id   uint32
	Perm uint16
}

type Rule

type Rule struct {
	Owner       uint16
	Group       uint16
	Mask        uint16
	Other       uint16
	NamedUsers  Entries
	NamedGroups Entries
}

Rule acl rule

func EmptyRule

func EmptyRule() *Rule

func (*Rule) CanAccess

func (r *Rule) CanAccess(uid uint32, gids []uint32, fUid, fGid uint32, mMask uint8) bool

func (*Rule) Checksum

func (r *Rule) Checksum() uint32

func (*Rule) ChildAccessACL

func (r *Rule) ChildAccessACL(mode uint16) *Rule

ChildAccessACL return the child node access acl with this default acl

func (*Rule) Decode

func (r *Rule) Decode(buf []byte)

func (*Rule) Dup

func (r *Rule) Dup() *Rule

func (*Rule) Encode

func (r *Rule) Encode() []byte

func (*Rule) GetMode

func (r *Rule) GetMode() uint16

func (*Rule) InheritPerms

func (r *Rule) InheritPerms(mode uint16)

InheritPerms from normal permission

func (*Rule) IsEmpty

func (r *Rule) IsEmpty() bool

func (*Rule) IsEqual

func (r *Rule) IsEqual(other *Rule) bool

func (*Rule) IsMinimal

func (r *Rule) IsMinimal() bool

IsMinimal just like normal permission

func (*Rule) SetMode

func (r *Rule) SetMode(mode uint16)

func (*Rule) String

func (r *Rule) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL