* lib/groupio.c, lib/sgroupio.c, lib/shadowio.c, lib/pwio.c: Check

entry validity before commits to databases.
	* libmisc/fields.c, libmisc/Makefile.am, lib/fields.c,
	lib/Makefile.am, po/POTFILES.in: fields.c moved from libmisc to
	lib.
This commit is contained in:
nekral-guest
2011-02-16 20:32:16 +00:00
parent a9b8e7aaa3
commit d7fa77f03b
10 changed files with 86 additions and 5 deletions

View File

@ -76,6 +76,12 @@ static int shadow_put (const void *ent, FILE * file)
{
const struct spwd *sp = ent;
if ( (NULL == sp)
|| (valid_field (sp->sp_namp, ":\n") == -1)
|| (valid_field (sp->sp_pwdp, ":\n") == -1)) {
return -1;
}
return (putspent (sp, file) == -1) ? -1 : 0;
}