2 ** Copyright 1998 - 2004 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
19 #include "courierauthstaticlist.h"
20 #include "courierauthdebug.h"
24 struct callback_info
{
26 int (*callback_func
)(struct authinfo
*, void *);
30 static int check_pw(struct authinfo
*a
, void *v
)
32 struct callback_info
*ci
=(struct callback_info
*)v
;
35 if (a
->passwd
== NULL
)
37 DPRINTF("no password available to compare");
42 if (authcheckpassword(ci
->pass
, a
->passwd
))
47 a
->clearpasswd
=ci
->pass
;
48 rc
=(*ci
->callback_func
)(a
, ci
->callback_arg
);
53 int auth_sys_common( int (*auth_pre_func
)(const char *,
55 int (*)(struct authinfo
*,
61 int (*callback_func
)(struct authinfo
*, void *),
64 struct callback_info ci
;
67 ci
.callback_func
=callback_func
;
68 ci
.callback_arg
=callback_arg
;
69 return (*auth_pre_func
)(user
, service
, check_pw
, &ci
);