Import Debian package 0.61.0-1+lenny1
[hcoop/debian/courier-authlib.git] / authmysql.c
index 576ea05..02ace85 100644 (file)
@@ -1,5 +1,5 @@
 /*
-** Copyright 2000-2004 Double Precision, Inc.  See COPYING for
+** Copyright 2000-2008 Double Precision, Inc.  See COPYING for
 ** distribution information.
 */
 #if    HAVE_CONFIG_H
 #include       "authmysql.h"
 #include       "authstaticlist.h"
 #include       "courierauthdebug.h"
+#include       "libhmac/hmac.h"
+#include       "cramlib.h"
 
-static const char rcsid[]="$Id: authmysql.c,v 1.23 2006/10/28 19:22:52 mrsam Exp $";
+static const char rcsid[]="$Id: authmysql.c,v 1.24 2008/07/10 02:43:55 mrsam Exp $";
 
 extern void auth_mysql_enumerate( void(*cb_func)(const char *name,
                                                 uid_t uid,
@@ -150,12 +152,6 @@ static int auth_mysql_changepw(const char *service, const char *user,
        return (0);
 }
 
-#if HAVE_HMACLIB
-
-#include       "libhmac/hmac.h"
-#include       "cramlib.h"
-
-
 static int auth_mysql_cram(const char *service,
                           const char *authtype, char *authdata,
                           int (*callback_func)(struct authinfo *, void *),
@@ -171,7 +167,6 @@ static int auth_mysql_cram(const char *service,
 
        return auth_mysql_pre(cci.user, service, &auth_cram_callback, &cci);
 }
-#endif
 
 int auth_mysql(const char *service, const char *authtype, char *authdata,
               int (*callback_func)(struct authinfo *, void *),
@@ -181,13 +176,8 @@ int auth_mysql(const char *service, const char *authtype, char *authdata,
                return (auth_mysql_login(service, authdata,
                        callback_func, callback_arg));
 
-#if HAVE_HMACLIB
        return (auth_mysql_cram(service, authtype, authdata,
                        callback_func, callback_arg));
-#else
-       errno=EPERM;
-       return (-1);
-#endif
 }
 
 extern int auth_mysql_pre(const char *user, const char *service,