Files
uopi/internal/pamauth/stub.go
T
2026-06-23 17:59:40 +02:00

22 lines
828 B
Go

//go:build !pam
// Package pamauth authenticates a username/password pair against the host's PAM
// stack. This is the stub compiled into the default fully-static
// (CGO_ENABLED=0) build, which has no PAM/libpam linkage: Authenticate always
// reports PAM is unavailable. Build with `make backend-pam` (CGO_ENABLED=1
// -tags pam) to get the real implementation in pam.go.
package pamauth
import "errors"
// Available reports whether this build includes PAM support. False here.
const Available = false
// ErrUnavailable is returned by Authenticate because this build lacks PAM.
var ErrUnavailable = errors.New("pamauth: PAM support not compiled in (rebuild with: make backend-pam)")
// Authenticate always fails in the non-PAM build.
func Authenticate(service, username, password string) error {
return ErrUnavailable
}