--- libaitcfg/src/pq.c 2012/09/19 12:25:16 1.1.2.6 +++ libaitcfg/src/pq.c 2012/09/19 12:35:10 1.1.2.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: pq.c,v 1.1.2.6 2012/09/19 12:25:16 misho Exp $ +* $Id: pq.c,v 1.1.2.7 2012/09/19 12:35:10 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -182,6 +182,7 @@ cfg_unsetPasswd(pwd_root_t * __restrict pwd, int crite * cfg_setPasswd() - Set item in password or adding new item if not exists * * @cfg = Password root + * @fields = Meaning continuous field * @csName = Username * @csPass = Password * @uid = UID @@ -195,7 +196,7 @@ cfg_unsetPasswd(pwd_root_t * __restrict pwd, int crite * return: 0 nothing changed, -1 error, 1 found and updated item or 2 added new item */ int -cfg_setPasswd(pwd_root_t * __restrict pwd, const char *csName, const char *csPass, +cfg_setPasswd(pwd_root_t * __restrict pwd, u_char fields, const char *csName, const char *csPass, u_int uid, u_int gid, const char *csClass, u_int change, u_int expire, const char *csRealm, const char *csHome, const char *csShell) { @@ -213,6 +214,10 @@ cfg_setPasswd(pwd_root_t * __restrict pwd, const char return -1; } else { memset(u, 0, sizeof(struct tagUser)); + if (fields && fields < PWD_MAX_FIELDS) + u->usr_fields = fields; + else + u->usr_fields = PWD_MAX_FIELDS - 1; PWD_LOCK(pwd); SLIST_INSERT_HEAD(pwd, u, usr_next);