summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-ldap/ldap
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-ldap/ldap')
-rw-r--r--vendor/github.com/go-ldap/ldap/.travis.yml6
-rw-r--r--vendor/github.com/go-ldap/ldap/Makefile12
-rw-r--r--vendor/github.com/go-ldap/ldap/atomic_value.go13
-rw-r--r--vendor/github.com/go-ldap/ldap/atomic_value_go13.go28
-rw-r--r--vendor/github.com/go-ldap/ldap/conn.go73
-rw-r--r--vendor/github.com/go-ldap/ldap/conn_test.go10
-rw-r--r--vendor/github.com/go-ldap/ldap/debug.go2
-rw-r--r--vendor/github.com/go-ldap/ldap/dn.go7
-rw-r--r--vendor/github.com/go-ldap/ldap/dn_test.go12
-rw-r--r--vendor/github.com/go-ldap/ldap/error.go7
-rw-r--r--vendor/github.com/go-ldap/ldap/error_test.go4
-rw-r--r--vendor/github.com/go-ldap/ldap/example_test.go12
-rw-r--r--vendor/github.com/go-ldap/ldap/filter.go5
-rw-r--r--vendor/github.com/go-ldap/ldap/filter_test.go6
-rw-r--r--vendor/github.com/go-ldap/ldap/ldap.go2
-rw-r--r--vendor/github.com/go-ldap/ldap/passwdmodify.go8
-rw-r--r--vendor/github.com/go-ldap/ldap/search_test.go6
17 files changed, 143 insertions, 70 deletions
diff --git a/vendor/github.com/go-ldap/ldap/.travis.yml b/vendor/github.com/go-ldap/ldap/.travis.yml
index e32a2aa75..9782c9bac 100644
--- a/vendor/github.com/go-ldap/ldap/.travis.yml
+++ b/vendor/github.com/go-ldap/ldap/.travis.yml
@@ -1,8 +1,8 @@
language: go
env:
global:
- - VET_VERSIONS="1.6 1.7 tip"
- - LINT_VERSIONS="1.6 1.7 tip"
+ - VET_VERSIONS="1.6 1.7 1.8 1.9 tip"
+ - LINT_VERSIONS="1.6 1.7 1.8 1.9 tip"
go:
- 1.2
- 1.3
@@ -10,6 +10,8 @@ go:
- 1.5
- 1.6
- 1.7
+ - 1.8
+ - 1.9
- tip
matrix:
fast_finish: true
diff --git a/vendor/github.com/go-ldap/ldap/Makefile b/vendor/github.com/go-ldap/ldap/Makefile
index c1fc96657..a9d351c76 100644
--- a/vendor/github.com/go-ldap/ldap/Makefile
+++ b/vendor/github.com/go-ldap/ldap/Makefile
@@ -1,5 +1,15 @@
.PHONY: default install build test quicktest fmt vet lint
+GO_VERSION := $(shell go version | cut -d' ' -f3 | cut -d. -f2)
+
+# Only use the `-race` flag on newer versions of Go
+IS_OLD_GO := $(shell test $(GO_VERSION) -le 2 && echo true)
+ifeq ($(IS_OLD_GO),true)
+ RACE_FLAG :=
+else
+ RACE_FLAG := -race -cpu 1,2,4
+endif
+
default: fmt vet lint build quicktest
install:
@@ -9,7 +19,7 @@ build:
go build -v ./...
test:
- go test -v -cover ./...
+ go test -v $(RACE_FLAG) -cover ./...
quicktest:
go test ./...
diff --git a/vendor/github.com/go-ldap/ldap/atomic_value.go b/vendor/github.com/go-ldap/ldap/atomic_value.go
new file mode 100644
index 000000000..bccf7573e
--- /dev/null
+++ b/vendor/github.com/go-ldap/ldap/atomic_value.go
@@ -0,0 +1,13 @@
+// +build go1.4
+
+package ldap
+
+import (
+ "sync/atomic"
+)
+
+// For compilers that support it, we just use the underlying sync/atomic.Value
+// type.
+type atomicValue struct {
+ atomic.Value
+}
diff --git a/vendor/github.com/go-ldap/ldap/atomic_value_go13.go b/vendor/github.com/go-ldap/ldap/atomic_value_go13.go
new file mode 100644
index 000000000..04920bb26
--- /dev/null
+++ b/vendor/github.com/go-ldap/ldap/atomic_value_go13.go
@@ -0,0 +1,28 @@
+// +build !go1.4
+
+package ldap
+
+import (
+ "sync"
+)
+
+// This is a helper type that emulates the use of the "sync/atomic.Value"
+// struct that's available in Go 1.4 and up.
+type atomicValue struct {
+ value interface{}
+ lock sync.RWMutex
+}
+
+func (av *atomicValue) Store(val interface{}) {
+ av.lock.Lock()
+ av.value = val
+ av.lock.Unlock()
+}
+
+func (av *atomicValue) Load() interface{} {
+ av.lock.RLock()
+ ret := av.value
+ av.lock.RUnlock()
+
+ return ret
+}
diff --git a/vendor/github.com/go-ldap/ldap/conn.go b/vendor/github.com/go-ldap/ldap/conn.go
index b5bd99adb..eb28eb472 100644
--- a/vendor/github.com/go-ldap/ldap/conn.go
+++ b/vendor/github.com/go-ldap/ldap/conn.go
@@ -11,6 +11,7 @@ import (
"log"
"net"
"sync"
+ "sync/atomic"
"time"
"gopkg.in/asn1-ber.v1"
@@ -82,20 +83,18 @@ const (
type Conn struct {
conn net.Conn
isTLS bool
- isClosing bool
- closeErr error
+ closing uint32
+ closeErr atomicValue
isStartingTLS bool
Debug debugging
- chanConfirm chan bool
+ chanConfirm chan struct{}
messageContexts map[int64]*messageContext
chanMessage chan *messagePacket
chanMessageID chan int64
- wgSender sync.WaitGroup
wgClose sync.WaitGroup
- once sync.Once
outstandingRequests uint
messageMutex sync.Mutex
- requestTimeout time.Duration
+ requestTimeout int64
}
var _ Client = &Conn{}
@@ -142,7 +141,7 @@ func DialTLS(network, addr string, config *tls.Config) (*Conn, error) {
func NewConn(conn net.Conn, isTLS bool) *Conn {
return &Conn{
conn: conn,
- chanConfirm: make(chan bool),
+ chanConfirm: make(chan struct{}),
chanMessageID: make(chan int64),
chanMessage: make(chan *messagePacket, 10),
messageContexts: map[int64]*messageContext{},
@@ -158,12 +157,22 @@ func (l *Conn) Start() {
l.wgClose.Add(1)
}
+// isClosing returns whether or not we're currently closing.
+func (l *Conn) isClosing() bool {
+ return atomic.LoadUint32(&l.closing) == 1
+}
+
+// setClosing sets the closing value to true
+func (l *Conn) setClosing() bool {
+ return atomic.CompareAndSwapUint32(&l.closing, 0, 1)
+}
+
// Close closes the connection.
func (l *Conn) Close() {
- l.once.Do(func() {
- l.isClosing = true
- l.wgSender.Wait()
+ l.messageMutex.Lock()
+ defer l.messageMutex.Unlock()
+ if l.setClosing() {
l.Debug.Printf("Sending quit message and waiting for confirmation")
l.chanMessage <- &messagePacket{Op: MessageQuit}
<-l.chanConfirm
@@ -171,27 +180,25 @@ func (l *Conn) Close() {
l.Debug.Printf("Closing network connection")
if err := l.conn.Close(); err != nil {
- log.Print(err)
+ log.Println(err)
}
l.wgClose.Done()
- })
+ }
l.wgClose.Wait()
}
// SetTimeout sets the time after a request is sent that a MessageTimeout triggers
func (l *Conn) SetTimeout(timeout time.Duration) {
if timeout > 0 {
- l.requestTimeout = timeout
+ atomic.StoreInt64(&l.requestTimeout, int64(timeout))
}
}
// Returns the next available messageID
func (l *Conn) nextMessageID() int64 {
- if l.chanMessageID != nil {
- if messageID, ok := <-l.chanMessageID; ok {
- return messageID
- }
+ if messageID, ok := <-l.chanMessageID; ok {
+ return messageID
}
return 0
}
@@ -258,7 +265,7 @@ func (l *Conn) sendMessage(packet *ber.Packet) (*messageContext, error) {
}
func (l *Conn) sendMessageWithFlags(packet *ber.Packet, flags sendMessageFlags) (*messageContext, error) {
- if l.isClosing {
+ if l.isClosing() {
return nil, NewError(ErrorNetwork, errors.New("ldap: connection closed"))
}
l.messageMutex.Lock()
@@ -297,7 +304,7 @@ func (l *Conn) sendMessageWithFlags(packet *ber.Packet, flags sendMessageFlags)
func (l *Conn) finishMessage(msgCtx *messageContext) {
close(msgCtx.done)
- if l.isClosing {
+ if l.isClosing() {
return
}
@@ -316,12 +323,12 @@ func (l *Conn) finishMessage(msgCtx *messageContext) {
}
func (l *Conn) sendProcessMessage(message *messagePacket) bool {
- if l.isClosing {
+ l.messageMutex.Lock()
+ defer l.messageMutex.Unlock()
+ if l.isClosing() {
return false
}
- l.wgSender.Add(1)
l.chanMessage <- message
- l.wgSender.Done()
return true
}
@@ -333,15 +340,14 @@ func (l *Conn) processMessages() {
for messageID, msgCtx := range l.messageContexts {
// If we are closing due to an error, inform anyone who
// is waiting about the error.
- if l.isClosing && l.closeErr != nil {
- msgCtx.sendResponse(&PacketResponse{Error: l.closeErr})
+ if l.isClosing() && l.closeErr.Load() != nil {
+ msgCtx.sendResponse(&PacketResponse{Error: l.closeErr.Load().(error)})
}
l.Debug.Printf("Closing channel for MessageID %d", messageID)
close(msgCtx.responses)
delete(l.messageContexts, messageID)
}
close(l.chanMessageID)
- l.chanConfirm <- true
close(l.chanConfirm)
}()
@@ -350,11 +356,7 @@ func (l *Conn) processMessages() {
select {
case l.chanMessageID <- messageID:
messageID++
- case message, ok := <-l.chanMessage:
- if !ok {
- l.Debug.Printf("Shutting down - message channel is closed")
- return
- }
+ case message := <-l.chanMessage:
switch message.Op {
case MessageQuit:
l.Debug.Printf("Shutting down - quit message received")
@@ -377,14 +379,15 @@ func (l *Conn) processMessages() {
l.messageContexts[message.MessageID] = message.Context
// Add timeout if defined
- if l.requestTimeout > 0 {
+ requestTimeout := time.Duration(atomic.LoadInt64(&l.requestTimeout))
+ if requestTimeout > 0 {
go func() {
defer func() {
if err := recover(); err != nil {
log.Printf("ldap: recovered panic in RequestTimeout: %v", err)
}
}()
- time.Sleep(l.requestTimeout)
+ time.Sleep(requestTimeout)
timeoutMessage := &messagePacket{
Op: MessageTimeout,
MessageID: message.MessageID,
@@ -397,7 +400,7 @@ func (l *Conn) processMessages() {
if msgCtx, ok := l.messageContexts[message.MessageID]; ok {
msgCtx.sendResponse(&PacketResponse{message.Packet, nil})
} else {
- log.Printf("Received unexpected message %d, %v", message.MessageID, l.isClosing)
+ log.Printf("Received unexpected message %d, %v", message.MessageID, l.isClosing())
ber.PrintPacket(message.Packet)
}
case MessageTimeout:
@@ -439,8 +442,8 @@ func (l *Conn) reader() {
packet, err := ber.ReadPacket(l.conn)
if err != nil {
// A read error is expected here if we are closing the connection...
- if !l.isClosing {
- l.closeErr = fmt.Errorf("unable to read LDAP response packet: %s", err)
+ if !l.isClosing() {
+ l.closeErr.Store(fmt.Errorf("unable to read LDAP response packet: %s", err))
l.Debug.Printf("reader error: %s", err.Error())
}
return
diff --git a/vendor/github.com/go-ldap/ldap/conn_test.go b/vendor/github.com/go-ldap/ldap/conn_test.go
index 10766bbd4..488754d16 100644
--- a/vendor/github.com/go-ldap/ldap/conn_test.go
+++ b/vendor/github.com/go-ldap/ldap/conn_test.go
@@ -60,7 +60,7 @@ func TestUnresponsiveConnection(t *testing.T) {
// TestFinishMessage tests that we do not enter deadlock when a goroutine makes
// a request but does not handle all responses from the server.
-func TestConn(t *testing.T) {
+func TestFinishMessage(t *testing.T) {
ptc := newPacketTranslatorConn()
defer ptc.Close()
@@ -174,16 +174,12 @@ func testSendUnhandledResponsesAndFinish(t *testing.T, ptc *packetTranslatorConn
}
func runWithTimeout(t *testing.T, timeout time.Duration, f func()) {
- runtime.Gosched()
-
done := make(chan struct{})
go func() {
f()
close(done)
}()
- runtime.Gosched()
-
select {
case <-done: // Success!
case <-time.After(timeout):
@@ -192,7 +188,7 @@ func runWithTimeout(t *testing.T, timeout time.Duration, f func()) {
}
}
-// packetTranslatorConn is a helful type which can be used with various tests
+// packetTranslatorConn is a helpful type which can be used with various tests
// in this package. It implements the net.Conn interface to be used as an
// underlying connection for a *ldap.Conn. Most methods are no-ops but the
// Read() and Write() methods are able to translate ber-encoded packets for
@@ -245,7 +241,7 @@ func (c *packetTranslatorConn) Read(b []byte) (n int, err error) {
}
// SendResponse writes the given response packet to the response buffer for
-// this conection, signalling any goroutine waiting to read a response.
+// this connection, signalling any goroutine waiting to read a response.
func (c *packetTranslatorConn) SendResponse(packet *ber.Packet) error {
c.lock.Lock()
defer c.lock.Unlock()
diff --git a/vendor/github.com/go-ldap/ldap/debug.go b/vendor/github.com/go-ldap/ldap/debug.go
index b8a7ecbff..7279fc251 100644
--- a/vendor/github.com/go-ldap/ldap/debug.go
+++ b/vendor/github.com/go-ldap/ldap/debug.go
@@ -6,7 +6,7 @@ import (
"gopkg.in/asn1-ber.v1"
)
-// debbuging type
+// debugging type
// - has a Printf method to write the debug output
type debugging bool
diff --git a/vendor/github.com/go-ldap/ldap/dn.go b/vendor/github.com/go-ldap/ldap/dn.go
index a8ece3142..34e9023af 100644
--- a/vendor/github.com/go-ldap/ldap/dn.go
+++ b/vendor/github.com/go-ldap/ldap/dn.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
-// File contains DN parsing functionallity
+// File contains DN parsing functionality
//
// https://tools.ietf.org/html/rfc4514
//
@@ -52,7 +52,7 @@ import (
"fmt"
"strings"
- ber "gopkg.in/asn1-ber.v1"
+ "gopkg.in/asn1-ber.v1"
)
// AttributeTypeAndValue represents an attributeTypeAndValue from https://tools.ietf.org/html/rfc4514
@@ -143,6 +143,9 @@ func ParseDN(str string) (*DN, error) {
}
} else if char == ',' || char == '+' {
// We're done with this RDN or value, push it
+ if len(attribute.Type) == 0 {
+ return nil, errors.New("incomplete type, value pair")
+ }
attribute.Value = stringFromBuffer()
rdn.Attributes = append(rdn.Attributes, attribute)
attribute = new(AttributeTypeAndValue)
diff --git a/vendor/github.com/go-ldap/ldap/dn_test.go b/vendor/github.com/go-ldap/ldap/dn_test.go
index 5055cc15b..af5fc1468 100644
--- a/vendor/github.com/go-ldap/ldap/dn_test.go
+++ b/vendor/github.com/go-ldap/ldap/dn_test.go
@@ -75,11 +75,13 @@ func TestSuccessfulDNParsing(t *testing.T) {
func TestErrorDNParsing(t *testing.T) {
testcases := map[string]string{
- "*": "DN ended with incomplete type, value pair",
- "cn=Jim\\0Test": "Failed to decode escaped character: encoding/hex: invalid byte: U+0054 'T'",
- "cn=Jim\\0": "Got corrupted escaped character",
- "DC=example,=net": "DN ended with incomplete type, value pair",
- "1=#0402486": "Failed to decode BER encoding: encoding/hex: odd length hex string",
+ "*": "DN ended with incomplete type, value pair",
+ "cn=Jim\\0Test": "Failed to decode escaped character: encoding/hex: invalid byte: U+0054 'T'",
+ "cn=Jim\\0": "Got corrupted escaped character",
+ "DC=example,=net": "DN ended with incomplete type, value pair",
+ "1=#0402486": "Failed to decode BER encoding: encoding/hex: odd length hex string",
+ "test,DC=example,DC=com": "incomplete type, value pair",
+ "=test,DC=example,DC=com": "incomplete type, value pair",
}
for test, answer := range testcases {
diff --git a/vendor/github.com/go-ldap/ldap/error.go b/vendor/github.com/go-ldap/ldap/error.go
index ff697873d..4cccb537f 100644
--- a/vendor/github.com/go-ldap/ldap/error.go
+++ b/vendor/github.com/go-ldap/ldap/error.go
@@ -97,6 +97,13 @@ var LDAPResultCodeMap = map[uint8]string{
LDAPResultObjectClassModsProhibited: "Object Class Mods Prohibited",
LDAPResultAffectsMultipleDSAs: "Affects Multiple DSAs",
LDAPResultOther: "Other",
+
+ ErrorNetwork: "Network Error",
+ ErrorFilterCompile: "Filter Compile Error",
+ ErrorFilterDecompile: "Filter Decompile Error",
+ ErrorDebugging: "Debugging Error",
+ ErrorUnexpectedMessage: "Unexpected Message",
+ ErrorUnexpectedResponse: "Unexpected Response",
}
func getLDAPResultCode(packet *ber.Packet) (code uint8, description string) {
diff --git a/vendor/github.com/go-ldap/ldap/error_test.go b/vendor/github.com/go-ldap/ldap/error_test.go
index c010ebe3e..e456431bd 100644
--- a/vendor/github.com/go-ldap/ldap/error_test.go
+++ b/vendor/github.com/go-ldap/ldap/error_test.go
@@ -49,7 +49,7 @@ func TestConnReadErr(t *testing.T) {
// Send the signal after a short amount of time.
time.AfterFunc(10*time.Millisecond, func() { conn.signals <- expectedError })
- // This should block until the underlyiny conn gets the error signal
+ // This should block until the underlying conn gets the error signal
// which should bubble up through the reader() goroutine, close the
// connection, and
_, err := ldapConn.Search(searchReq)
@@ -58,7 +58,7 @@ func TestConnReadErr(t *testing.T) {
}
}
-// signalErrConn is a helful type used with TestConnReadErr. It implements the
+// signalErrConn is a helpful type used with TestConnReadErr. It implements the
// net.Conn interface to be used as a connection for the test. Most methods are
// no-ops but the Read() method blocks until it receives a signal which it
// returns as an error.
diff --git a/vendor/github.com/go-ldap/ldap/example_test.go b/vendor/github.com/go-ldap/ldap/example_test.go
index b018a9664..650af0a43 100644
--- a/vendor/github.com/go-ldap/ldap/example_test.go
+++ b/vendor/github.com/go-ldap/ldap/example_test.go
@@ -9,7 +9,7 @@ import (
)
// ExampleConn_Bind demonstrates how to bind a connection to an ldap user
-// allowing access to restricted attrabutes that user has access to
+// allowing access to restricted attributes that user has access to
func ExampleConn_Bind() {
l, err := ldap.Dial("tcp", fmt.Sprintf("%s:%d", "ldap.example.com", 389))
if err != nil {
@@ -63,10 +63,10 @@ func ExampleConn_StartTLS() {
log.Fatal(err)
}
- // Opertations via l are now encrypted
+ // Operations via l are now encrypted
}
-// ExampleConn_Compare demonstrates how to comapre an attribute with a value
+// ExampleConn_Compare demonstrates how to compare an attribute with a value
func ExampleConn_Compare() {
l, err := ldap.Dial("tcp", fmt.Sprintf("%s:%d", "ldap.example.com", 389))
if err != nil {
@@ -193,7 +193,7 @@ func Example_userAuthentication() {
searchRequest := ldap.NewSearchRequest(
"dc=example,dc=com",
ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false,
- fmt.Sprintf("(&(objectClass=organizationalPerson)&(uid=%s))", username),
+ fmt.Sprintf("(&(objectClass=organizationalPerson)(uid=%s))", username),
[]string{"dn"},
nil,
)
@@ -215,7 +215,7 @@ func Example_userAuthentication() {
log.Fatal(err)
}
- // Rebind as the read only user for any futher queries
+ // Rebind as the read only user for any further queries
err = l.Bind(bindusername, bindpassword)
if err != nil {
log.Fatal(err)
@@ -240,7 +240,7 @@ func Example_beherappolicy() {
if ppolicyControl != nil {
ppolicy = ppolicyControl.(*ldap.ControlBeheraPasswordPolicy)
} else {
- log.Printf("ppolicyControl response not avaliable.\n")
+ log.Printf("ppolicyControl response not available.\n")
}
if err != nil {
errStr := "ERROR: Cannot bind: " + err.Error()
diff --git a/vendor/github.com/go-ldap/ldap/filter.go b/vendor/github.com/go-ldap/ldap/filter.go
index 7eae310f1..3858a2865 100644
--- a/vendor/github.com/go-ldap/ldap/filter.go
+++ b/vendor/github.com/go-ldap/ldap/filter.go
@@ -82,7 +82,10 @@ func CompileFilter(filter string) (*ber.Packet, error) {
if err != nil {
return nil, err
}
- if pos != len(filter) {
+ switch {
+ case pos > len(filter):
+ return nil, NewError(ErrorFilterCompile, errors.New("ldap: unexpected end of filter"))
+ case pos < len(filter):
return nil, NewError(ErrorFilterCompile, errors.New("ldap: finished compiling filter with extra at end: "+fmt.Sprint(filter[pos:])))
}
return packet, nil
diff --git a/vendor/github.com/go-ldap/ldap/filter_test.go b/vendor/github.com/go-ldap/ldap/filter_test.go
index ae1b79b0c..2b019ac5d 100644
--- a/vendor/github.com/go-ldap/ldap/filter_test.go
+++ b/vendor/github.com/go-ldap/ldap/filter_test.go
@@ -132,6 +132,12 @@ var testFilters = []compileTest{
expectedErr: "unexpected end of filter",
},
compileTest{
+ filterStr: `((cn=)`,
+ expectedFilter: ``,
+ expectedType: 0,
+ expectedErr: "unexpected end of filter",
+ },
+ compileTest{
filterStr: `(&(objectclass=inetorgperson)(cn=中文))`,
expectedFilter: `(&(objectclass=inetorgperson)(cn=\e4\b8\ad\e6\96\87))`,
expectedType: 0,
diff --git a/vendor/github.com/go-ldap/ldap/ldap.go b/vendor/github.com/go-ldap/ldap/ldap.go
index d27e639d0..496924756 100644
--- a/vendor/github.com/go-ldap/ldap/ldap.go
+++ b/vendor/github.com/go-ldap/ldap/ldap.go
@@ -9,7 +9,7 @@ import (
"io/ioutil"
"os"
- ber "gopkg.in/asn1-ber.v1"
+ "gopkg.in/asn1-ber.v1"
)
// LDAP Application Codes
diff --git a/vendor/github.com/go-ldap/ldap/passwdmodify.go b/vendor/github.com/go-ldap/ldap/passwdmodify.go
index 26110ccf4..7d8246fd1 100644
--- a/vendor/github.com/go-ldap/ldap/passwdmodify.go
+++ b/vendor/github.com/go-ldap/ldap/passwdmodify.go
@@ -135,10 +135,10 @@ func (l *Conn) PasswordModify(passwordModifyRequest *PasswordModifyRequest) (*Pa
extendedResponse := packet.Children[1]
for _, child := range extendedResponse.Children {
if child.Tag == 11 {
- passwordModifyReponseValue := ber.DecodePacket(child.Data.Bytes())
- if len(passwordModifyReponseValue.Children) == 1 {
- if passwordModifyReponseValue.Children[0].Tag == 0 {
- result.GeneratedPassword = ber.DecodeString(passwordModifyReponseValue.Children[0].Data.Bytes())
+ passwordModifyResponseValue := ber.DecodePacket(child.Data.Bytes())
+ if len(passwordModifyResponseValue.Children) == 1 {
+ if passwordModifyResponseValue.Children[0].Tag == 0 {
+ result.GeneratedPassword = ber.DecodeString(passwordModifyResponseValue.Children[0].Data.Bytes())
}
}
}
diff --git a/vendor/github.com/go-ldap/ldap/search_test.go b/vendor/github.com/go-ldap/ldap/search_test.go
index efb8147d1..5f77b22e9 100644
--- a/vendor/github.com/go-ldap/ldap/search_test.go
+++ b/vendor/github.com/go-ldap/ldap/search_test.go
@@ -15,7 +15,7 @@ func TestNewEntry(t *testing.T) {
"delta": {"value"},
"epsilon": {"value"},
}
- exectedEntry := NewEntry(dn, attributes)
+ executedEntry := NewEntry(dn, attributes)
iteration := 0
for {
@@ -23,8 +23,8 @@ func TestNewEntry(t *testing.T) {
break
}
testEntry := NewEntry(dn, attributes)
- if !reflect.DeepEqual(exectedEntry, testEntry) {
- t.Fatalf("consequent calls to NewEntry did not yield the same result:\n\texpected:\n\t%s\n\tgot:\n\t%s\n", exectedEntry, testEntry)
+ if !reflect.DeepEqual(executedEntry, testEntry) {
+ t.Fatalf("subsequent calls to NewEntry did not yield the same result:\n\texpected:\n\t%s\n\tgot:\n\t%s\n", executedEntry, testEntry)
}
iteration = iteration + 1
}