--- libaitcfg/inc/aitpwd.h 2012/09/18 13:32:48 1.1.2.4 +++ libaitcfg/inc/aitpwd.h 2012/09/18 15:50:59 1.1.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitpwd.h,v 1.1.2.4 2012/09/18 13:32:48 misho Exp $ +* $Id: aitpwd.h,v 1.1.2.5 2012/09/18 15:50:59 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -50,6 +50,11 @@ SUCH DAMAGE. #include +#define PWD_CRIT_NAME 0 +#define PWD_CRIT_UID 1 +#define PWD_CRIT_GID 2 + + struct tagAcctDB { unsigned short db_ver; unsigned char db_lock; @@ -174,6 +179,25 @@ int cfgWritePasswd(FILE *f, pwd_root_t * __restrict pw * return: -1 error or 0 ok */ int cfgConcatPasswd(pwd_root_t * __restrict pwd, pwd_root_t * __restrict add_pwd); + +/* + * cfg_findPasswdBy() - Find user by criteria position in list + * + * @pwd = Password root + * @criteria = Search criteria [PWD_CRIT_NAME|PWD_CRIT_UID|PWD_CRIT_GID] + * @arg1 = Username | UID | GID + * return: NULL not found item or error and !=NULL found item + */ +struct tagUser *cfg_findPasswdBy(pwd_root_t * __restrict pwd, int criteria, ...); +/* + * cfg_unsetPasswd() - Unset item from passwords and free resources + * + * @pwd = Password root + * @criteria = Search criteria [PWD_CRIT_NAME|PWD_CRIT_UID] + * @arg1 = Username | UID + * return: 0 item not found, -1 error or 1 removed item + */ +int cfg_unsetPasswd(pwd_root_t * __restrict pwd, int criteria, ...); #if 0 /*