code.gitea.io/gitea@v1.22.3/modules/auth/pam/pam_stub.go (about)

     1  // Copyright 2014 The Gogs Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  //go:build !pam
     5  
     6  package pam
     7  
     8  import (
     9  	"errors"
    10  )
    11  
    12  // Supported is false when built without PAM
    13  var Supported = false
    14  
    15  // Auth not supported lack of pam tag
    16  func Auth(serviceName, userName, passwd string) (string, error) {
    17  	// bypass the lint on callers: SA4023: this comparison is always true (staticcheck)
    18  	if !Supported {
    19  		return "", errors.New("PAM not supported")
    20  	}
    21  	return "", nil
    22  }