File tree 2 files changed +22
-12
lines changed
2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -269,13 +269,18 @@ func addRequestDescriptions(packet *ber.Packet) error {
269
269
}
270
270
271
271
func addDefaultLDAPResponseDescriptions (packet * ber.Packet ) error {
272
- err := GetLDAPError (packet )
273
- if err == nil {
274
- return nil
272
+ resultCode := uint16 (LDAPResultSuccess )
273
+ matchedDN := ""
274
+ description := "Success"
275
+ if err := GetLDAPError (packet ); err != nil {
276
+ resultCode = err .(* Error ).ResultCode
277
+ matchedDN = err .(* Error ).MatchedDN
278
+ description = "Error Message"
275
279
}
276
- packet .Children [1 ].Children [0 ].Description = "Result Code (" + LDAPResultCodeMap [err .(* Error ).ResultCode ] + ")"
277
- packet .Children [1 ].Children [1 ].Description = "Matched DN (" + err .(* Error ).MatchedDN + ")"
278
- packet .Children [1 ].Children [2 ].Description = "Error Message"
280
+
281
+ packet .Children [1 ].Children [0 ].Description = "Result Code (" + LDAPResultCodeMap [resultCode ] + ")"
282
+ packet .Children [1 ].Children [1 ].Description = "Matched DN (" + matchedDN + ")"
283
+ packet .Children [1 ].Children [2 ].Description = description
279
284
if len (packet .Children [1 ].Children ) > 3 {
280
285
packet .Children [1 ].Children [3 ].Description = "Referral"
281
286
}
Original file line number Diff line number Diff line change @@ -269,13 +269,18 @@ func addRequestDescriptions(packet *ber.Packet) error {
269
269
}
270
270
271
271
func addDefaultLDAPResponseDescriptions (packet * ber.Packet ) error {
272
- err := GetLDAPError (packet )
273
- if err == nil {
274
- return nil
272
+ resultCode := uint16 (LDAPResultSuccess )
273
+ matchedDN := ""
274
+ description := "Success"
275
+ if err := GetLDAPError (packet ); err != nil {
276
+ resultCode = err .(* Error ).ResultCode
277
+ matchedDN = err .(* Error ).MatchedDN
278
+ description = "Error Message"
275
279
}
276
- packet .Children [1 ].Children [0 ].Description = "Result Code (" + LDAPResultCodeMap [err .(* Error ).ResultCode ] + ")"
277
- packet .Children [1 ].Children [1 ].Description = "Matched DN (" + err .(* Error ).MatchedDN + ")"
278
- packet .Children [1 ].Children [2 ].Description = "Error Message"
280
+
281
+ packet .Children [1 ].Children [0 ].Description = "Result Code (" + LDAPResultCodeMap [resultCode ] + ")"
282
+ packet .Children [1 ].Children [1 ].Description = "Matched DN (" + matchedDN + ")"
283
+ packet .Children [1 ].Children [2 ].Description = description
279
284
if len (packet .Children [1 ].Children ) > 3 {
280
285
packet .Children [1 ].Children [3 ].Description = "Referral"
281
286
}
You can’t perform that action at this time.
0 commit comments