summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/nslcd_proto/func_handlerequest.go.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nslcd_proto/func_handlerequest.go.sh b/src/nslcd_proto/func_handlerequest.go.sh
index de9a6b7..c0e3052 100755
--- a/src/nslcd_proto/func_handlerequest.go.sh
+++ b/src/nslcd_proto/func_handlerequest.go.sh
@@ -7,13 +7,14 @@ package nslcd_proto
import (
"fmt"
"io"
+ "os"
)
func handleRequest(backend Backend, in io.Reader, out io.Writer, cred Ucred) {
var version int32
read(in, &version)
if version != NSLCD_VERSION {
- panic(NslcdError(fmt.Sprintf("version mismatch: server=%#08x client=%#08x", NSLCD_VERSION, version)))
+ panic(NslcdError(fmt.Sprintf("Version mismatch: server=%#08x client=%#08x", NSLCD_VERSION, version)))
}
var action int32
read(in, &action)
@@ -26,7 +27,15 @@ while read -r request; do
case NSLCD_ACTION_${request^^}:
var req Request_${request}
read(in, &req)
- fmt.Printf("request: %#v\n", req)
+ $(
+ if [[ $request == PAM_Authentication ]]; then
+ echo '_req := req'
+ echo '_req.Password = "<omitted-from-log>"'
+ echo 'fmt.Fprintf(os.Stderr, "Request: %#v\n", _req)'
+ else
+ echo 'fmt.Fprintf(os.Stderr, "Request: %#v\n", req)'
+ fi
+ )
_res := backend.${request}(cred, req)
go func() {
o, ok := <-_res