[Pkg-shadow-devel] userdel segfault in remove_usergroup()

Peter Vrabec pvrabec at redhat.com
Wed Mar 21 10:26:34 UTC 2012


Hi Mike,


On Tuesday, March 20, 2012 01:37:40 PM Mike Frysinger wrote:
> On Tuesday 20 March 2012 12:48:57 Peter Vrabec wrote:
> > please see the patch.
> 
> pretty sure this patch is incorrect.  you're changing from the group name to
> the user name.
I suppose that group name and user name are equal.


/*
 * remove_usergroup - delete the user's group if it is a usergroup
 *
 *      An usergroup is removed if
 *        + it has the same name as the user
 *        + it is the primary group of the user
 *        + it has no other members
 *        + it is not the primary group of any other user
 */
static void remove_usergroup (void)
{
        const struct group *grp;
        const struct passwd *pwd = NULL;

        grp = gr_locate (user_name);
        if (NULL == grp) {
                /* This user has no usergroup. */
                return;
        }


> i posted a patch to fix this already:
> http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2012-February/0091
> 59.html -mike

I'm sorry I didn't notice it. It's not in upstream repository, is it?

Peter.



More information about the Pkg-shadow-devel mailing list