X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/b96027ad8b800e3346f51f7dfe07bed814487681..a6fa003552075b0cd7873939a555da6f2de6f332:/src/x3ldap.c diff --git a/src/x3ldap.c b/src/x3ldap.c index fd47ac8..1ed4b1e 100644 --- a/src/x3ldap.c +++ b/src/x3ldap.c @@ -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; }