MCPcopy Create free account
hub / github.com/foxcpp/maddy / Configure

Method Configure

internal/auth/pam/module.go:58–80  ·  view source on GitHub ↗
(inlineArgs []string, cfg *config.Map)

Source from the content-addressed store, hash-verified

56}
57
58func (a *Auth) Configure(inlineArgs []string, cfg *config.Map) error {
59 if len(inlineArgs) != 0 {
60 return errors.New("pam: inline arguments are not used")
61 }
62
63 cfg.Bool("debug", true, false, &a.Log.Debug)
64 cfg.Bool("use_helper", false, false, &a.useHelper)
65 if _, err := cfg.Process(); err != nil {
66 return err
67 }
68 if !canCallDirectly && !a.useHelper {
69 return errors.New("pam: this build lacks support for direct libpam invocation, use helper binary")
70 }
71
72 if a.useHelper {
73 a.helperPath = filepath.Join(config.LibexecDirectory, "maddy-pam-helper")
74 if _, err := os.Stat(a.helperPath); err != nil {
75 return fmt.Errorf("pam: no helper binary (maddy-pam-helper) found in %s", config.LibexecDirectory)
76 }
77 }
78
79 return nil
80}
81
82func (a *Auth) AuthPlain(username, password string) error {
83 if a.useHelper {

Callers

nothing calls this directly

Calls 2

BoolMethod · 0.80
ProcessMethod · 0.80

Tested by

no test coverage detected