2 ** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
19 #include "courierauthdebug.h"
22 int auth_pwd_pre(const char *userid
, const char *service
,
23 int (*callback
)(struct authinfo
*, void *),
29 memset(&auth
, 0, sizeof(auth
));
31 if ((pw
=getpwnam(userid
)) == 0)
33 if (errno
== ENOMEM
) return (1);
37 auth
.sysusername
=userid
;
38 auth
.sysgroupid
=pw
->pw_gid
;
39 auth
.homedir
=pw
->pw_dir
;
41 auth
.fullname
=pw
->pw_gecos
;
42 auth
.passwd
=pw
->pw_passwd
;
44 courier_authdebug_authinfo("DEBUG: authpwd: ", &auth
, 0, pw
->pw_passwd
);
45 return ((*callback
)(&auth
, arg
));