Documentation
¶
Index ¶
- Constants
- func PermUintToString(p uint16) string
- func Tag2String(i Tag) string
- type ACL
- func (a *ACL) AddEntry(e *ACLEntry) error
- func (a *ACL) Apply(fsPath string, attr ACLAttr) error
- func (a *ACL) DeleteEntry(e *ACLEntry) *ACLEntry
- func (a *ACL) EntryExists(e *ACLEntry) int
- func (a *ACL) Equal(e *ACL) bool
- func (a *ACL) GetEntry(e *ACLEntry) *ACLEntry
- func (a *ACL) Load(fsPath string, attr ACLAttr) error
- func (a *ACL) String() string
- func (a *ACL) ToByteSlice(result *bytes.Buffer)
- type ACLAttr
- type ACLEntry
- type Tag
Constants ¶
const ( // Undefined ACL type. TAG_ACL_UNDEFINED_FIELD = 0x0 // Discretionary access rights for //processes whose effective user ID //matches the user ID of the file's owner. TAG_ACL_USER_OBJ = 0x1 // Discretionary access rights for // processes whose effective user ID // matches the ACL entry qualifier. TAG_ACL_USER = 0x2 // Discretionary access rights for // processes whose effective groupID or // any supplemental groups match the group // ID of the file's owner. TAG_ACL_GROUP_OBJ = 0x4 // Discretionary access rights for // processes whose effective group ID or // any supplemental groups match the ACL // entry qualifier. TAG_ACL_GROUP = 0x8 // The maximum discretionary access rights // that can be granted to a process in the // file group class. This is only valid // for POSIX.1e ACLs. TAG_ACL_MASK = 0x10 // Discretionary access rights for // processes not covered by any other ACL // entry. This is only valid for POSIX.1e // ACLs. TAG_ACL_OTHER = 0x20 // Same as ACL_OTHER. TAG_ACL_OTHER_OBJ = TAG_ACL_OTHER // Discretionary access rights for all // users. This is only valid for NFSv4 // ACLs. TAG_ACL_EVERYONE = 0x40 )
Variables ¶
This section is empty.
Functions ¶
func PermUintToString ¶
PermUintToString takes an int representation of a permission and returns the string representation "rwx". not granted permissions appear as "-".
func Tag2String ¶
Types ¶
type ACL ¶
type ACL struct {
// contains filtered or unexported fields
}
ACL handles Posix ACL data
func (*ACL) AddEntry ¶
AddEntry adds the given entry to the ACL It will make sure that no entry with the same Tag and ID combination exists. If so, it will replace (not merge) the existing entry with the given.
func (*ACL) Apply ¶
Apply applies the ACL with its ACLEntries to as either access or default ACLs to the given filesstem path
func (*ACL) DeleteEntry ¶
DeleteEntry deletes the entry that has the same tag and id if it exists and returns the deleted entry
func (*ACL) EntryExists ¶
EntryExists checks if an entry with the given Tag and ID already exist if so it return -1 of not the position of the duplicate is returned as a positive int
func (*ACL) GetEntry ¶ added in v0.1.3
GetEntry returns the entry with the given Tag and ID if it exists, nil otherwise
func (*ACL) Load ¶
Load loads the attr defined POSIX.ACL type (access or default) from the given filepath
func (*ACL) ToByteSlice ¶
ToByteSlice return the ACL in its byte slice representation read to be used by Setxattr(...)
type ACLEntry ¶
type ACLEntry struct {
// contains filtered or unexported fields
}
ACLEntry the ACLEntry represents the single lines of permission.
- tag references the type (group, user, etc.)
- perm is the permission in its numerical format
- id is the id of the group or user or whatever tag points to
func (*ACLEntry) ToByteSlice ¶
ToByteSlice returns the ACLEntry as a byte slice in little endian order, which is the representation required for the Setxattr(...) call