shadowusers

package module
v0.0.0-...-fd74be2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyOrSpacesLineRe = regexp.MustCompile(`^\s*$`)

Functions

func AtoiEmptyIsMinus1

func AtoiEmptyIsMinus1(value string, field_name string) (int, error)

func IsEmptyOrSpacesLine

func IsEmptyOrSpacesLine(txt string) bool

func ItoaMinusIsEmpty

func ItoaMinusIsEmpty(value int) string

func ParseUserList

func ParseUserList(txt string) []string

func RenderUserList

func RenderUserList(lst []string) (string, error)

func SplitLine

func SplitLine(line string) []string

func StringValueValid

func StringValueValid(str string) bool

Types

type Ctl

type Ctl struct {
	Pth string

	Passwds  *Passwds
	Groups   *Groups
	Shadows  *Shadows
	GShadows *GShadows
}

func NewCtl

func NewCtl(pth string) *Ctl

func (*Ctl) GShadowsPath

func (self *Ctl) GShadowsPath() string

func (*Ctl) GroupsPath

func (self *Ctl) GroupsPath() string

func (*Ctl) NewAll

func (self *Ctl) NewAll()

func (*Ctl) NewGShadows

func (self *Ctl) NewGShadows()

func (*Ctl) NewGroups

func (self *Ctl) NewGroups()

func (*Ctl) NewPasswds

func (self *Ctl) NewPasswds()

func (*Ctl) NewShadows

func (self *Ctl) NewShadows()

func (*Ctl) PasswdsPath

func (self *Ctl) PasswdsPath() string

func (*Ctl) ReadAll

func (self *Ctl) ReadAll() error

func (*Ctl) ReadGShadows

func (self *Ctl) ReadGShadows() error

func (*Ctl) ReadGroups

func (self *Ctl) ReadGroups() error

func (*Ctl) ReadPasswds

func (self *Ctl) ReadPasswds() error

func (*Ctl) ReadShadows

func (self *Ctl) ReadShadows() error

func (*Ctl) ShadowsPath

func (self *Ctl) ShadowsPath() string

func (*Ctl) WriteAll

func (self *Ctl) WriteAll() error

func (*Ctl) WriteGShadows

func (self *Ctl) WriteGShadows() error

func (*Ctl) WriteGroups

func (self *Ctl) WriteGroups() error

func (*Ctl) WritePasswds

func (self *Ctl) WritePasswds() error

func (*Ctl) WriteShadows

func (self *Ctl) WriteShadows() error

type GShadow

type GShadow struct {
	Name           string
	Password       string
	Administrators []string
	Members        []string
}

func NewGShadowFromString

func NewGShadowFromString(line string) (*GShadow, error)

func (*GShadow) IsValid

func (self *GShadow) IsValid() bool

func (*GShadow) Render

func (self *GShadow) Render() (string, error)

type GShadows

type GShadows struct {
	GShadows []*GShadow
}

func NewGShadowsFromString

func NewGShadowsFromString(txt string) (*GShadows, error)

func (*GShadows) GetByAdministrator

func (self *GShadows) GetByAdministrator(user string) ([]*GShadow, error)

func (*GShadows) GetByMember

func (self *GShadows) GetByMember(user string) ([]*GShadow, error)

func (*GShadows) GetByName

func (self *GShadows) GetByName(name string) (*GShadow, error)

func (*GShadows) Render

func (self *GShadows) Render() (string, error)

func (*GShadows) ShalowCopy

func (self *GShadows) ShalowCopy() *GShadows

func (*GShadows) SortByName

func (self *GShadows) SortByName()

type Group

type Group struct {
	Name     string
	Password string
	GID      int
	UserList []string
}

func NewGroupFromString

func NewGroupFromString(line string) (*Group, error)

func (*Group) IsValid

func (self *Group) IsValid() bool

func (*Group) Render

func (self *Group) Render() (string, error)

type Groups

type Groups struct {
	Groups []*Group
}

func NewGroupsFromString

func NewGroupsFromString(txt string) (*Groups, error)

func (*Groups) GetByGID

func (self *Groups) GetByGID(id int) (*Group, error)

func (*Groups) GetByName

func (self *Groups) GetByName(name string) (*Group, error)

func (*Groups) GetByUser

func (self *Groups) GetByUser(user string) ([]*Group, error)

func (*Groups) Render

func (self *Groups) Render() (string, error)

func (*Groups) ShalowCopy

func (self *Groups) ShalowCopy() *Groups

func (*Groups) SortByGID

func (self *Groups) SortByGID()

type Passwd

type Passwd struct {
	Login    string
	Password string
	UserId   int
	GroupId  int
	Comment  string
	Home     string
	Shell    string
}

func NewPasswdFromString

func NewPasswdFromString(line string) (*Passwd, error)

func (*Passwd) IsValid

func (self *Passwd) IsValid() bool

func (*Passwd) Render

func (self *Passwd) Render() (string, error)

type Passwds

type Passwds struct {
	Passwds []*Passwd
}

func NewPasswdsFromString

func NewPasswdsFromString(txt string) (*Passwds, error)

func (*Passwds) GetByGid

func (self *Passwds) GetByGid(gid int) ([]*Passwd, error)

func (*Passwds) GetByLogin

func (self *Passwds) GetByLogin(login string) (*Passwd, error)

func (*Passwds) GetByUid

func (self *Passwds) GetByUid(uid int) (*Passwd, error)

func (*Passwds) Render

func (self *Passwds) Render() (string, error)

func (*Passwds) ShalowCopy

func (self *Passwds) ShalowCopy() *Passwds

func (*Passwds) SortByUid

func (self *Passwds) SortByUid()

type Shadow

type Shadow struct {
	Login                 string
	Password              string
	LastChangeDays        int
	MinAgeDays            int
	MaxAgeDays            int
	WarningPeriodDays     int
	InactivityPeriodDays  int
	AccountExpirationDays int
}

func NewShadowFromString

func NewShadowFromString(line string) (*Shadow, error)

func (*Shadow) IsValid

func (self *Shadow) IsValid() bool

func (*Shadow) Render

func (self *Shadow) Render() (string, error)

type Shadows

type Shadows struct {
	Shadows []*Shadow
}

func NewShadowsFromString

func NewShadowsFromString(txt string) (*Shadows, error)

func (*Shadows) GetByLogin

func (self *Shadows) GetByLogin(login string) (*Shadow, error)

func (*Shadows) Render

func (self *Shadows) Render() (string, error)

func (*Shadows) ShalowCopy

func (self *Shadows) ShalowCopy() *Shadows

func (*Shadows) SortByLogin

func (self *Shadows) SortByLogin()

Jump to

Keyboard shortcuts

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