From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#35996: User account password got locked when booting old generation Date: Sat, 01 Jun 2019 23:37:51 +0200 Message-ID: <87r28dc7gw.fsf@gnu.org> References: <20190529204517.mqn5xrw23xib4i3u@pelzflorian.localdomain> <877ea6l1on.fsf@gnu.org> <20190601055238.jkhefpupavz7aipi@pelzflorian.localdomain> <20190601145834.f4wgm4oqmdyej7n5@pelzflorian.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:40808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXBn5-0006gJ-4a for bug-guix@gnu.org; Sat, 01 Jun 2019 17:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXBiQ-0003yE-3N for bug-guix@gnu.org; Sat, 01 Jun 2019 17:39:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hXBiP-0003y9-Vv for bug-guix@gnu.org; Sat, 01 Jun 2019 17:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hXBiP-0006YJ-SL for bug-guix@gnu.org; Sat, 01 Jun 2019 17:39:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20190601145834.f4wgm4oqmdyej7n5@pelzflorian.localdomain> (pelzflorian@pelzflorian.de's message of "Sat, 1 Jun 2019 16:58:34 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: "pelzflorian (Florian Pelz)" Cc: 35996@debbugs.gnu.org Hi Florian, "pelzflorian (Florian Pelz)" skribis: > On Sat, Jun 01, 2019 at 07:52:38AM +0200, pelzflorian (Florian Pelz) wrot= e: >> I wonder what would change /etc/shadow. >>=20 > > If the error occurred on common non-Guix distros, it hopefully would > have been fixed before, maybe. Of course Guix recreates /etc/shadow > much more frequently. Definitely. > Guix appears to add shadow files atomically in gnu/build/accounts.scm. > I do not know if there could have been an error reading the old shadow > file, e.g. because it is locked or something? (gnu build accounts) doesn=E2=80=99t care at all about /etc/.pwd.lock, the = lock file used by libc=E2=80=99s =E2=80=98lckpwdf=E2=80=99 function. This is definitely not a problem when booting. It could be a problem if you=E2=80=99re concurrently running =E2=80=98guix system reconfigure=E2=80= =99 (which runs activation snippets, including the account updating code) and some other program, such as =E2=80=98passwd=E2=80=99, that assumes it holds an exclusi= ve lock on the file. Though in that case, the worst that could happen is that the changes made by Guix would be undoed by that other program. > The elogind source code in src/basic/user-util.c contains code for > locking /etc/shadow, with a comment that explains why its lckpwdf is > implemented differently from shadow-utils. > > AccountsService appears to only be usable for reading /etc/shadow, not > for writing it, contrary to what the Guix manual claims (??).=20 That might be a bug. > For writing passwords, gnome-control-center does not use > AccountsService, it calls /usr/bin/passwd directly in its source code > in panels/user-accounts/run-passwd.c. That=E2=80=99s definitely a bug to fix: it should invoke /run/setuid-programs/passwd instead. Thanks for investigating, Ludo=E2=80=99.