From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 8J1eGCQulWLuIgAAbAwnHQ (envelope-from ) for ; Mon, 30 May 2022 22:50:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UKdFGCQulWJ3UgAA9RJhRA (envelope-from ) for ; Mon, 30 May 2022 22:50:44 +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 1B0DD353FC for ; Mon, 30 May 2022 22:50:43 +0200 (CEST) Received: from localhost ([::1]:37434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvmLa-0000Uu-2v for larch@yhetil.org; Mon, 30 May 2022 16:50:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvmLF-0000Tk-GX for guix-devel@gnu.org; Mon, 30 May 2022 16:50:21 -0400 Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]:59372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvmLD-00022p-FL for guix-devel@gnu.org; Mon, 30 May 2022 16:50:21 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id d8qE270014UW6Th018qEWk; Mon, 30 May 2022 22:50:14 +0200 Message-ID: <31d13a6014b14c886686bca833d926604ce3379d.camel@telenet.be> Subject: Re: A corner case of broken reproducibility From: Maxime Devos To: Ludovic =?ISO-8859-1?Q?Court=E8s?= , Felix Lechner Cc: Guix Devel Date: Mon, 30 May 2022 22:50:10 +0200 In-Reply-To: <87leuj108h.fsf@gnu.org> References: <87leuj108h.fsf@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-PoRH2Ot7U4SZmrVyqExm" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1653943814; bh=3shJol7W4wPHVrDXUVhIoypat/abrKyobLkn9Rj8Zok=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GVX3cTTgizL4pgbC0p2eztMuiTkdZUWx78KRxkvQrNLI4QzinU5/5adbw2+fDIu18 U+1dtsst+iHhAaftpIMjRfdIfIO/bjczbVYCZ+DJkirXYY8XEfXfwFakglpSHYB7hl QyWyARW+MD/bNrGKgyNOZcXca90kz1EMBoHkaL5YQbAs/M5qTIogWDiea5XTMqUpZj MAMaO99wuwnNKxFGDV2UI6+k7XbvapP73J3pgCpMMmgy06ddn3mnFH9vNvJejqhhwK bdgpn7Cvv33YI4dCaEMwk6kOl0YJwZfHbscgQOZoHNdLvjxQu97teU6H4T2bm6/FYi QeDiJlqiKSi5w== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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=1653943844; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=3shJol7W4wPHVrDXUVhIoypat/abrKyobLkn9Rj8Zok=; b=UdrlBAODMN6LmuphtgkF3s5ix7NQTfJ4r9nYOZRxzs+/RCiiQPgQZsOszWB6lY7AKycwtr +TQINmdhD7IofF89JTOgiPm1ZA8N/2KjdYiwBbl3021W99HE3ImvJCQ029eKukTOQ2Kzbm uzeWtXZwzCUpe63pEDymYityrPT2URwjQV4dza57+EhKVg95s1QAZnE6skC9JBIZk2MNzM 1kgSY1fRw4V1azdxZ05bh4tVEfZ8Mra/zpg2Ba2SIvO9YwhHZmsgNIQR205Y3atfLlZ1Uc QH+uWD3x7bfa24yDkwS+VfXI7HNfSDQgrem24TMwO56Ido6RZlOD3XvLo4Gonw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653943844; a=rsa-sha256; cv=none; b=uIATUxUqV0r6nB2nxi03fUB1+wS9AbIPUbZuJvdKB8fMzi1SliK/x8sgvu3MDoglmCMg2K Lwpx6jXfsSs3Lhwj8zAryKh42FlhTu8uJtcjSfJgivJ1d0QU2bCJSkah9tqhz0Iv+OVPXX QZZvFmr347AlmrBD3FKCYfrQRxvGeXaYCWk+2aSJFcEaCTAuehg0RBNYKJa/xQq2o2KG+N gB4KYz8uaVqMChCnYAl1IIZPcJ3tsG5Z8UE+wfbQgA++exevo+KXGENapI1JB3wYApY/ma Bz/3Iva/U8qI6CoIGuzxLJ+tFSvaA5ic1Jy+sRnqOV19yrwo/MxGH4Fv+y+29Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=GVX3cTTg; dmarc=pass (policy=none) header.from=telenet.be; 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: -11.73 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=telenet.be header.s=r22 header.b=GVX3cTTg; dmarc=pass (policy=none) header.from=telenet.be; 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: 1B0DD353FC X-Spam-Score: -11.73 X-Migadu-Scanner: scn0.migadu.com X-TUID: HYxEj1p4obyR --=-PoRH2Ot7U4SZmrVyqExm Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op ma 30-05-2022 om 17:58 [+0200]: > Perhaps it should forcefully =E2=80=9Cchown -R=E2=80=9D home directories = at boot time, > so they have the right UID?=C2=A0 This has been discussed a few times, I haven't seen the "chown -R" suggestion yet in the context of homes (only for system accounts, and at activation time, not only boot time). > especially in the context of system accounts; systemd-homed appears to > be doing exactly that. 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. 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 keep= 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). * a mechanism for telling Guix =E2=80=98I'm renaming the user account, no= t creating and removing a new one, so keep the uid=E2=80=99 * 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). IIUC, Blake Shaw only changed their user name, not the home directory, so this would have detected the problem * some mechanism for resolving mistakes=20 Or maybe something else entirely, whatever works without causing new problems I guess. Greetings, Maxime. --=-PoRH2Ot7U4SZmrVyqExm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYpUuAhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iaUAQDU7LAlpzByFVJTULatL9POZPm/ X49EgI/uxWlyvKU9GQD/YzfUm7cuVCoW0Ru8xMQlQnUkJS0zqBYaFueYE/v/1QQ= =QR1v -----END PGP SIGNATURE----- --=-PoRH2Ot7U4SZmrVyqExm--