From 21d621301ef6862ebf59a6ef84fb34028832be4f Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Fri, 23 Oct 2020 05:10:29 -0500 Subject: Remove PAM from auth dropdown when unavailable (#13276) Signed-off-by: jolheiser --- modules/auth/pam/pam.go | 3 +++ modules/auth/pam/pam_stub.go | 3 +++ 2 files changed, 6 insertions(+) (limited to 'modules/auth') diff --git a/modules/auth/pam/pam.go b/modules/auth/pam/pam.go index ca299b08ba..f21602c6b5 100644 --- a/modules/auth/pam/pam.go +++ b/modules/auth/pam/pam.go @@ -12,6 +12,9 @@ import ( "github.com/msteinert/pam" ) +// Supported is true when built with PAM +var Supported = true + // Auth pam auth service func Auth(serviceName, userName, passwd string) (string, error) { t, err := pam.StartFunc(serviceName, userName, func(s pam.Style, msg string) (string, error) { diff --git a/modules/auth/pam/pam_stub.go b/modules/auth/pam/pam_stub.go index 604799ca97..02d8da3c57 100644 --- a/modules/auth/pam/pam_stub.go +++ b/modules/auth/pam/pam_stub.go @@ -10,6 +10,9 @@ import ( "errors" ) +// Supported is false when built without PAM +var Supported = false + // Auth not supported lack of pam tag func Auth(serviceName, userName, passwd string) (string, error) { return "", errors.New("PAM not supported") -- cgit v1.2.3