[Adduser-devel] Bug#294579: adduser adds more users than needed in /etc/group

Vincent Bernat Vincent Bernat <bernat@free.fr>, 294579@bugs.debian.org
Thu, 10 Feb 2005 15:53:33 +0100

Package: adduser
Version: 3.59
Severity: minor

Hi !

We use LDAP to manage adm group, except for local users. For example,
in /etc/group, adm contains only "logcheck", but if we ask what users
are in adm, via NSS, we get more answers fetched from the LDAP base.

When adding a local user to adm with "adduser user adm", all users
from the LDAP base are added too. The problem lies in the
addusertogroup function in adduser. It uses result fetched via NSS to
build a new line and give it to gpasswd. There are alternatives, like
using -a switch of gpasswd but they have been commented out :

    # FIXME - the next line has a race condition.
    #&systemcall('usermod', '-G',
                #join(",", get_users_groups($existing_user), $existing_group), 
    &systemcall('/usr/bin/gpasswd', '-M',
                join(',', get_group_members($existing_group), $existing_user),
    #&systemcall('gpasswd', '-a',$existing_user,$existing_group);

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-k7
Locale: LANG=fr_FR@euro, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15)

Versions of packages adduser depends on:
ii  debconf                     1.4.45       Debian configuration management sy
ii  passwd                      1:4.0.3-30.9 change and administer password and
ii  perl-base                   5.8.4-6      The Pathologically Eclectic Rubbis

-- no debconf information