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 FoHQLvIEdmDCgAAAgWs5BA (envelope-from ) for ; Tue, 13 Apr 2021 22:54:10 +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 2NyMJ/IEdmAKJgAAbx9fmQ (envelope-from ) for ; Tue, 13 Apr 2021 20:54:10 +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 192C31A1D2 for ; Tue, 13 Apr 2021 22:54:10 +0200 (CEST) Received: from localhost ([::1]:40034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWQ2z-0006jp-76 for larch@yhetil.org; Tue, 13 Apr 2021 16:54:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWQ2s-0006jf-8y for bug-guix@gnu.org; Tue, 13 Apr 2021 16:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWQ2s-0004Zf-0c for bug-guix@gnu.org; Tue, 13 Apr 2021 16:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWQ2r-0002vn-VX for bug-guix@gnu.org; Tue, 13 Apr 2021 16:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#36508: GDM files have incorrect owner after temporarily removing service Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 13 Apr 2021 20:54:01 +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: Brendan Tildesley , 36508@debbugs.gnu.org Received: via spool by 36508-submit@debbugs.gnu.org id=B36508.161834720411220 (code B ref 36508); Tue, 13 Apr 2021 20:54:01 +0000 Received: (at 36508) by debbugs.gnu.org; 13 Apr 2021 20:53:24 +0000 Received: from localhost ([127.0.0.1]:60958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWQ2F-0002uu-Ra for submit@debbugs.gnu.org; Tue, 13 Apr 2021 16:53:24 -0400 Received: from world.peace.net ([64.112.178.59]:35746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWQ2E-0002uh-US for 36508@debbugs.gnu.org; Tue, 13 Apr 2021 16:53:23 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWQ28-0007Iv-OO; Tue, 13 Apr 2021 16:53:16 -0400 From: Mark H Weaver In-Reply-To: <1576552162.14721.1618320275616@office.mailbox.org> References: <20190705083620.lbzu7a33awbymh3d@cf0> <1576552162.14721.1618320275616@office.mailbox.org> Date: Tue, 13 Apr 2021 16:51:35 -0400 Message-ID: <87czuxsya5.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain 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: , 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=1618347250; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=LHzIjczXlN6O2RrO2q7cqVxUoayZ4kTvHgJ9l8+UaiE=; b=RMUPb8JwUo0Vffuf2p1+rF3lRBNe32OtP0x+OxuAUo6mb3uTAJ7Dv2uMy7njz52Z1w7Q7v rgu3S/QfdFj/C1leHRQohOB98noxcFkM0pe/gtzcaRSp0FqGZtC95sXef1j8jAsVimZ5e3 Udc+yfTTxDIabA13SP7glgN0It7KUUQBb0Bs/csNWCla8YpYbHT/EtFm5o80gPCrEi79mE TLkU5jyI4KWVNjCfgba4AZkFg8V6hgu26gCWPrazi3mE+Bf0XEG3lzY2rClRE7x9053zG9 ni/zbBJo86zatmjsyuLTTPuBS82miVP9pBh2gQNXWdfSsGdtiuLyN4GDAJrtlw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618347250; a=rsa-sha256; cv=none; b=Qz7WSChNgAUfE1v6WQDpxL/st0F1De3n1e4gDL0heTHwDDdOiIsdWe2mN1aUkgX9atClof V6uJFA+hTvmGOlIg/yh1YUS8IwMU7zlvYA7u9Y2Jnicra2VuslV+jseWuV/xSQrirU80KK cFPprh4uwj4MyAoxPiw1G7DvF04uvSbkb7WC+C7+QygBVhal7SW9Fa6SCJlH2tSYrUtIHp Qyv61AD5uTBa/Up6eQUXrjyV4hWspOfQbXAm40J1pJ3dExZfZBgzYlil6r+fu6E/GVqYCK nzxpnF/42K54zQejCIUyA4iI4ctlsc47JplohsxhLbQJTTnjrxAftFuwhXWGzA== 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: -0.94 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 192C31A1D2 X-Spam-Score: -0.94 X-Migadu-Scanner: scn0.migadu.com X-TUID: EsIjURKz/igR Hi Brendan, Brendan Tildesley via Bug reports for GNU Guix writes: > I recently encountered what is likely the same bug. The directory /var/lib/gdm > had the correct permissions gdm:gdm, but all the files inside had something like > 973:gdm The underlying problem here, which I've also experienced, is that if you reconfigure your system with fewer users/groups, and then later add those users/groups back, there is no guarantee that they will be assigned the same UIDs and GIDs. This problem is made much worse by the fact that files may be left around, e.g. in /var, with the old UIDs and GIDs. In your case, I guess that the 'gdm' user was previously assigned UID 973, but now it has been given a different UID. In my case, after reconfiguring to a minimal system and later switching back to a full GNOME-based desktop system, I found that many files and directories in /var had the wrong owner or group. Here's what I saw before I cleaned things up: --8<---------------cut here---------------start------------->8--- root@jojen ~# ls -l /var/lib/ total 4 drwxr-xr-x 1 colord colord 40 Mar 28 2017 colord drwx------ 1 995 978 56 Sep 3 02:10 gdm drwx------ 1 root root 30400 Dec 25 01:55 NetworkManager -rw------- 1 root root 512 Dec 25 01:35 random-seed drwxr-xr-x 1 colord colord 164 Dec 28 2017 sddm drwx------ 1 tor tor 178 Dec 19 21:28 tor drwx------ 1 root root 20 Sep 5 01:32 udisks2 drwxr-xr-x 1 root root 274 Dec 25 01:55 upower drwxr-xr-x 1 root root 86 Mar 28 2017 wicd root@jojen ~# ls -la /var/lib/gdm/ total 4 drwx------ 1 995 978 56 Sep 3 02:10 . drwxr-xr-x 1 root root 750 Dec 25 01:59 .. drwxr-xr-x 1 994 colord 64 Sep 3 02:10 .cache drwx------ 1 994 colord 54 Sep 3 02:10 .config -rw------- 1 994 colord 16 Sep 3 02:10 .esd_auth drwxr-xr-x 1 994 colord 10 Sep 3 02:10 .local root@jojen ~# --8<---------------cut here---------------end--------------->8--- Given the fact that existing files and directories in /var can *effectively* have their ownership changed, I think that this issue could be a security risk. There's some discussion of this issue at , although I'm not sure that Danny's suggested solution is practical. 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 it would be sufficient to check certain directories such as /var, /etc, and possibly the top directory of /home. What do you think? Mark