From a1d937fe3d26379e39c37e5328c96dcbd335efa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Thu, 6 Jun 2024 18:51:53 +0200 Subject: listen on network (ex. unix socket) --- server.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 24b1e77..434412b 100644 --- a/server.go +++ b/server.go @@ -180,8 +180,12 @@ func (server *Server) GetStats() Stats { return *server.Stats } -func (server *Server) ListenAndServe(listenString string) error { - ln, err := net.Listen("tcp", listenString) +func (server *Server) ListenAndServe(listenString string, args ...string) error { + network := "tcp" + if (len(args) > 0) { + network = args[0] + } + ln, err := net.Listen(network, listenString) if err != nil { return err } -- cgit v1.2.3 From 594baefadd0633d16dbcab72faea4f4c5b0de4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Wed, 9 Oct 2024 22:16:11 +0200 Subject: change asn1-ber library --- bind.go | 2 +- conn.go | 2 +- control.go | 2 +- debug.go | 2 +- filter.go | 2 +- filter_test.go | 2 +- go.mod | 4 ++-- go.sum | 4 ++-- ldap.go | 2 +- modify.go | 2 +- search.go | 2 +- server.go | 2 +- server_bind.go | 2 +- server_modify.go | 2 +- server_search.go | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bind.go b/bind.go index 171a2e9..3cae412 100644 --- a/bind.go +++ b/bind.go @@ -7,7 +7,7 @@ package ldap import ( "errors" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) func (l *Conn) Bind(username, password string) error { diff --git a/conn.go b/conn.go index 253e58e..ab880c4 100644 --- a/conn.go +++ b/conn.go @@ -12,7 +12,7 @@ import ( "sync" "time" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) const ( diff --git a/control.go b/control.go index 60fde91..888930a 100644 --- a/control.go +++ b/control.go @@ -7,7 +7,7 @@ package ldap import ( "strings" "fmt" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) const ( diff --git a/debug.go b/debug.go index de9bc5a..cffaa71 100644 --- a/debug.go +++ b/debug.go @@ -3,7 +3,7 @@ package ldap import ( "log" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) // debbuging type diff --git a/filter.go b/filter.go index 05c4bb2..402a583 100644 --- a/filter.go +++ b/filter.go @@ -10,7 +10,7 @@ import ( "strings" "unicode/utf8" - ber "github.com/nmcclain/asn1-ber" + ber "4a.si/asn1-ber" ) const ( diff --git a/filter_test.go b/filter_test.go index 5244c8a..68d2c57 100644 --- a/filter_test.go +++ b/filter_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - ber "github.com/nmcclain/asn1-ber" + ber "4a.si/asn1-ber" ) type compileTest struct { diff --git a/go.mod b/go.mod index 430dfa0..b838403 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ -module github.com/nmcclain/ldap +module 4a.si/ldap go 1.14 -require github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484 +require 4a.si/asn1-ber v0.0.0-20241009195854-ae3d4e156655 diff --git a/go.sum b/go.sum index f925ae6..85faf6d 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484 h1:D9EvfGQvlkKaDr2CRKN++7HbSXbefUNDrPq60T+g24s= -github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484/go.mod h1:O1EljZ+oHprtxDDPHiMWVo/5dBT6PlvWX5PSwj80aBA= +4a.si/asn1-ber v0.0.0-20241009195854-ae3d4e156655 h1:LxpFwnVQdMMXw4CEsa5R3FbIGQ79BAJln1HbTb4VjZk= +4a.si/asn1-ber v0.0.0-20241009195854-ae3d4e156655/go.mod h1:/TTM4IrcaxxGBptmpM4U6be4qHNe+pSO4f6Itb/g9vw= diff --git a/ldap.go b/ldap.go index e6d6d52..d2545b2 100644 --- a/ldap.go +++ b/ldap.go @@ -9,7 +9,7 @@ import ( "fmt" "io/ioutil" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) // LDAP Application Codes diff --git a/modify.go b/modify.go index 1137e2f..3bb5aeb 100644 --- a/modify.go +++ b/modify.go @@ -33,7 +33,7 @@ import ( "errors" "log" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) const ( diff --git a/search.go b/search.go index 45b26b8..1bd64d5 100644 --- a/search.go +++ b/search.go @@ -64,7 +64,7 @@ import ( "fmt" "strings" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) const ( diff --git a/server.go b/server.go index 434412b..5e124f5 100644 --- a/server.go +++ b/server.go @@ -8,7 +8,7 @@ import ( "strings" "sync" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) type Binder interface { diff --git a/server_bind.go b/server_bind.go index 5a80bf5..6b4accf 100644 --- a/server_bind.go +++ b/server_bind.go @@ -1,7 +1,7 @@ package ldap import ( - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" "log" "net" ) diff --git a/server_modify.go b/server_modify.go index ca68e40..6ac618e 100644 --- a/server_modify.go +++ b/server_modify.go @@ -4,7 +4,7 @@ import ( "log" "net" - "github.com/nmcclain/asn1-ber" + "4a.si/asn1-ber" ) func HandleAddRequest(req *ber.Packet, boundDN string, fns map[string]Adder, conn net.Conn) (resultCode LDAPResultCode) { diff --git a/server_search.go b/server_search.go index 12a6caf..91f3094 100644 --- a/server_search.go +++ b/server_search.go @@ -6,7 +6,7 @@ import ( "net" "strings" - ber "github.com/nmcclain/asn1-ber" + ber "4a.si/asn1-ber" ) func HandleSearchRequest(req *ber.Packet, controls *[]Control, messageID uint64, boundDN string, server *Server, conn net.Conn) (resultErr error) { -- cgit v1.2.3