Imported upstream version 0.61.0
[hcoop/debian/courier-authlib.git] / authpgsql.c
index 522215a..0e7b5cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
-** Copyright 2000-2005 Double Precision, Inc.  See COPYING for
+** Copyright 2000-2008 Double Precision, Inc.  See COPYING for
 ** distribution information.
 */
 #if    HAVE_CONFIG_H
 #include       "authpgsql.h"
 #include       "authstaticlist.h"
 #include       "courierauthdebug.h"
+#include       "libhmac/hmac.h"
+#include       "cramlib.h"
 
-static const char rcsid[]="$Id: authpgsql.c,v 1.13 2006/10/28 19:22:52 mrsam Exp $";
+static const char rcsid[]="$Id: authpgsql.c,v 1.14 2008/07/10 02:43:55 mrsam Exp $";
 
 extern void auth_pgsql_enumerate( void(*cb_func)(const char *name,
                                                 uid_t uid,
@@ -150,11 +152,6 @@ static int auth_pgsql_changepw(const char *service, const char *user,
        return (0);
 }
 
-#if HAVE_HMACLIB
-
-#include       "libhmac/hmac.h"
-#include       "cramlib.h"
-
 static int auth_pgsql_cram(const char *service,
                           const char *authtype, char *authdata,
                           int (*callback_func)(struct authinfo *, void *),
@@ -170,7 +167,6 @@ static int auth_pgsql_cram(const char *service,
 
        return auth_pgsql_pre(cci.user, service, &auth_cram_callback, &cci);
 }
-#endif
 
 int auth_pgsql(const char *service, const char *authtype, char *authdata,
               int (*callback_func)(struct authinfo *, void *),
@@ -180,13 +176,8 @@ int auth_pgsql(const char *service, const char *authtype, char *authdata,
                return (auth_pgsql_login(service, authdata,
                        callback_func, callback_arg));
 
-#if HAVE_HMACLIB
        return (auth_pgsql_cram(service, authtype, authdata,
                        callback_func, callback_arg));
-#else
-       errno=EPERM;
-       return (-1);
-#endif
 }
 
 extern int auth_pgsql_pre(const char *user, const char *service,