Fix Debian bug #675824

* lib/groupmem.c (__gr_dup): Support libc which define other
	fields in struct group.
	* lib/pwmem.c: Likewise for struct passwd.
	* lib/shadowmem.c: Likewise for struct spwd.
	* lib/sgroupio.c: Apply same logic, even if this structure is
	defined internally.
This commit is contained in:
Nicolas François
2013-08-06 16:30:38 +02:00
parent 5d491ef9da
commit fcb7222b1a
5 changed files with 19 additions and 0 deletions

View File

@@ -48,6 +48,8 @@
if (NULL == pw) {
return NULL;
}
/* The libc might define other fields. They won't be copied. */
memset (pw, 0, sizeof *pw);
pw->pw_uid = pwent->pw_uid;
pw->pw_gid = pwent->pw_gid;
pw->pw_name = strdup (pwent->pw_name);