passwd

package
v0.0.0-...-dddda54 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: GPL-3.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Passwd

type Passwd struct {
	Name    string
	Passwd  string // Password is encrypted
	Uid     uint32
	Gid     uint32
	Comment string
	Home    string
	Shell   string
}

Passwd wraps up `passwd` struct used in kernel

func GetPasswdByName

func GetPasswdByName(name string) (*Passwd, error)

GetPasswdByName wraps up `getpwnam` system call. It retrieves records from the password file based on username.

func GetPasswdByUid

func GetPasswdByUid(uid uint32) (*Passwd, error)

GetPasswdByUid wraps up `getpwuid` system call. It retrieves records from the password file based on uid.

func GetPasswdEntry

func GetPasswdEntry() []*Passwd

GetPasswdEntry wraps up `getpwent` system call It performs sequential scans of the records in the password 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