Skip to content

Commit

Permalink
Fixed password change, removed prints of tokens and prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwaxios committed Jan 28, 2021
1 parent 3682618 commit 882ac33
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions pamuser.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import "C"

import (
"errors"
"fmt"
// "fmt"
"sync"
)

Expand Down Expand Up @@ -230,10 +230,10 @@ var (
// indicates an error occurred.
//export userInput
func userInput(prompt *C.char) *C.char {
s := C.GoString(prompt)
if s != "" {
fmt.Println(s)
}
// s := C.GoString(prompt)
// if s != "" {
// fmt.Println(s)
// }
return C.CString("")
}

Expand All @@ -242,12 +242,12 @@ func userInput(prompt *C.char) *C.char {
// indicates an error occurred.
//export passphraseInput
func passphraseInput(prompt *C.char) *C.char {
s := C.GoString(prompt)
if s != "" {
fmt.Print(s)
}
// s := C.GoString(prompt)
// if s != "" {
// fmt.Print(s)
// }
// Subsequent calls to passphrase input should fail
fmt.Println(tokenToCheck)
// fmt.Println(tokenToCheck)
input := (*C.char)(C.CString(tokenToCheck))
tokenToCheck = tokenToSet

Expand Down Expand Up @@ -314,7 +314,6 @@ func changeToken(username, oldpassword, newpassword string, quiet bool) (PamResu
return PamAuthERR, nil
}

tokenToCheck = oldpassword
tokenToSet = newpassword

// Ask PAM to change the token.
Expand Down

0 comments on commit 882ac33

Please sign in to comment.