aboutsummaryrefslogtreecommitdiff
path: root/ldapserver
diff options
context:
space:
mode:
Diffstat (limited to 'ldapserver')
-rw-r--r--ldapserver/client.go8
-rw-r--r--ldapserver/constants.go2
-rw-r--r--ldapserver/message.go2
-rw-r--r--ldapserver/packet.go3
-rw-r--r--ldapserver/responsemessage.go2
-rw-r--r--ldapserver/route.go2
6 files changed, 12 insertions, 7 deletions
diff --git a/ldapserver/client.go b/ldapserver/client.go
index 91a5980..3674ba4 100644
--- a/ldapserver/client.go
+++ b/ldapserver/client.go
@@ -6,7 +6,7 @@ import (
"sync"
"time"
- ldap "github.com/lor00x/goldap/message"
+ ldap "bottin/goldap"
)
type UserState interface{}
@@ -206,10 +206,14 @@ func (c *client) close() {
}
func (c *client) writeMessage(m *ldap.LDAPMessage) {
- data, _ := m.Write()
+ data, err := m.Write()
+ if err != nil {
+ Logger.Errorf("bottin: unable to marshal response message: %v", err)
+ }
//Logger.Printf(">>> %d - %s - hex=%x", c.Numero, m.ProtocolOpName(), data.Bytes())
Logger.Tracef(">>> [%d] %#v", c.Numero, m)
+ Logger.Tracef("%v", data.Bytes())
c.bw.Write(data.Bytes())
c.bw.Flush()
diff --git a/ldapserver/constants.go b/ldapserver/constants.go
index de6d229..a04ca43 100644
--- a/ldapserver/constants.go
+++ b/ldapserver/constants.go
@@ -1,6 +1,6 @@
package ldapserver
-import ldap "github.com/lor00x/goldap/message"
+import ldap "bottin/goldap"
// LDAP Application Codes
const (
diff --git a/ldapserver/message.go b/ldapserver/message.go
index f6e609f..7033e06 100644
--- a/ldapserver/message.go
+++ b/ldapserver/message.go
@@ -3,7 +3,7 @@ package ldapserver
import (
"fmt"
- ldap "github.com/lor00x/goldap/message"
+ ldap "bottin/goldap"
)
type Message struct {
diff --git a/ldapserver/packet.go b/ldapserver/packet.go
index 77b4926..a60a44a 100644
--- a/ldapserver/packet.go
+++ b/ldapserver/packet.go
@@ -5,7 +5,7 @@ import (
"errors"
"fmt"
- ldap "github.com/lor00x/goldap/message"
+ ldap "bottin/goldap"
)
type messagePacket struct {
@@ -141,6 +141,7 @@ func readBytes(conn *bufio.Reader, bytes *[]byte, length int) (b byte, err error
if n != length {
fmt.Errorf("%d bytes read instead of %d", n, length)
} else if err != nil {
+ fmt.Println("ooopsie an error occured here:", err)
return
}
*bytes = append(*bytes, newbytes...)
diff --git a/ldapserver/responsemessage.go b/ldapserver/responsemessage.go
index 23527b9..9dc0406 100644
--- a/ldapserver/responsemessage.go
+++ b/ldapserver/responsemessage.go
@@ -1,6 +1,6 @@
package ldapserver
-import ldap "github.com/lor00x/goldap/message"
+import ldap "bottin/goldap"
func NewBindResponse(resultCode int) ldap.BindResponse {
r := ldap.BindResponse{}
diff --git a/ldapserver/route.go b/ldapserver/route.go
index dfd5240..3ba5618 100644
--- a/ldapserver/route.go
+++ b/ldapserver/route.go
@@ -3,7 +3,7 @@ package ldapserver
import (
"strings"
- ldap "github.com/lor00x/goldap/message"
+ ldap "bottin/goldap"
)
// Constant to LDAP Request protocol Type names