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];



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to