Package: dpkg
Version: 1.16.0.3
Severity: normal

start-stop-daemon is expected (as per man page) to set the supplemental
groups of a user when called with option "-c user:group".
This happens if the user is given in cleartext, not when passed as number.
Both are legal based on the man page.

Behaviour verified on latest Debian stable 6.0.2 (vanilla live image)
and on current Debian testing/unstable (dpkg 1.16.0.3).

user@debian:~$ dpkg -s dpkg | grep Version
Version: 1.15.8.11
user@debian:~$ grep "user" /etc/passwd
user:x:1000:1000:Debian Live user,,,:/home/user:/bin/bash
user@debian:~$ grep "user" /etc/group
cdrom:x:24:user
floppy:x:25:user
audio:x:29:user
dip:x:30:user
video:x:44:user
plugdev:x:46:user
users:x:100:
user:x:1000:
user@debian:~$ sudo -i
root@debian:~# start-stop-daemon -S -c user:dip -x /usr/bin/id
uid=1000(user) gid=30(dip)
groups=1000(user),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev)
root@debian:~# start-stop-daemon -S -c user:30 -x /usr/bin/id
uid=1000(user) gid=30(dip)
groups=1000(user),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev)
root@debian:~# start-stop-daemon -S -c 1000:dip -x /usr/bin/id
uid=1000(user) gid=30(dip) groups=1000(user),30(dip)
root@debian:~# start-stop-daemon -S -c 1000:30 -x /usr/bin/id
uid=1000(user) gid=30(dip) groups=1000(user),30(dip)
root@debian:~# 

Tracking it down in the source, the culprit is the call to initgroups().
It's defined as "int initgroups(const char *user, gid_t group)", but
apparently only works with cleartext usernames, but not with an uid
passed as text. In the latter two cases (-c 1000:whatever), the user is
passed as string containing a number, i.e. "1000".
Unfortunately, initgroups() still returns 0 for success in this case...

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-proposed-updates'), (500, 
'stable-updates'), (500, 'proposed-updates'), (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.39.2 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dpkg depends on:
ii  coreutils    8.5-1                
ii  libbz2-1.0   1.0.5-6              
ii  libc6        2.13-18              
ii  libselinux1  2.1.0-1              
ii  xz-utils     5.1.1alpha+20110809-2
ii  zlib1g       1:1.2.3.4.dfsg-3     

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt  0.8.15.6

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to