]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/x3ldap.c
Merge branch 'master' of github.com:evilnet/x3
[irc/evilnet/x3.git] / src / x3ldap.c
index 1bc115838d98d9fd72ea07fd0402c7cae7a8f843..931ea525da81affc315be2b160bf502f5bc31afb 100644 (file)
  * along with srvx; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  *
+ * 
+ * INSTRUCTIONS:
+ *   * Setup an ldap server. Add inetOrgAnon to the schema (it is in tools/ldap)
+ *   * Make sure ldap is enabled at compile time (debian needs libldap2-dev package)
+ *   * Enable ldap in x3.conf and set everything
+ *   * Initial import: you can use the secret authserv search action add2ldap
+ *     to get your users into ldap. /msg authserv search add2ldap account *
  *
  * TODO:
  *   * get queries working in static existance, so i understand how it works
@@ -29,6 +36,8 @@
 #include "config.h"
 #ifdef WITH_LDAP
 
+#define LDAP_DEPRECATED 1
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <ldap.h>
@@ -276,7 +285,7 @@ char *make_password(const char *crypted)
        char *passbuf;
 
        packed = pack(crypted, &len);
-       base64_encode_alloc(packed, len, &base64pass);
+       base64_encode_alloc((char *)packed, len, &base64pass);
        passbuf = malloc(strlen(base64pass) + 1 + 5);
        strcpy(passbuf, "{MD5}");
        strcat(passbuf, base64pass);
@@ -360,7 +369,7 @@ int ldap_do_add(const char *account, const char *crypted, const char *email)
     LDAPMod **mods;
     int rc, i;
     int num_mods;
-    char *passbuf;
+    char *passbuf = NULL;
     
     if(!admin_bind && LDAP_SUCCESS != ( rc = ldap_do_admin_bind())) {
        log_module(MAIN_LOG, LOG_ERROR, "failed to bind as admin");