Documentation ¶
Index ¶
- func CheckUserExists(username string) bool
- func ParseFile(path string) (map[string]UserEntry, error)
- func ParseReader(r io.Reader) (map[string]UserEntry, error)
- func ReadShadow(path string) (map[string]ShadowEntry, error)
- func ReadSystemShadow() (map[string]ShadowEntry, error)
- func ReadSystemUsers() (map[string]UserEntry, error)
- type ShadowEntry
- type UserEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUserExists ¶
func ReadShadow ¶
func ReadShadow(path string) (map[string]ShadowEntry, error)
func ReadSystemShadow ¶
func ReadSystemShadow() (map[string]ShadowEntry, error)
func ReadSystemUsers ¶
Parse opens the '/etc/passwd' file and parses it into a map from usernames to Entries
Types ¶
type ShadowEntry ¶
type ShadowEntry struct { Username string Password string `json:"-"` // Days since Jan 1, 1970 password was last changed. LastChange string // -1 if password aging is disabled. MinPasswordAge string // 用户必须更改密码的天数。 // // -1 is password aging is disabled. MaxPasswordAge string // 密码到期前的天数(请参阅上面的密码最长使用期限),在此期间应向用户发出警告。 // // -1 is password aging is disabled. WarnPeriod string // 密码过期后的天数(请参阅上面的密码最长使用期限),在此期间密码仍应被接受。 // // -1 is password aging is disabled. InactivityPeriod string // 帐户的到期日期,表示为自1970年1月1日以来的天数。 // // -1 is account never expires. AccountExpiry string // Unused now. Flags string }
func (*ShadowEntry) GetAccountExpiry ¶
func (u *ShadowEntry) GetAccountExpiry() string
func (*ShadowEntry) GetFlags ¶
func (u *ShadowEntry) GetFlags() string
func (*ShadowEntry) ToString ¶
func (u *ShadowEntry) ToString() string
Click to show internal directories.
Click to hide internal directories.