Debian Bug report logs - #617480
‘delgroup 0’ spews ‘Use of uninitialized value $gr_gid’

version graph

Package: adduser; Maintainer for adduser is Debian Adduser Developers <adduser@packages.debian.org>; Source for adduser is src:adduser (PTS, buildd, popcon).

Reported by: Anders Kaseorg <andersk@MIT.EDU>

Date: Wed, 9 Mar 2011 09:00:02 UTC

Severity: minor

Tags: patch

Found in version adduser/3.112+nmu2

Fixed in version adduser/3.113

Done: Stephen Gran <sgran@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Adduser Developers <adduser-devel@lists.alioth.debian.org>:
Bug#617480; Package adduser. (Wed, 09 Mar 2011 09:00:05 GMT) (full text, mbox, link).


Acknowledgement sent to Anders Kaseorg <andersk@MIT.EDU>:
New Bug report received and forwarded. Copy sent to Debian Adduser Developers <adduser-devel@lists.alioth.debian.org>. (Wed, 09 Mar 2011 09:00:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Anders Kaseorg <andersk@MIT.EDU>
To: submit@bugs.debian.org
Subject: ‘delgroup 0’ spews ‘Use of uninitialized value $gr_gid’
Date: Wed, 9 Mar 2011 03:56:27 -0500 (EST)
Package: adduser
Version: 3.112+nmu2
Severity: minor
Tags: patch

Believe it or not, I just had a legitimate reason to try this:

$ sudo addgroup --force-badname 0
Allowing use of questionable username.
Adding group `0' (GID 1002) ...
Done.
$ sudo delgroup 0
Use of uninitialized value $gr_gid in string eq at /usr/sbin/delgroup line 414.
Use of uninitialized value $gr_gid in string eq at /usr/sbin/delgroup line 414.
Use of uninitialized value $gr_gid in string eq at /usr/sbin/delgroup line 414.
…
Use of uninitialized value $gr_gid in string eq at /usr/sbin/delgroup line 414.
Use of uninitialized value $gr_gid in string eq at /usr/sbin/delgroup line 414.
Use of uninitialized value $gr_gid in string eq at /usr/sbin/delgroup line 414.
Removing group `0' ...
Done.

Here’s a patch:

--- adduser-3.112+nmu2/deluser
+++ adduser-3.112+nmu2/deluser
@@ -175,7 +175,7 @@
  
 my ($pw_uid, $pw_gid, $pw_homedir, $gr_gid, $maingroup);
 
-if($user) {
+if (defined($user)) {
     my @passwd = getpwnam($user);
     $pw_uid = $passwd[2];
     $pw_gid = $passwd[3];
@@ -183,7 +183,7 @@
     
     $maingroup = $pw_gid ? getgrgid($pw_gid) : "";
 }
-if($group) {
+if (defined($group)) {
     #($gr_name,$gr_passwd,$gr_gid,$gr_members) = getgrnam($group);
     my @group = getgrnam($group);
     $gr_gid = $group[2];




Added tag(s) pending. Request was from Stephen Gran <sgran@debian.org> to control@bugs.debian.org. (Mon, 13 Jun 2011 07:21:21 GMT) (full text, mbox, link).


Reply sent to Stephen Gran <sgran@debian.org>:
You have taken responsibility. (Mon, 13 Jun 2011 19:51:20 GMT) (full text, mbox, link).


Notification sent to Anders Kaseorg <andersk@MIT.EDU>:
Bug acknowledged by developer. (Mon, 13 Jun 2011 19:51:20 GMT) (full text, mbox, link).


Message #12 received at 617480-close@bugs.debian.org (full text, mbox, reply):

From: Stephen Gran <sgran@debian.org>
To: 617480-close@bugs.debian.org
Subject: Bug#617480: fixed in adduser 3.113
Date: Mon, 13 Jun 2011 19:47:09 +0000
Source: adduser
Source-Version: 3.113

We believe that the bug you reported is fixed in the latest version of
adduser, which is due to be installed in the Debian FTP archive:

adduser_3.113.dsc
  to main/a/adduser/adduser_3.113.dsc
adduser_3.113.tar.gz
  to main/a/adduser/adduser_3.113.tar.gz
adduser_3.113_all.deb
  to main/a/adduser/adduser_3.113_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 617480@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Stephen Gran <sgran@debian.org> (supplier of updated adduser package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 13 Jun 2011 08:15:58 +0100
Source: adduser
Binary: adduser
Architecture: source all
Version: 3.113
Distribution: unstable
Urgency: low
Maintainer: Debian Adduser Developers <adduser-devel@lists.alioth.debian.org>
Changed-By: Stephen Gran <sgran@debian.org>
Description: 
 adduser    - add and remove users and groups
Closes: 560313 561864 592629 609156 613009 617480 630340
Changes: 
 adduser (3.113) unstable; urgency=low
 .
   * Warning to STDERR (closes: #561864)
   * Use unlink on symlinks (closes: #609156)
   * Keep test from complaining (closes: #613009)
   * Use db_settitle instead of db_title (closes: #560313)
   * Add newline to deluser output (closes: #592629)
   * Don't go wrong if user or group is 0, although, please, stop that
     (closes: #617480)
   * Add afs to EXCLUDE_FSTYPES by default (closes: #630340)
Checksums-Sha1: 
 55fc7b68f6e4c961d0e9f3d1ed307d56903e44a8 1669 adduser_3.113.dsc
 e354a5e3d52b7acb5faa5579feaf2a947c254d58 302591 adduser_3.113.tar.gz
 567b8e42dc9b4777ab694f15ca71b7fa159749ef 217556 adduser_3.113_all.deb
Checksums-Sha256: 
 4ccb21dd7ffe3e30979a6181088941f77cf7164d9a49e5b9d0ed6bf3e9c6918d 1669 adduser_3.113.dsc
 fe5116fddfc7fe1de92d9078c08be763992be67142885ee8b7e5e0281f3983b1 302591 adduser_3.113.tar.gz
 3bfea7f2ffcb363e2cc2b701a6e6d2079f7554b4d76194a118916afd2400f5c4 217556 adduser_3.113_all.deb
Files: 
 2e895ef50285f5ef06b8d94723197adf 1669 admin important adduser_3.113.dsc
 c04dfeeccbb32101d5b11ca47255a418 302591 admin important adduser_3.113.tar.gz
 74c114db96f321f4d097b04ae305600a 217556 admin important adduser_3.113_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJN9mapAAoJELMRjO+K6o/uBuQP/2MjQQReBhlQvhQwATeQ9pch
fxzo7aQ9M2qJKHf98y3xkfYF+ddjMgrgiUnhkhMhpoyKZYqlD4gq9EBJfx9NGxD4
pzhawWhEZYjGn2Rm13bwovcDwUcZiYuOnDk3d6mKxfKUOQ8smFYrs1qGh/269E/6
y9BDeyicbk+Icb3j1qkJe8WOKwWAgssrnf0NHg35RGtCvKNey2/kuD+n1XvvRhYI
P0NhoLkYPIDP6hgQS4ybyXsMIAhTKHqpefduhbpINKvB0NwILTK6ohvqHDsm+k0r
kJCju9A9wFFTzakh8VyD5vsm9FOmTT63iVBQXoirtIVDyVlmmAo9EIIO+boLgK1J
pkJ6lg7+LwJf2vYVW+QSAPHEpnI6UQCTzWTjAaLPk0omRZ/uL12EnpJPoFNRZiMF
udEY2olwjAxsaUwOSYosVS80uxjFHleRyltHmtBtB1h/ouuYfb9q7B/4vHIHwsri
tPgmtVU9v6dbu+GVzHlenQhOpSO6itLGx2eZiU7k6yqJgaxAFC4Sj2QWDJepHGFR
DQev2m3lZz/zIMQiFxbisV/vRqYxbRta5CktmGmxAbl7CuBtUNjRIviOKznuqhtL
+94kRhlYqUfXlPTKuBzG0sG9nrrkqgT7BPDtSMT9wCTOpObazNU5zrYGD8Dued/E
YJCRQjYf58fhWTDSssSJ
=mDjV
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 22 Jul 2011 07:35:14 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jul 1 21:21:50 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.