shadow

package
v0.0.0-...-17244d7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shadow

type Shadow struct {
	Name       string // login username
	Password   string // encrypted password
	LastChange int64  // Date of last change since 1970-01-01
	MinDays    int64  // Min # of days between changes
	MaxDays    int64  // Max # of days between changes
	Warn       int64  // # of dayd before password expires to warn user to change it
	Inactive   int64  // # of days after password expires until account is disabled
	Expire     int64  // Date when account expires since 1970-01-01
	Flag       uint64 // reserved
}

spwd wraps up `spwd` (shadow password) used in kernel.

func GetShadowByName

func GetShadowByName(name string) (*Shadow, error)

GetShadowByName wraps up `getspnam` system call. It returns the record in the shadow database file that matches the username @name

func GetShadowEntry

func GetShadowEntry() []*Shadow

GetShadowEntry wraups up `getspent` system call. It performs sequential scans of the records in the shadow file.

type UserNotFoundError

type UserNotFoundError struct {
	Name string
	Uid  uint32
}

func (*UserNotFoundError) Error

func (err *UserNotFoundError) Error() string

Jump to

Keyboard shortcuts

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