Skip to content

Latest commit

 

History

History

pam

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

PAM

Check a user/password combination using PAM.

You need to install the development PAM headers, specificially <security/pam_appl.h> and <security/pam_misc.h>.

Example

package main

import (
	"github.com/moolen/glitchlock/pam"
)

func main() {
    if pam.AuthenticateCurrentUser("1234") {
        fmt.Println("password matches")
    }else{
        fmt.Println("wrong password")
    }
    if pam.Authenticate("my-user", "1234") {
        fmt.Println("password matches")
    }else{
        fmt.Println("wrong password")
    }
}