2 ** Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
3 ** distribution information.
7 #include "courier_auth_config.h"
19 #include "courierauthdebug.h"
21 static const char rcsid
[]="$Id: preauthpwd.c,v 1.8 2004/10/21 00:10:49 mrsam Exp $";
23 int auth_pwd_pre(const char *userid
, const char *service
,
24 int (*callback
)(struct authinfo
*, void *),
30 memset(&auth
, 0, sizeof(auth
));
32 if ((pw
=getpwnam(userid
)) == 0)
34 if (errno
== ENOMEM
) return (1);
38 auth
.sysusername
=userid
;
39 auth
.sysgroupid
=pw
->pw_gid
;
40 auth
.homedir
=pw
->pw_dir
;
42 auth
.fullname
=pw
->pw_gecos
;
43 auth
.passwd
=pw
->pw_passwd
;
45 courier_authdebug_authinfo("DEBUG: authpwd: ", &auth
, 0, pw
->pw_passwd
);
46 return ((*callback
)(&auth
, arg
));