From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yMO/LD+Wl2JE7gAAbAwnHQ (envelope-from ) for ; Wed, 01 Jun 2022 18:39:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oEikLD+Wl2LMLwEAauVa8A (envelope-from ) for ; Wed, 01 Jun 2022 18:39:27 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5EEE23E423 for ; Wed, 1 Jun 2022 18:39:27 +0200 (CEST) Received: from localhost ([::1]:50024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwRNV-0007bV-RK for larch@yhetil.org; Wed, 01 Jun 2022 12:39:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwRMx-0007Yr-Gn for guix-devel@gnu.org; Wed, 01 Jun 2022 12:38:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwRMv-0000Fd-6U; Wed, 01 Jun 2022 12:38:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=29utbpenBZBPloCBLLOiTmt7ux+9gGGu6IXhKt3DGiQ=; b=R4VQVk48lnORRwc6i5h+ HVVneT3/b/XIoS6zwGk1LpnghHdCwpOaTCvqfyXR/zLsUnfbrHC+XVVUbDz9x20aqgizZpPSJ/ufP vPlwWJvlHrM1tBnBhm7Ka6WeCx4ToUFhcmPhjz5UQKsNEoeQOXuuvnPs6XtPwM1najtgTnLux3H// ss1YYeRDL+dhzssnP3Vi3AHWv9PUBcRRR3oYXJC3ioYzU4RrFSfGbrsDPA1KZ4RIxGmAaiEKl2v+p THF1s/b0F3T6WhVPZqpZ8hGgeiQh7K4+8HYqrY/UmCVKvAmdH94HM/LODF2zFjzB+EVpkLZOuw06X rZ2pFWVw563VSw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=47642 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwRMu-0001S7-QS; Wed, 01 Jun 2022 12:38:49 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxime Devos Cc: Felix Lechner , Guix Devel Subject: Re: A corner case of broken reproducibility References: <87leuj108h.fsf@gnu.org> <31d13a6014b14c886686bca833d926604ce3379d.camel@telenet.be> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Tridi 13 Prairial an 230 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour du Pois X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 01 Jun 2022 18:38:46 +0200 In-Reply-To: <31d13a6014b14c886686bca833d926604ce3379d.camel@telenet.be> (Maxime Devos's message of "Mon, 30 May 2022 22:50:10 +0200") Message-ID: <87bkvcuynd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654101567; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=29utbpenBZBPloCBLLOiTmt7ux+9gGGu6IXhKt3DGiQ=; b=F1H4sdgkJ8Q5Q1MzNXHUglln+qH2v2SsHgL85MDhNLu5D3PbT/C+UsqlAh9dg+YEjhgnO8 KmwnzZlgamxXhVKJCJ7Sw+izodTZZi4jfPqUO6DAO8VUAMsdYKaYqhlMLjGf/HprkJaT0Q /wkUvFZmdRbqSz9BhZQEuiE++vFnw1lRsY1MNAlVqIxh1nna+2QmcxIbt508pDuxCkzfrN Wgoub4Sa/B4svGtDpAET83RYi21GvRGWA0UEkIGhUN/AsiD1M1rQ3d3inmh/BJKOstWi/n YyfBQSzOAOHKK+dTvO411DGPYq6IAp7nfJ7f1COB6GuMgK0yvlvNKtA5FYz2og== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654101567; a=rsa-sha256; cv=none; b=I4t5eX3v9VzWdOAPj4jMk614xyuzFX9FjIFR1Eisz7vX3n7SSTaYOulshJSPf6Y9EYyWzh PxvOXMWw5beMUOunOuZqSrmKZWTGRooHDsyktQUluL6genSpOuDeWWmhmdyJn9MZCNinIB UiGpi3QlFkfOJ3mEEGGiSBJf+miuAtAKJ5fK5vkr5EBVLRcrjI7MEM2gbTHQpvVh1obh7L uoGEVr49k0jZslxQJvgr+MK+7XBs6p1+Bb4SJBhSj0lHf0B42D6kzBEAxqc8Wl+xF7HjBi oUryaaqcM3OhxowsDiRuP7BWSPlSWUM0R7JEVs7MIlCUCJBDpwFI7jzDgp1diw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=R4VQVk48; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.73 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=R4VQVk48; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5EEE23E423 X-Spam-Score: -7.73 X-Migadu-Scanner: scn0.migadu.com X-TUID: j3tIYUftfKFR Maxime Devos skribis: > I don't think the problem is that the uid of /home/... was wrong, > rather I think the problem is that Guix has forgotten the uid and hence > invents a new one to put in /etc/passwd instead of keeping the old one. > > A pitfall (noticed in the context of system accounts): the user could > have created files outside /home (e.g. in /tmp). IIUC, this would also > require a reboot to keep name<->uid consistent after "guix system > reconfigure". > > A 'chown -R' doesn't seem great to me from a security perspective > (seems very easy to get something wrong, and the TOCTTOU-free chownat > hasn't been merged yet in Guile), a performance perspective (what if > you have a huge $HOME). Also extra io -> slower boot + disk wear. > It also destroys some information, it's possible to intentionally have > files owned by other users inside $HOME. There=E2=80=99s a talk by Lennart Poettering where he explains that, contra= ry to what one might think, =E2=80=9Cchown -R $HOME=E2=80=9D turns out to be fast= enough that systemd-homed can do that unconditionally (off the of my head). > Things that seem missing here to me: > > * a mechanism for remembering that an uid is still in use even though > the user has been removed (previously mentioned solutions: keep the > uid in /etc/passwd even though it is =E2=80=98removed=E2=80=99, or ke= ep a separate > /etc/passwd-graveyard or such, etc.). For system accounts and user > accounts. Won't help in this particular case but would make more > general adding/removing user accounts less fragile (avoid=C2=A0 > accidental reuse). How do you know that user =E2=80=9Cmaxime=E2=80=9D created today is =E2=80= =9Cthe same=E2=80=9D as that =E2=80=9Cmaxime=E2=80=9D deleted a while back? You can=E2=80=99t. (gnu build accounts) is stateful in that it makes sure UIDs aren=E2=80=99t reused. (This is roughly the same algorithm as used by Shadow.) > * a mechanism for telling Guix =E2=80=98I'm renaming the user account, = not > creating and removing a new one, so keep the uid=E2=80=99 Every system generation stands alone though; it=E2=80=99s functional, state= less, and all that. What does =E2=80=9Crename=E2=80=9D mean in this context? > * some heuristics for detecting mistakes (e.g.: if Guix thinks it > should create a directory /home/foo for uid 1234, but it notices > there is already a directory /home/bar with that uid 1234, then > that's super suspicious. Likewise, if Guix thinks the home > /home/foo should be owned by uid 1234, but it notices it's already > owned by 1235!=3D1234, that's also suspicious). Yeah. > * some mechanism for resolving mistakes=20 Sure. Ludo=E2=80=99.