Your message dated Wed, 17 Aug 2022 11:34:20 +0000
with message-id <[email protected]>
and subject line Bug#1000796: fixed in base-passwd 3.6.0
has caused the Debian Bug report #1000796,
regarding update-passwd only remove item one time
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1000796: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000796
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: base-passwd
Version: 3.5.51
Severity: critical

update-passwd only removes once and exits even more
than one items need to be removed. Root cause is walk
is set to walk->next after remove_node(), in which the
walk has been cleaned, so the while(walk) is terminated.

$update-passwd --verbose
Adding group "postgres" (120)
Adding group "nova" (162)
Adding group "barbican" (978)
Adding group "keystone" (42424)
Adding group "neutron" (164)
Adding group "ceilometer" (166)
Adding group "sysinv" (168)
Adding group "snmpd" (169)
Adding group "fm" (195)
Adding group "libvirt" (991)
Adding group "ironic" (1874)
Adding group "www" (1877)
Removing group "daemon" (1)
Adding user "postgres" (120)
Adding user "neutron" (164)
Adding user "sysinv" (168)
Adding user "snmpd" (169)
Adding user "fm" (195)
Adding user "barbican" (982)
Adding user "ceilometer" (991)
Adding user "keystone" (42424)
Adding user "nova" (994)
Adding user "ironic" (1874)
Adding user "www" (1877)
Removing user "daemon" (1)
25 changes have been made, rewriting files
Writing passwd-file to /etc/passwd
Writing shadow-file to /etc/shadow
Writing group-file to /etc/group

Adding user works well, but removing user just run one time. I attached a fix, 
with which, it works as

$sudo update-passwd --verbose
Adding group "postgres" (120)
Adding group "nova" (162)
Adding group "barbican" (978)
Adding group "keystone" (42424)
Adding group "neutron" (164)
Adding group "ceilometer" (166)
Adding group "sysinv" (168)
Adding group "snmpd" (169)
Adding group "fm" (195)
Adding group "libvirt" (991)
Adding group "ironic" (1874)
Adding group "www" (1877)
Removing group "daemon" (1)
Removing group "bin" (2)
Removing group "lp" (7)
Removing group "man" (12)
Removing group "audio" (29)
Removing group "video" (44)
Removing group "games" (60)
Adding user "postgres" (120)
Adding user "neutron" (164)
Adding user "sysinv" (168)
Adding user "snmpd" (169)
Adding user "fm" (195)
Adding user "barbican" (982)
Adding user "ceilometer" (991)
Adding user "keystone" (42424)
Adding user "nova" (994)
Adding user "ironic" (1874)
Adding user "www" (1877)
Removing user "daemon" (1)
Removing user "bin" (2)
Removing user "games" (5)
Removing user "lp" (7)
Removing user "mail" (8)
35 changes have been made, rewriting files
Writing passwd-file to /etc/passwd
Writing shadow-file to /etc/shadow
Writing group-file to /etc/group

Thanks,
ytao

>From a2a96fa28fe132e34185ab1646b1f1ea4baf4942 Mon Sep 17 00:00:00 2001
From: Yue Tao <[email protected]>
Date: Thu, 25 Nov 2021 10:14:45 +0800
Subject: [PATCH] update-passwd.c: set walk to walk->next before removing

update-passwd only removes once and exits even more
than one items need to be removed. Root cause is walk
is set to walk->next after remove_node(), in which the
walk has been cleaned, so the while(walk) is terminated.

Without the fix, the output of update-passwd
$update-passwd --verbose
Adding group "postgres" (120)
Adding group "nova" (162)
Adding group "barbican" (978)
Adding group "keystone" (42424)
Adding group "neutron" (164)
Adding group "ceilometer" (166)
Adding group "sysinv" (168)
Adding group "snmpd" (169)
Adding group "fm" (195)
Adding group "libvirt" (991)
Adding group "ironic" (1874)
Adding group "www" (1877)
Removing group "daemon" (1)
Adding user "postgres" (120)
Adding user "neutron" (164)
Adding user "sysinv" (168)
Adding user "snmpd" (169)
Adding user "fm" (195)
Adding user "barbican" (982)
Adding user "ceilometer" (991)
Adding user "keystone" (42424)
Adding user "nova" (994)
Adding user "ironic" (1874)
Adding user "www" (1877)
Removing user "daemon" (1)
25 changes have been made, rewriting files
Writing passwd-file to /etc/passwd
Writing shadow-file to /etc/shadow
Writing group-file to /etc/group

With the fix:

$sudo update-passwd --verbose
Adding group "postgres" (120)
Adding group "nova" (162)
Adding group "barbican" (978)
Adding group "keystone" (42424)
Adding group "neutron" (164)
Adding group "ceilometer" (166)
Adding group "sysinv" (168)
Adding group "snmpd" (169)
Adding group "fm" (195)
Adding group "libvirt" (991)
Adding group "ironic" (1874)
Adding group "www" (1877)
Removing group "daemon" (1)
Removing group "bin" (2)
Removing group "lp" (7)
Removing group "man" (12)
Removing group "audio" (29)
Removing group "video" (44)
Removing group "games" (60)
Adding user "postgres" (120)
Adding user "neutron" (164)
Adding user "sysinv" (168)
Adding user "snmpd" (169)
Adding user "fm" (195)
Adding user "barbican" (982)
Adding user "ceilometer" (991)
Adding user "keystone" (42424)
Adding user "nova" (994)
Adding user "ironic" (1874)
Adding user "www" (1877)
Removing user "daemon" (1)
Removing user "bin" (2)
Removing user "games" (5)
Removing user "lp" (7)
Removing user "mail" (8)
35 changes have been made, rewriting files
Writing passwd-file to /etc/passwd
Writing shadow-file to /etc/shadow
Writing group-file to /etc/group

Signed-off-by: Yue Tao <[email protected]>
---
 update-passwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/update-passwd.c b/update-passwd.c
index 3f3dffa..1a56ed9 100644
--- a/update-passwd.c
+++ b/update-passwd.c
@@ -806,13 +806,13 @@ void process_old_entries(const struct _info* lst, struct _node** passwd, struct
 		free(id);
 	    }
 
+	    walk=walk->next;
 	    if (make_change) {
 		if (opt_verbose)
 		    printf("Removing %s \"%s\" (%u)\n", descr, oldnode->name, oldnode->id);
 		remove_node(passwd, oldnode);
 		flag_dirty++;
 	    }
-	    walk=walk->next;
 	    continue;
 	}
 	walk=walk->next;
-- 
2.25.1


--- End Message ---
--- Begin Message ---
Source: base-passwd
Source-Version: 3.6.0
Done: Colin Watson <[email protected]>

We believe that the bug you reported is fixed in the latest version of
base-passwd, which is due to be installed in the Debian FTP archive.

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 [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Colin Watson <[email protected]> (supplier of updated base-passwd 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 [email protected])


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

Format: 1.8
Date: Wed, 17 Aug 2022 12:14:12 +0100
Source: base-passwd
Built-For-Profiles: noudeb
Architecture: source
Version: 3.6.0
Distribution: unstable
Urgency: medium
Maintainer: Colin Watson <[email protected]>
Changed-By: Colin Watson <[email protected]>
Closes: 897264 929133 982906 995724 1000796
Changes:
 base-passwd (3.6.0) unstable; urgency=medium
 .
   [ Colin Watson ]
   * update-passwd(8) translations:
     - German (thanks, Helge Kreutzmann; closes: #995724).
   * Upgrade to debhelper v13.
   * Simplify some debhelper overrides slightly.
   * users-and-groups:
     - Update copyright years.
     - Rename ssh group to _ssh, matching openssh 1:8.4p1-6.
     - Document libvirt group (thanks, Guido Günther; closes: #929133).
   * Stop creating the gnats user and group on new installations (closes:
     #897264).  It will not be automatically removed from existing
     installations.
 .
   [ Yue Tao ]
   * update-passwd.c: set walk to walk->next before removing (closes:
     #1000796).
 .
   [ Debian Janitor ]
   * Remove constraints unnecessary since buster:
     + Build-Depends: Drop versioned constraint on dpkg and dpkg-dev.
 .
   [ Jonathan Hettwer ]
   * implement SELinux awareness (closes: #982906)
 .
   [ Peter Kjellerstedt ]
   * Make it possible to build without debconf support or documentation
     generation.
Checksums-Sha1:
 cefac62dd8f85bfa65e24b98cf0e97c3aa64178e 1740 base-passwd_3.6.0.dsc
 fa3f89f47ddcc49eb03e0f6944ad965a4231c44e 55648 base-passwd_3.6.0.tar.xz
Checksums-Sha256:
 5148d442ff8e095975872459dad47d293f5054b49df02264e29b0577ac7bcc41 1740 
base-passwd_3.6.0.dsc
 3ce778ed92e3f89319d519bc1e79830e359cc2c63ff2105136f7279bb68af244 55648 
base-passwd_3.6.0.tar.xz
Files:
 34074ac6b6badfd991fffe539d650526 1740 admin required base-passwd_3.6.0.dsc
 9d0a523210e3f241b3f32e5ac16cbab4 55648 admin required base-passwd_3.6.0.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmL8zeEACgkQOTWH2X2G
UAsGTw/+PqSRJTHfT+4N9uQFWPNx0BcPP1rUxwk7tltRr/Lbb3xIw+FXa/ZZwzjs
hH7P3lF6wV82QZFbvtteqJHMw04ZStd7k45YSvo608w8ptBetV1edSUnm9m8ls+s
zzXsvTKFWpWpob5anKY71+Yh85CgFtFRmvWeLHAiaMeAIQUP+XUg78qjaBh6sShi
7dFBTXDa8OXWAihGJ8hD24df5ELKbT4dUxkG1m1wdnqzaGnCb2rz21nlajY24KmU
vMt8wJqrd9fr0icF2YzbAbDWgIDRV1u3k0hXuasDC6REU7u8/Gi5QqUSsHnkDxWi
KNhf601qpIuyGnZZj/T9hb3Y15VQ/E288XDxl/0/+1VyKzI+sDvFb56tt56pkG7M
F7BX12VhfCixGH9GhdvntwLGWCNNsD1q+Gx7pzDXeQjCWktDm5lrKi1MUzyXEPms
VWx2jZ+tQ44H1b5oITrLpQepvJkmkbLPpX13HszOPhgX9Kp5ZLjI8zLR1bTwcubC
gvGwhTeLD1U0GxlU99BUfhHk6ugWrfEzminfTlGW2Ok1urz4OWaVEmM2MyiRvoRB
VFL5E64k0uxib6LYpUqq0c6+runhGPLELYjMDMjOUZkMNfwIXZDTw6eNm9OyyrgI
HqJTz8iqTj5qkac+Ymy+Q5qlBZPDVdTySkGiz6XefzmlcrLVbD8=
=4Gta
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to