http://qa.mandrakesoft.com/show_bug.cgi?id=5622





------- Additional Comments From [EMAIL PROTECTED]  2003-18-09 13:16 -------
Could not reproduce

-- 
Configure bugmail: http://qa.mandrakesoft.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


------- Reminder: -------
assigned_to: [EMAIL PROTECTED]
status: UNCONFIRMED
creation_date: 
description: 
Attempting to use useradd always coredumps if the -G flag isn't given. The
reason is the the variable user_groups is allocated but the entries are never
initialized (unless the -G flag was specified so that get_groups() is called),
so is_on_list() (called from grp_update()) tests an invalid pointer. The patch
is simple:

-------------------------------------------------------------------------
--- shadow-4.0.3/src/useradd.c.orig 2003-09-12 18:30:30.000000000 -0700
+++ shadow-4.0.3/src/useradd.c 2003-09-12 17:51:26.000000000 -0700
@@ -1969,6 +1969,7 @@
 
  sys_ngroups = sysconf (_SC_NGROUPS_MAX);
  user_groups = malloc ((1 + sys_ngroups) * sizeof (char *));
+ user_groups[0] = (char *) 0;
  Prog = Basename (argv[0]);
 
  setlocale (LC_ALL, "");
----------------------------------------------------------------------------

The original coredumps every single time on a system with kernel
2.4.21-0.25mdksecure, glibc-2.3.1-10mdk, and using libsafe-2.0.13-2mdk.

Reply via email to