37 #include <yaz/xmalloc.h>
59 static int get_entry (
const char **p,
char *dst,
int max)
62 while ((*p)[i] !=
':' && (*p)[i])
80 f = fopen (fname,
"r");
83 while (fgets (buf,
sizeof(buf)-1, f))
90 if ((p = strchr (buf,
'\n')))
125 yaz_log (YLOG_LOG,
"%s:%s", pe->
name, pe->
des);
134 if (user && !strcmp (user, pe->
name))
145 if (strlen (pe->
des) < 3)
148 if (pe->
des[0] !=
'$')
150 if (strlen(pass) > 8)
153 des_try = crypt (pass, pe->
des);
156 if (strcmp (des_try, pe->
des))
166 if (strcmp (pe->
des, pass))
void passwd_db_close(Passwd_db db)
static int get_entry(const char **p, char *dst, int max)
void passwd_db_show(Passwd_db db)
Passwd_db passwd_db_open(void)
int passwd_db_auth(Passwd_db db, const char *user, const char *pass)
int passwd_db_file_plain(Passwd_db db, const char *fname)
static int passwd_db_file_int(Passwd_db db, const char *fname, int encrypt_flag)
int passwd_db_file_crypt(Passwd_db db, const char *fname)
struct passwd_entry * entries
struct passwd_entry * next