mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
Add ads_err2string() function for generating error strings from an ADS_STATUS.
I've got the cases besides gssapi...anyone know how to get those?
(This used to be commit c937e13522
)
This commit is contained in:
parent
adc57a79d9
commit
417b1ce487
@ -66,6 +66,21 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
|
||||
return ads_sasl_bind(ads);
|
||||
}
|
||||
|
||||
char *ads_err2string(ADS_STATUS status)
|
||||
{
|
||||
switch(status.error_type) {
|
||||
case ADS_ERROR_LDAP:
|
||||
return ldap_err2string(status.rc);
|
||||
case ADS_ERROR_KRB5:
|
||||
return error_message(status.rc);
|
||||
case ADS_ERROR_GSS:
|
||||
return "gssapi error";
|
||||
case ADS_ERROR_SYSTEM:
|
||||
return strerror(status.rc);
|
||||
default:
|
||||
return "unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
/* Do a search with paged results. cookie must be null on the first
|
||||
call, and then returned on each subsequent call. It will be null
|
||||
|
Loading…
Reference in New Issue
Block a user