Import Upstream version 0.69.0
[hcoop/debian/courier-authlib.git] / authldap.c
index c0144f9..d69cde1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-** Copyright 1998 - 2004 Double Precision, Inc.  See COPYING for
+** Copyright 1998 - 2008 Double Precision, Inc.  See COPYING for
 ** distribution information.
 */
 
 
 #include       "auth.h"
 #include       "authldap.h"
-#include       "authstaticlist.h"
+#include       "courierauth.h"
+#include       "courierauthstaticlist.h"
 #include       "courierauthdebug.h"
-
-static const char rcsid[]="$Id: authldap.c,v 1.22 2005/03/20 19:10:30 mrsam Exp $";
-
-extern void auth_ldap_enumerate( void(*cb_func)(const char *name,
-                                               uid_t uid,
-                                               gid_t gid,
-                                               const char *homedir,
-                                               const char *maildir,
-                                               const char *options,
-                                               void *void_arg),
-                                void *void_arg);
+#include       "libhmac/hmac.h"
 
 static int auth_ldap_login(const char *service, char *authdata,
                           int (*callback_func)(struct authinfo *, void *),
@@ -46,11 +37,6 @@ static int auth_ldap_login(const char *service, char *authdata,
                              callback_arg);
 }
 
-#if HAVE_HMACLIB
-
-#include       "libhmac/hmac.h"
-#include       "cramlib.h"
-
 static int auth_ldap_cram(const char *service,
                          const char *authtype, char *authdata,
                          int (*callback_func)(struct authinfo *, void *),
@@ -66,7 +52,6 @@ static int auth_ldap_cram(const char *service,
 
        return authldapcommon(service, cci.user, 0, &auth_cram_callback, &cci);
 }
-#endif
 
 int auth_ldap(const char *service, const char *authtype, char *authdata,
              int (*callback_func)(struct authinfo *, void *),
@@ -76,13 +61,8 @@ int auth_ldap(const char *service, const char *authtype, char *authdata,
                return (auth_ldap_login(service, authdata,
                        callback_func, callback_arg));
 
-#if HAVE_HMACLIB
        return (auth_ldap_cram(service, authtype, authdata,
                        callback_func, callback_arg));
-#else
-       errno=EPERM;
-       return (-1);
-#endif
 }
 
 
@@ -90,9 +70,6 @@ extern int auth_ldap_pre(const char *userid, const char *service,
         int (*callback)(struct authinfo *, void *),
                  void *arg);
 
-extern int auth_ldap_changepw(const char *, const char *, const char *,
-                             const char *);
-
 static struct authstaticinfo authldap_info={
        "authldap",
        auth_ldap,