base

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package base handles the base maps that a system needs to have identity. These maps include the passwd and group map. On a system that uses PAM, these are all you need. If your system uses shadow maps, you will need to load an additional map to handle the shadow maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	hclog.Logger
	// contains filtered or unexported fields
}

Base provides a virtual component that handles the passwd and group maps.

func New

func New() *Base

New returns a new initialized Base maps structure.

func (*Base) ConnectNetAuth

func (b *Base) ConnectNetAuth() error

ConnectNetAuth establishes the connection from the localizer to the NetAuth server.

func (*Base) FetchGroup

func (b *Base) FetchGroup() shadow.GroupMap

FetchGroup returns the group map as a formatted string suitable for passing into another map module.

func (*Base) FetchPasswd

func (b *Base) FetchPasswd() shadow.PasswdMap

FetchPasswd returns the passwd map as a formatted string suitable for passing into another map module.

func (*Base) GroupBytes

func (b *Base) GroupBytes() []byte

GroupBytes returns a byte representation of the new group file as it should appear for writing to disk.

func (*Base) Load

func (b *Base) Load() error

Load loads the passwd and shadow maps into the Base struct.

func (*Base) LoadNetAuthData

func (b *Base) LoadNetAuthData(ctx context.Context) error

LoadNetAuthData retrieves updated information from a remove NetAuth server to be merged into the local data already present.

func (*Base) MergeGroup

func (b *Base) MergeGroup()

MergeGroup removes all group entries above the minimum GID and then adds the NetAuth groups that were filtered above.

func (*Base) MergePasswd

func (b *Base) MergePasswd()

MergePasswd removes all entries above the minimum UID and then adds NetAuth entities that were filtered above.

func (*Base) PasswdBytes

func (b *Base) PasswdBytes() []byte

PasswdBytes returns a byte representation of the new passwd file as it should appear for writing to disk.

func (*Base) SetBaseDir

func (b *Base) SetBaseDir(s string)

SetBaseDir specifies the base directory that all files are read from and written to.

func (*Base) SetFallbackShell

func (b *Base) SetFallbackShell(s string)

SetFallbackShell is used to specify the shell that should be used if the requested shell is not present on the system or otherwise is not specified.

func (*Base) SetLogger

func (b *Base) SetLogger(l hclog.Logger)

SetLogger sets the internal logger used by the module. If unspecified logging is enabled on the default logger.

func (*Base) SetMinGID

func (b *Base) SetMinGID(m int32)

SetMinGID specifies the minimum GID that should be accepted from NetAuth. GIDs below this value are asserted to be local to the system and are not modified.

func (*Base) SetMinUID

func (b *Base) SetMinUID(m int32)

SetMinUID specifies the minimum UID that should be accepted from NetAuth. UIDs below this value are asserted to be local to the system and are not modified.

Jump to

Keyboard shortcuts

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