summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-06-06 18:48:38 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-06-06 18:48:38 +0200
commite2352d510f8282771753625cba322dbf0b0020d4 (patch)
tree2a0d02b14cc8d0b182edfc44c9029095d82befa8 /main.go
parentfork (diff)
downloadpamldapd-e2352d510f8282771753625cba322dbf0b0020d4.tar
pamldapd-e2352d510f8282771753625cba322dbf0b0020d4.tar.gz
pamldapd-e2352d510f8282771753625cba322dbf0b0020d4.tar.bz2
pamldapd-e2352d510f8282771753625cba322dbf0b0020d4.tar.lz
pamldapd-e2352d510f8282771753625cba322dbf0b0020d4.tar.xz
pamldapd-e2352d510f8282771753625cba322dbf0b0020d4.tar.zst
pamldapd-e2352d510f8282771753625cba322dbf0b0020d4.zip
Diffstat (limited to '')
-rw-r--r--main.go20
1 files changed, 11 insertions, 9 deletions
diff --git a/main.go b/main.go
index 9685b3e..bc83365 100644
--- a/main.go
+++ b/main.go
@@ -7,7 +7,7 @@ import (
"fmt"
"github.com/msteinert/pam"
"github.com/nmcclain/asn1-ber"
- "github.com/nmcclain/ldap"
+ "4a.si/ldap"
"log"
"net"
"os"
@@ -19,12 +19,13 @@ type Backend struct {
ldap.Binder
ldap.Searcher
ldap.Closer
- logger *log.Logger
- Listen string
- PAMServiceName string
- PeopleDN string
- GroupsDN string
- BindAdminDN string
+ logger *log.Logger
+ Listen string
+ Network string
+ PAMServiceName string
+ PeopleDN string
+ GroupsDN string
+ BindAdminDN string
BindAdminPassword string
}
@@ -33,6 +34,7 @@ func main() {
var logfile = flag.String("l", "", "Log file (STDOUT if blank)")
flag.Parse()
var backend = Backend{}
+ backend.Network = "tcp"
{
confighandle, err := os.Open(*configfile)
if err != nil {
@@ -74,8 +76,8 @@ func main() {
l.BindFunc("", backend)
l.SearchFunc("", backend)
l.CloseFunc("", backend)
- backend.logger.Printf("LDAP server listen: %s", backend.Listen)
- if err := l.ListenAndServe(backend.Listen); err != nil {
+ backend.logger.Printf("LDAP server listen: %s, network %s", backend.Listen, backend.Network)
+ if err := l.ListenAndServe(backend.Listen, backend.Network); err != nil {
backend.logger.Printf("LDAP server listen failed: %s", err.Error())
os.Exit(1)
}