From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 57562@debbugs.gnu.org
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 [thread overview]
Message-ID: <jwvpmgbvhn3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <838rmzn2rh.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 04 Sep 2022 08:10:26 +0300")
>> > 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
next prev parent reply other threads:[~2022-09-04 5:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-03 15:00 bug#57562: [PATCH] * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefully Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-03 15:14 ` Eli Zaretskii
2022-09-03 15:24 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-03 15:28 ` Eli Zaretskii
2022-09-03 15:41 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-03 15:59 ` Eli Zaretskii
2022-09-03 19:16 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-03 19:28 ` Eli Zaretskii
2022-09-04 2:02 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-04 5:10 ` Eli Zaretskii
2022-09-04 5:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-09-03 19:17 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-03 15:27 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-03 15:33 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvpmgbvhn3.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=57562@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.