From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UEKHNsSceGC4UgEAgWs5BA (envelope-from ) for ; Thu, 15 Apr 2021 22:06:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2A06MMSceGBgPQAAbx9fmQ (envelope-from ) for ; Thu, 15 Apr 2021 20:06:28 +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 3016BA305 for ; Thu, 15 Apr 2021 22:06:28 +0200 (CEST) Received: from localhost ([::1]:50880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX8Fv-0000Ue-As for larch@yhetil.org; Thu, 15 Apr 2021 16:06:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lX8FX-0000Tm-1I for bug-guix@gnu.org; Thu, 15 Apr 2021 16:06:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lX8FW-0006ut-FY for bug-guix@gnu.org; Thu, 15 Apr 2021 16:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lX8FW-00072I-8H for bug-guix@gnu.org; Thu, 15 Apr 2021 16:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#36508: GDM files have incorrect owner after temporarily removing service Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 15 Apr 2021 20:06: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 Received: via spool by 36508-submit@debbugs.gnu.org id=B36508.161851714927025 (code B ref 36508); Thu, 15 Apr 2021 20:06:02 +0000 Received: (at 36508) by debbugs.gnu.org; 15 Apr 2021 20:05:49 +0000 Received: from localhost ([127.0.0.1]:39313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX8FI-00071p-KT for submit@debbugs.gnu.org; Thu, 15 Apr 2021 16:05:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX8FG-00071a-2R for 36508@debbugs.gnu.org; Thu, 15 Apr 2021 16:05:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43756) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lX8FA-0006fw-8H; Thu, 15 Apr 2021 16:05:40 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=38568 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lX8F8-0006Z9-Qx; Thu, 15 Apr 2021 16:05:39 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190705083620.lbzu7a33awbymh3d@cf0> <1576552162.14721.1618320275616@office.mailbox.org> <87czuxsya5.fsf@netris.org> <875z0pgnqn.fsf@gnu.org> <87lf9jiems.fsf@netris.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 Germinal an 229 de la =?UTF-8?Q?R=C3=A9volution?= 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: Thu, 15 Apr 2021 22:05:36 +0200 In-Reply-To: <87lf9jiems.fsf@netris.org> (Mark H. Weaver's message of "Thu, 15 Apr 2021 14:30:40 -0400") Message-ID: <878s5j8ga7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=1618517188; 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: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; bh=lR/G/a2ZyfTMl9LoxXIFLSqy2JOk45tyTPrka08mxxE=; b=h+fYCrxCUWagbt45gCSSZPiS+OpPxrpx4k0DDuIUW4KrIyWk5LesnEodyCaa7M44mb/gHZ BANx7uvzUfX87CMXJmrwCOIhULs5OCXQ/dvydzp9epavQ1i5iAjQKAHv9J8rTY2uXKkox+ +7RGjlrOaFhu/kT5nRPpMioiBd7WxXaDYAcimH6ltA1d/cvSCLtWVTAQQIg5Jji649kjp9 Ht0fym7vd2hTqmNiqZXfDW8HnsFYcXfMH+m84mPNc5Cw5sfZF+q1jzed1POU/6UNtEFFQB 9IrDuDMeg0WdnIVhsjaVpaya+j4Fb5RwsVtdNZK2hvcSAhjyRZfoKIUeBC1Y6A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618517188; a=rsa-sha256; cv=none; b=n8HLWGAqlGOg88E4wPD86mGjWIoSkCLjJO6yObRC/iAIkqT36NEdeEBdO6WYwMSmz4NbE4 PIJbMQAyuDPX3CuH0YOfVst7nxLMGsl82ETVI45lqIwNfqEzcmvIBK8zLQAYJwEaZRj8PQ DcD9N3d0G+g4h4DE+3trLqyOxsODluhkPFVFSbi3gYNP10afiIt/1yKl8p2Yhq0WIRLbth hhn1I/qUxgS9RoS7GiiImu4rtpbxP2gzbQE4osg8fiI3Y2DExzRlAoA9CeF4KCYMClQ3nf 7qVJIe8qQr0C5QBu4LeEzTvG2xigx8g8gO53II2QhiUW0iuX43/Y3Vpi9hv3zQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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: -2.94 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: 3016BA305 X-Spam-Score: -2.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: LFjrMeItzC1r Hi Mark, Mark H Weaver skribis: > Ludovic Court=C3=A8s writes: > >> Note that there are other places, in addition to GDM, where we >> forcefully reset the UID/GID of the home directory (e.g., for the >> =E2=80=98knot-resolver=E2=80=99 service.) >> >> My preferred solution to this would be to unconditionally chown -R home >> directories upon activation (for efficiency, it would be best if we >> could do that if and only if the home directory itself has wrong >> ownership). Thoughts? > > It might be okay to do this in specific cases like /var/lib/gdm, but I'm > very uncomfortable doing it for *all* users, because: > > (1) We shouldn't assume that all files within a home directory are > supposed to be owned by that user. > > (2) We shouldn't assume that all files owned by a user will be within > their home directory. > > (3) We shouldn't assume that all files within a home directory are > supposed to have the same 'group'. I, for one, have sometimes had > subdirectories of my home directory with a different 'group', to > either restrict or grant other users access to selected files or > directories. > > (4) Groups do not, in general, have home directories. > > (5) I consider it unsatifactory for there to be *any* window of time > during system activation when the ownership of files is incorrect. I agree this raises questions and we should take time to think through it. For system accounts though, I think 1=E2=80=934 do not apply. Perhaps a first step would be to do that for system accounts? >> Note that the ID allocation strategy in (gnu build accounts) ensures >> UIDs/GIDs aren=E2=80=99t reused right away (same strategy as implemented= by >> Shadow, etc.). So if you remove =E2=80=9Cbob=E2=80=9D, then add =E2=80= =9Calice=E2=80=9D, =E2=80=9Calice=E2=80=9D won=E2=80=99t >> be able to access the left-behind /home/bob because it has a different >> UID. To be clear, it=E2=80=99s doing the same as any other GNU/Linux distro. > This mechanism is insufficient, because it only avoids the problem if > you add "alice" at the same time that "bob" is removed. If you remove > "bob" during one system activation, and then later add "alice", then > "alice" might well be able to access bob's left-behind files. > > In the case that I personally witnessed on my Guix system, files within > /var/lib/gdm ended up with 'colord' as their group. That's not good. > > Increasingly, I'm leaning toward the idea that the complete mapping from > names to IDs should somehow be explicitly given as part of the OS > configuration, as I advocated in . > > What do you think? IDs as hash of the user names are interesting because that=E2=80=99d be stateless (conversely, the current ID allocation strategy is stateful: it arranges to not reuse recently-freed IDs.) But like you write, we=E2=80=99d need 32-bit UIDs. In libc, =E2=80=98uid_t= =E2=80=99 (specifically =E2=80=98__UID_T_TYPE=E2=80=99 in typesizes.h) is 32-bit, so = it might work rather well in user space. It still sounds like a change with significant implications though, and it=E2=80=99s hard to predict exactly how it would go or what would break. = For example, that does away with the system/non-system ranges, and wouldn=E2=80= =99t play well with =E2=80=9Cspecial=E2=80=9D IDs like 0 and 65535. To me, it=E2=80=99s a potential way out, but not a solution for the bug Bre= ndan reported today, nor a change we could implement in the coming weeks/months; the time scale is probably longer. WDYT? Thanks, Ludo=E2=80=99.