From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oAkAFX5qeWA7JQEAgWs5BA (envelope-from ) for ; Fri, 16 Apr 2021 12:44:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GGrnDn5qeWCQcQAAB5/wlQ (envelope-from ) for ; Fri, 16 Apr 2021 10:44:14 +0000 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 7BCB914F67 for ; Fri, 16 Apr 2021 12:44:13 +0200 (CEST) Received: from localhost ([::1]:42908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXLxL-0003Y5-A4 for larch@yhetil.org; Fri, 16 Apr 2021 06:44:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXLxC-0003Xy-Fw for bug-guix@gnu.org; Fri, 16 Apr 2021 06:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXLxC-0006cI-8X for bug-guix@gnu.org; Fri, 16 Apr 2021 06:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lXLxC-0001Lg-5U for bug-guix@gnu.org; Fri, 16 Apr 2021 06:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#36508: GDM files have incorrect owner after temporarily removing service Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 16 Apr 2021 10:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36508 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Mark H Weaver , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 36508-submit@debbugs.gnu.org id=B36508.16185697945116 (code B ref 36508); Fri, 16 Apr 2021 10:44:02 +0000 Received: (at 36508) by debbugs.gnu.org; 16 Apr 2021 10:43:14 +0000 Received: from localhost ([127.0.0.1]:40105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXLwQ-0001KR-5C for submit@debbugs.gnu.org; Fri, 16 Apr 2021 06:43:14 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:33434) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXLwM-0001KG-Ni for 36508@debbugs.gnu.org; Fri, 16 Apr 2021 06:43:12 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id tNj82400K0mfAB401Nj8Un; Fri, 16 Apr 2021 12:43:09 +0200 Message-ID: <38fd9bfdc71c689df1606a0b00d632e423c5defa.camel@telenet.be> From: Maxime Devos Date: Fri, 16 Apr 2021 12:42:53 +0200 In-Reply-To: <87eefbidcs.fsf@netris.org> References: <20190705083620.lbzu7a33awbymh3d@cf0> <1576552162.14721.1618320275616@office.mailbox.org> <87czuxsya5.fsf@netris.org> <875z0pgnqn.fsf@gnu.org> <87eefbidcs.fsf@netris.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-vI66qH0XHOizTwd9LNSk" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1618569789; bh=6fK+zfjLWh0vsbQPCEOwSVJVNlEj7zV+JoyaknT3oFU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ODBkCkzDv+orOTIP6prKoFg+po0S5xknwhiv2Sm66HF1UrE+6lCEvlHwjdLZeEWEa 8Hav+/J0O1WtL5+wjRESNwhnNbUy1/ofQWR07cBpwIHyuChXBCRSEltID+M4OCGb/2 LPas723h5PDHNTqrsZzTjfnhtslRCihz6J4QI9rdPGUmFFiUs/ByEEEfMpGaUlMb5m y8z+jVcNaCMxYoLxG0nxYrJUwb2QVVQCIU56qjoQvOnCO5YSvJuQDIEkS60gI4AP90 cepgikjhWukKQkbTwNI+sdw15oDBnpeZKPMaiZ4Ci/wZX/QV6urJeqBDkOOr9fHOZM mhwGWvj9QNGJg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Brendan Tildesley , 36508@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618569853; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=6fK+zfjLWh0vsbQPCEOwSVJVNlEj7zV+JoyaknT3oFU=; b=afIhOYxSpVohCP55fWS+LiVp3d+TNmcyVAVubQaliUS7nSSyv9wj0B0M+6r+5mDwO6wMp7 tbDVyAalH2eW6RuQOCkNhxD3rPi6/5QLWuFz1fx5U94nC8sVmxkj7z0T01dtToH/1f3lnT PmWwO8oFgSgb/nc/mN/xoz9APtjuutoxRsGYdEu+lRj1PKTokwKKHHE2WpXDI3tQ85N+Cq c+vJkSj0j5mFqaYgdBIj9LNT2eBCwgkMWuD9zfdASpN5WlFfdcNWndcJWsJM6sJiECdvJ6 85je+eye5k69GNmlh5jlw3YFVO+vQ2XTluZ1JQj8dKtl4nx2liIOfczd8UNEEw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618569853; a=rsa-sha256; cv=none; b=UtlP1UtDIyWDZvt6SV+o9FCWtXOJZG3aZG/oESZqFVJp4SyQfsGZRdG+MRmkLd9FZaeqTq xV1gNVDyphdYe+q10Tp2P8ru49lIJMYRY/0eW1uvOi7rNsaRvXFnN34V9NzjdSKQ7SP9hs 8rabARJzyIm4fObUmi7I+gCTkb/pQydyWsPrK8mt0FTTLi0g8G1r8boClhpunR1hhr+qbZ rgbIwt09HxEhMbYlR+z3p70zl0SGDxPn+WuRvdfn92Cg6g4Diij0ypk14eotohlYoh2/Mr Xyy0305X48jtAfzfMMjRxWfKOWp674loMajnxDLqtZRpshMAcEBbXRgPMurALA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=ODBkCkzD; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=ODBkCkzD; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 7BCB914F67 X-Spam-Score: -3.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: qJynBTHRP/U2 --=-vI66qH0XHOizTwd9LNSk Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2021-04-15 at 14:58 -0400, Mark H Weaver wrote: > Ludovic Court=C3=A8s writes: >=20 > > Mark H Weaver skribis: > >=20 > > > Here's one idea: when activating a system, *never* delete users or > > > groups if files still exist that are owned by those users/groups. > > > Checking all filesystems would likely be too expensive, but perhaps i= t > > > would be sufficient to check certain directories such as /var, /etc, = and > > > possibly the top directory of /home. And /tmp, /media and /run/user. > >=20 > > How would you determine which directories to look at though? What if w= e > > miss an important one? >=20 > I have another idea: >=20 > Maintain historical mappings from user/group names to UIDs/GIDs, perhaps > in some file in /etc, where entries are added but *never* automatically > removed. When allocating UIDs/GIDs, we would avoid any UIDs/GIDs in the > range of those mappings. This seems rather convoluted to me. Why not reuse /etc/passwd and /etc/gro= ups? My suggestion: 1. *never* automatically delete users/groups from /etc/passwd, /etc/groups (I thought that was how Guix already worked ...) 2. as users and groups appearing in /etc/passwd and /etc/groups, but not in the operating system configuration can be confusing, change the comme= nt string of these users and groups, to something like "account removed" Add a group 'user-graveyard' for (3), and move these 'pseudo-removed' us= ers to the 'user-graveyard' group. 3. Don't forget to remove graveyard users from all groups (except user-grav= eyard), make sure the graveyard users can't log in anymore ... (Perhaps add a ru= le to the SSH and PAM configuration that forbids logging in to graveyard accou= nts, by checking whether the user is in the 'user-graveyard' group?) > Then, provide a UID/GID garbage collector, to be explicitly run by users > if desired, which would scan all filesystems to find the set of UID/GIDs > currently referenced, and remove entries from the historical mappings > that are no longer needed. That seems useful for if /etc/passwd and /etc/group is getting full, or jus= t for cleaning up. You may want to exclude /gnu/store though, for efficiency (-:= . And just in case check whether any live processes have the UID/GID. Suggested command name: "guix user-gc". Greetings, Maxime. --=-vI66qH0XHOizTwd9LNSk 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+4iGRcl7gUCYHlqLRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iLeAQCDp8ywXTcQrPOsnQ427HUGcXmo W23thxgqzXqSPwy5ZAD9EoGaIgOLrMymibzhCeJ/alf6nGRxQjonoxZ9cyuq5A0= =Ht7l -----END PGP SIGNATURE----- --=-vI66qH0XHOizTwd9LNSk--