]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/x3ldap.c
more python work. Not safe to run yet
[irc/evilnet/x3.git] / src / x3ldap.c
index fd47ac8cae7fc27b0474cbf1687e5a7fede1d695..1ed4b1e980a9ff47b5d2e54a56a2b0afa2b4c29f 100644 (file)
@@ -5,7 +5,7 @@
  *
  * x3 is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -272,7 +272,7 @@ char *base64_encode(const unsigned  char *str, int length, int *ret_length)
         return NULL;
     }
 
-    result = (char *)calloc(((length + 2) / 3) * 4, sizeof(char));
+    result = (char *)calloc((((length + 2) / 3) * 4)+1, sizeof(char));
     p = result;
 
     while (length > 2) { /* keep going until we have less than 24 bits */
@@ -610,7 +610,7 @@ int ldap_add2group(char *account, const char *group)
        return LDAP_OTHER;
     }
     rc = ldap_modify_s(ld, group, mods);
-    if(rc != LDAP_SUCCESS && rc != LDAP_ALREADY_EXISTS) {
+    if(rc != LDAP_SUCCESS && rc != LDAP_TYPE_OR_VALUE_EXISTS) {
        log_module(MAIN_LOG, LOG_ERROR, "Error adding %s to group %s: %s", account, group, ldap_err2string(rc));
        return rc;
     }