--- libaitcfg/inc/aitpwd.h 2012/09/18 08:44:19 1.1.2.2 +++ libaitcfg/inc/aitpwd.h 2012/09/18 13:24:50 1.1.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitpwd.h,v 1.1.2.2 2012/09/18 08:44:19 misho Exp $ +* $Id: aitpwd.h,v 1.1.2.3 2012/09/18 13:24:50 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -71,6 +71,8 @@ typedef int (*cb_acct_f)(void * /*current db_record*/, struct tagUser { + int usr_fields; + ait_val_t usr_name; ait_val_t usr_pass; ait_val_t usr_uid; @@ -82,8 +84,8 @@ struct tagUser { ait_val_t usr_home; ait_val_t usr_shell; - SLIST_ENTRY(tagCfg) usr_next; - RB_ENTRY(tagCfg) usr_node; + SLIST_ENTRY(tagUser) usr_next; + RB_ENTRY(tagUser) usr_node; }; typedef struct tagPWD { pthread_mutex_t pwd_mtx; @@ -147,6 +149,23 @@ void cfgUnloadPasswd(pwd_root_t * __restrict pwd); * return: -1 error or 0 ok */ int cfgCreatePasswd(const char *pwdName, pwd_root_t * __restrict pwd); + +/* + * cfgReadPasswd() - Read file and add new item at password root + * + * @f = File resource + * @pwd = Password root + * return: -1 error or 0 ok + */ +int cfgReadPasswd(FILE *f, pwd_root_t * __restrict pwd); +/* + * cfgWritePasswd() - Write passwords from memory + * + * @f = File handle + * @pwd = Password root + * return: -1 error or 0 ok + */ +int cfgWritePasswd(FILE *f, pwd_root_t * __restrict pwd); #if 0 /*