}
-unsigned int ldap_check_auth( char *account, char *pass)
+unsigned int ldap_check_auth( const char *account, const char *pass)
{
char buff[MAXLEN];
* 0 or 2+ entries are matched, or the proper ldap error
* code for other errors.
*/
-int ldap_get_user_info(char *account, char **email)
+int ldap_get_user_info(const char *account, char **email)
{
int rc;
char **value;
if(object_vals)
free(object_vals);
- object_vals = malloc(sizeof( *object_vals ) * nickserv_conf.ldap_object_classes->used);
+ object_vals = malloc(sizeof( *object_vals ) * (nickserv_conf.ldap_object_classes->used+1));
for(y = 0; y < nickserv_conf.ldap_object_classes->used; y++) {
object_vals[y] = nickserv_conf.ldap_object_classes->list[y];
}
object_vals[y] = NULL;
return object_vals;
+ /* NOTE: The return value of this is only good until the next call to it. */
}
char *make_password(const char *crypted)
/* TODO: take this from nickserv_conf.ldap_add_objects */
LDAPMod **mods;
static char **object_vals;
+
+ account_vals[0] = NULL;
+ account_vals[1] = NULL;
+ password_vals[0] = NULL;
+ password_vals[1] = NULL;
+ email_vals[0] = NULL;
+ email_vals[1] = NULL;
object_vals = make_object_vals();
account_vals[0] = (char *) account;
void ldap_close()
{
admin_bind = false;
- ldap_unbind(ld);
+ ldap_unbind_ext(ld, NULL, NULL);
}
#endif