2 ** Copyright 1998 - 2004 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
19 #include "authstaticlist.h"
20 #include "courierauthdebug.h"
22 static const char rcsid
[]="$Id: authsyscommon.c,v 1.2 2005/02/20 04:41:20 mrsam Exp $";
25 struct callback_info
{
27 int (*callback_func
)(struct authinfo
*, void *);
31 static int check_pw(struct authinfo
*a
, void *v
)
33 struct callback_info
*ci
=(struct callback_info
*)v
;
36 if (a
->passwd
== NULL
)
38 DPRINTF("no password available to compare");
43 if (authcheckpassword(ci
->pass
, a
->passwd
))
48 a
->clearpasswd
=ci
->pass
;
49 rc
=(*ci
->callback_func
)(a
, ci
->callback_arg
);
54 int auth_sys_common( int (*auth_pre_func
)(const char *,
56 int (*)(struct authinfo
*,
62 int (*callback_func
)(struct authinfo
*, void *),
65 struct callback_info ci
;
68 ci
.callback_func
=callback_func
;
69 ci
.callback_arg
=callback_arg
;
70 return (*auth_pre_func
)(user
, service
, check_pw
, &ci
);