--- libaitcfg/src/pq.c 2012/09/19 15:22:32 1.2 +++ libaitcfg/src/pq.c 2012/12/11 09:37:26 1.2.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: pq.c,v 1.2 2012/09/19 15:22:32 misho Exp $ +* $Id: pq.c,v 1.2.2.1 2012/12/11 09:37:26 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -195,13 +195,13 @@ 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 + * @fields = Following parameters are continuous to certain field * @csName = Username * @arg1 = Password * @arg2 = UID * @arg3 = GID * @arg4 = Login class - * @arg5 = Chage date + * @arg5 = Change date * @arg6 = Expire date * @arg7 = Realm * @arg8 = Home dir @@ -209,7 +209,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, u_char fields, const char *csName, ...) +cfg_setPasswd(pwd_root_t * __restrict pwd, passwd_attr_t fields, const char *csName, ...) { struct tagUser *u; register int i; @@ -227,8 +227,8 @@ cfg_setPasswd(pwd_root_t * __restrict pwd, u_char fiel return -1; } else { memset(u, 0, sizeof(struct tagUser)); - if (fields && fields < PWD_MAX_FIELDS) - u->usr_fields = fields; + if (fields >= Username && fields <= Shell) + u->usr_fields = (int) fields; else u->usr_fields = PWD_MAX_FIELDS - 1;