Documentation ¶
Overview ¶
Package cache contains the types and convenience functions for manipulating caches in memory prior to writing to the disk. All caches act on Entries which may refer to passwd, group, or shadow cache entries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ACL ¶
ACL specifies a function which will return true if the entry is permitted by the ACL. If the entry is not permitted by the ACL it will silently be discarted.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is an in-memory struct representing the cache to be used by libnss-cache.
type Entry ¶
Entry specifies a generic entry in an unspecified cache. Specific implementations are provided for passwd, group, and shadow caches.
type GroupEntry ¶
type GroupEntry struct { Name string `json:"name"` // Group name Passwd string `json:"passwd"` // Password GID uint32 `json:"gid"` // Group ID Mem []string `json:"mem"` // Member list }
GroupEntry describes an entry of the /etc/group file https://sourceware.org/git/?p=glibc.git;a=blob;f=grp/grp.h;hb=HEAD#l41 https://fossies.org/dox/glibc-2.30/structgroup.html
func (*GroupEntry) Column ¶ added in v1.1.0
func (e *GroupEntry) Column(col int) string
Column returns the information from the requested columns or an empty string if no column is known.
func (*GroupEntry) String ¶
func (e *GroupEntry) String() string
type Option ¶
type Option func(c *Cache)
Option is a type of pre-processing function which can be used to pre-set values on a cache.
type PasswdEntry ¶
type PasswdEntry struct { Name string `json:"name"` // Username Passwd string `json:"passwd"` // Password UID uint32 `json:"uid"` // User ID GID uint32 `json:"gid"` // Group ID GECOS string `json:"gecos"` // Real name Dir string `json:"dir"` // Home directory Shell string `json:"shell"` // Shell program }
PasswdEntry describes an entry of the /etc/passwd file https://sourceware.org/git/?p=glibc.git;a=blob;f=pwd/pwd.h;hb=HEAD#l49 https://fossies.org/dox/glibc-2.30/structpasswd.html
func (*PasswdEntry) Column ¶ added in v1.1.0
func (e *PasswdEntry) Column(col int) string
Column returns the information from the requested columns or an empty string if no column is known.
func (*PasswdEntry) String ¶
func (e *PasswdEntry) String() string
type ShadowEntry ¶
type ShadowEntry struct { Name string `json:"name"` // Login name Passwd string `json:"passwd"` // Encrypted password Lstchg nullInt32 `json:"lstchg,omitempty"` // Date of last change Min nullInt32 `json:"min,omitempty"` // Minimum number of days between changes Max nullInt32 `json:"max,omitempty"` // Maximum number of days between changes Warn nullInt32 `json:"warn,omitempty"` // Number of days to warn user to change the password Inact nullInt32 `json:"inact,omitempty"` // Number of days the account may be inactive Expire nullInt32 `json:"expire,omitempty"` // Number of days since 1970-01-01 until account expires Flag nullUInt32 `json:"flag,omitempty"` // Reserved }
ShadowEntry describes an entry of the /etc/shadow file https://sourceware.org/git/?p=glibc.git;a=blob;f=shadow/shadow.h;hb=HEAD#l39 https://fossies.org/dox/glibc-2.30/structspwd.htmls
func (*ShadowEntry) Column ¶ added in v1.1.0
func (e *ShadowEntry) Column(col int) string
Column returns the information from the requested columns or an empty string if no column is known.
func (*ShadowEntry) String ¶
func (e *ShadowEntry) String() string