From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#57562: [PATCH] * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefully Date: Sun, 04 Sep 2022 01:38:48 -0400 Message-ID: References: <83wnakmqw6.fsf@gnu.org> <83v8q4mq8k.fsf@gnu.org> <83r10smotk.fsf@gnu.org> <83czccmf57.fsf@gnu.org> <838rmzn2rh.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32174"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 57562@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 04 07:39:31 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUiLz-0008AC-8v for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Sep 2022 07:39:31 +0200 Original-Received: from localhost ([::1]:41446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUiLy-0003ME-99 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Sep 2022 01:39:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUiLW-0003KQ-Ls for bug-gnu-emacs@gnu.org; Sun, 04 Sep 2022 01:39:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUiLW-000665-Av for bug-gnu-emacs@gnu.org; Sun, 04 Sep 2022 01:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oUiLW-0007MC-5l for bug-gnu-emacs@gnu.org; Sun, 04 Sep 2022 01:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Sep 2022 05:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57562-submit@debbugs.gnu.org id=B57562.166226993828271 (code B ref 57562); Sun, 04 Sep 2022 05:39:02 +0000 Original-Received: (at 57562) by debbugs.gnu.org; 4 Sep 2022 05:38:58 +0000 Original-Received: from localhost ([127.0.0.1]:43297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUiLS-0007Lu-Bx for submit@debbugs.gnu.org; Sun, 04 Sep 2022 01:38:58 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUiLQ-0007Li-Rj for 57562@debbugs.gnu.org; Sun, 04 Sep 2022 01:38:57 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7B755440326; Sun, 4 Sep 2022 01:38:51 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 313B94402A8; Sun, 4 Sep 2022 01:38:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1662269930; bh=36Yo/6GjcYdHWEwo9kqaxQKod3eg8V+YY5MNTD20dsU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Lp4mUmsLz8nVj8sGxlp6/nTCMjGDpQvA/N7XhkR5/zPaoP1aUxiqy14Bz9dhM+FHI mN6qIJ+AriUIjcgdyREWVPdCnMz8JlSAMsTudi6C/JYnqCuFmFd+3Y7X+Cz/4Ui4Lc CqQi1nl8ThiGgC9icp8jPwfFq7jTthh532uT58eeuEZvESndnOZfqi8NR2Nb3VGR0J r2Vs+FRr7RFOYMGA36aBRCBD7kFQzBdwybAk1VHuYIEY/jnEGKO3KTF75lDpvwjIlP B29ZI5nbu40JjVgofzebi1EY4iz80NR/XxL5L1cexAlO0CLj99tN8nVgi+0RpG8AVv SU7KWGIrFrI9w== Original-Received: from pastel (unknown [157.52.9.190]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EF9B0120909; Sun, 4 Sep 2022 01:38:49 -0400 (EDT) In-Reply-To: <838rmzn2rh.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 04 Sep 2022 08:10:26 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:241466 Archived-At: >> > I didn't mean to say that I didn't understand how this could happen >> > _technically_. What I don't get is how come people let this happen, >> > and don't pay attention until Emacs complains? Isn't it crazy to have >> > your home directory unwritable by your user?? >> >> I think in the above scenario, if you just upgraded to Emacs-28 and it's >> hence the first time you run an Emacs with native compilation, you get >> a home directory that's still perfectly writable, including `~/.emacs.d` >> and it's only `~/.emacs.d/eln-cache` that's owned by root. > > Isn't the home directory created in a way that all its subdirectories > inherit the access rights by default? No, and the problem is ownership for which there's nothing equivalent the `setgid` bit on directories. Here's the scenario again: - User FOO has been using his home directory for a while under Debian, using Emacs-27. - /home/FOO/.emacs.d is owned by user A. - /home/FOO/.emacs.d/eln-cache does not exist. - User FOO does % su # apt upgrade ... this installs Emacs-28, yay! ... # emacs ...babla... - when Emacs is started, HOME=/root and USER=FOO - Since the new flashy Emacs-28 was built with native-compilation it tries to compile some files. - Decides to store the files in `~$USER/.emacs.d/eln-cache`, hence in /home/FOO/.emacs.d/eln-cache. - Hence it creates /home/FOO/.emacs.d/eln-cache, but we're running as root, so this dir will be owned by root :-( > Anyway, what you describe is a bug in the distro, and should ideally > be fixed there. We can point fingers, but the result is still the same. Personally, I think part of the problem is that we use ~$USER/ rather than $HOME (but other people consider it to be a feature rather than a bug). Other people will claim that the problem is the use of `su` rather than `su -`. I'm not sure we can really solve all those problems. Maybe we should try and refrain from creating dirs and files in `~/.emacs.d` when we don't have the same uid, but it seems difficult to do it in a way that doesn't introduce worse problems than it's solving. Stefan