Imported upstream version 0.61.0
[hcoop/debian/courier-authlib.git] / authdaemon.c
index 7fdf2a0..4773b58 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.
 */
 
@@ -18,7 +18,7 @@
 #include       <sys/select.h>
 #include       "numlib/numlib.h"
 
-static const char rcsid[]="$Id: authdaemon.c,v 1.17 2005/06/30 16:16:07 mrsam Exp $";
+static const char rcsid[]="$Id: authdaemon.c,v 1.18 2008/06/29 16:39:24 mrsam Exp $";
 
 extern int authdaemondo(const char *authreq,
        int (*func)(struct authinfo *, void *), void *arg);
@@ -55,7 +55,10 @@ int auth_generic(const char *service,
        strcat(strcat(buf, authtype), "\n");
        strcat(buf, authdata);
 
-       rc=authdaemondo(buf, callback_func, callback_arg);
+       rc=strcmp(authtype, "EXTERNAL") == 0
+               ? auth_getuserinfo(service, authdata, callback_func,
+                                  callback_arg)
+               : authdaemondo(buf, callback_func, callback_arg);
        free(buf);
 
        if (courier_authdebug_login_level)