]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/x3ldap.c
remove qualifiers warning
[irc/evilnet/x3.git] / src / x3ldap.c
index 0bd9e8fd00829c16f0d86b0755c48601f9510eda..de62b210793b78065869070bc8424e554f7b6006 100644 (file)
@@ -112,7 +112,7 @@ int ldap_do_admin_bind()
 }
 
 
-unsigned int ldap_check_auth( char *account, char *pass)
+unsigned int ldap_check_auth( const char *account, const char *pass)
 {
    char buff[MAXLEN];
 
@@ -167,7 +167,7 @@ int ldap_search_user(char *account, LDAPMessage **entry)
  * 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;
@@ -314,13 +314,14 @@ char **make_object_vals()
     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)
@@ -352,6 +353,13 @@ LDAPMod **make_mods_add(const char *account, const char *password, const char *e
     /* 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;