Marc Haber
2005-Nov-01 16:48 UTC
Bug#336843: adduser: removes user from group if /etc/group file ends with ":"
Package: adduser Version: 3.77 Severity: normal If a line in /etc/group ends with a colon, adduser user group removes the last user listed in /etc/group: $ cat /etc/group | grep ^adm adm:x:4:Debian-console-log,mh: $ sudo adduser --debug Debian-exim adm Adding user Debian-exim'' to group adm''... Done. $ cat /etc/group | grep ^adm adm:x:4:Debian-console-log,Debian-exim $ Setting $verbose=2 prior to the systemcall() in the adduser code reveals that adduser calls /usr/bin/gpasswd -M Debian-console-log,Debian-exim adm so it is really adduser''s fault that mh vanishes from the user list. Greetings Marc -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, ''unstable''), (500, ''stable'') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.14-zgsrv Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1) Versions of packages adduser depends on: ii debconf [debconf-2.0] 1.4.58 Debian configuration management sy ii passwd 1:4.0.13-3 change and administer password and ii perl-base 5.8.7-7 The Pathologically Eclectic Rubbis adduser recommends no packages. -- debconf information: * adduser/homedir-permission: true
Marc Haber
2005-Nov-03 20:33 UTC
[Adduser-devel] Bug#336843: adduser: removes user from group if /etc/group file ends with ":"
reassign #336843 perl retitle #336843 getgrnam returns trailing ":" in user name thanks On Tue, Nov 01, 2005 at 05:43:40PM +0100, Marc Haber wrote:> If a line in /etc/group ends with a colon, adduser user group removes > the last user listed in /etc/group: > > $ cat /etc/group | grep ^adm > adm:x:4:Debian-console-log,mh: > $ sudo adduser --debug Debian-exim adm > Adding user Debian-exim'' to group adm''... > Done. > $ cat /etc/group | grep ^adm > adm:x:4:Debian-console-log,Debian-exim > $ > > Setting $verbose=2 prior to the systemcall() in the adduser code > reveals that adduser calls > /usr/bin/gpasswd -M Debian-console-log,Debian-exim adm > so it is really adduser''s fault that mh vanishes from the user list.Actually, it''s perl''s fault: $ grep ''^wheel'' /etc/group wheel:x:104:mh,scyadmin $ perl -e ''foreach (split(/ /, (getgrnam("wheel"))[3])) { print "$_\n"; };'' mh scyadmin $ grep ''^wheel'' /etc/group wheel:x:104:mh,scyadmin: $ perl -e ''foreach (split(/ /, (getgrnam("wheel"))[3])) { print "$_\n"; };'' mh scyadmin: [12/511]mh@scyw00225:~$ Judged that ":" is the field separator in /etc/group, and that /etc/group might change its format to include more fields, and that a colon is not a valid character in a user name (it would wreck havoc in /etc/passwd), I would expect that perl would consider the ":" a delimiter here and not return it as part of the group name. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
Debian Bug Tracking System
2005-Nov-03 20:33 UTC
[Adduser-devel] Processed: Re: Bug#336843: adduser: removes user from group if /etc/group file ends with ":"
Processing commands for control@bugs.debian.org:> reassign #336843 perlBug#336843: adduser: removes user from group if /etc/group file ends with ":" Bug reassigned from package `adduser'' to `perl''.> retitle #336843 getgrnam returns trailing ":" in user nameBug#336843: adduser: removes user from group if /etc/group file ends with ":" Changed Bug title.> thanksStopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator (administrator, Debian Bugs database)