diff options
author | Michael Mitton <mmitton@gmail.com> | 2011-02-18 19:18:26 +0100 |
---|---|---|
committer | Michael Mitton <mmitton@gmail.com> | 2011-02-18 19:18:26 +0100 |
commit | d1c9906e5f9291adbc5f52591d8d89acca201adb (patch) | |
tree | 69ec477f95e9fa8597578ec4b8b72d21ba6f49b3 /bind.go | |
parent | Fixed Typo (diff) | |
download | ldap-d1c9906e5f9291adbc5f52591d8d89acca201adb.tar ldap-d1c9906e5f9291adbc5f52591d8d89acca201adb.tar.gz ldap-d1c9906e5f9291adbc5f52591d8d89acca201adb.tar.bz2 ldap-d1c9906e5f9291adbc5f52591d8d89acca201adb.tar.lz ldap-d1c9906e5f9291adbc5f52591d8d89acca201adb.tar.xz ldap-d1c9906e5f9291adbc5f52591d8d89acca201adb.tar.zst ldap-d1c9906e5f9291adbc5f52591d8d89acca201adb.zip |
Diffstat (limited to 'bind.go')
-rw-r--r-- | bind.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -35,7 +35,7 @@ func (l *Conn) Bind( username, password string ) *Error { defer l.finishMessage( messageID ) packet = <-channel - if packet != nil { + if packet == nil { return NewError( ErrorNetwork, os.NewError( "Could not retrieve response" ) ) } @@ -46,5 +46,10 @@ func (l *Conn) Bind( username, password string ) *Error { ber.PrintPacket( packet ) } + result_code, result_description := getLDAPResultCode( packet ) + if result_code != 0 { + return NewError( result_code, os.NewError( result_description ) ) + } + return nil } |