From: Eli Zaretskii <eliz@gnu.org>
To: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Cc: 66546@debbugs.gnu.org
Subject: bug#66546: 30.0.50; save-buffer to write-protected file without backup fails
Date: Thu, 19 Oct 2023 07:40:21 +0300 [thread overview]
Message-ID: <83y1fzmdhm.fsf@gnu.org> (raw)
In-Reply-To: <87sf671xe3.fsf@sappc2.fritz.box> (message from Jens Schmidt on Wed, 18 Oct 2023 22:36:04 +0200)
> From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
> Cc: 66546@debbugs.gnu.org
> Date: Wed, 18 Oct 2023 22:36:04 +0200
>
> Why exactly do we need that
>
> (set-file-extended-attributes
> buffer-file-name
> (file-extended-attributes buffer-file-name))
>
> incantation or the equivalent one
>
> (setq setmodes
> (list (file-modes buffer-file-name)
> (with-demoted-errors
> "Error getting extended attributes: %s"
> (file-extended-attributes buffer-file-name))
> buffer-file-name))
> (with-demoted-errors "Error setting attributes: %s"
> (set-file-extended-attributes buffer-file-name
> (nth 1 setmodes)))
>
> in function `basic-save-buffer-2'?
Because it was added there long ago, and because we have no reason to
believe it does any harm.
> In addition, I tried to trace back (this time hopefully correctly) the
> origin of this call to `set-file-extended-attributes' and reached this
> commit:
>
> 574c05e21947 Karel Klíc - Add SELinux support.
>
> Karel added as comment on this function:
>
> (basic-save-buffer-2): Set SELinux context of the newly created file,
> and return it.
>
> But we do not have a "newly created file" here, and, in my opinion, do
> not need to set an SELinux context/extended attributes on it.
When working with Emacs, we usually respect old code unless we have a
clear-cut case where it is wrong. Here, we don't. Me, I don't even
know enough about SELinux to discuss this intelligently. So let's
leave the code as it is, until we have a good reason to change it.
(And if and when we do decide to change it, we will need a good
understanding of what this will do to the several ACL frameworks we
currently support, before we know how to change it without introducing
subtle issues.)
next prev parent reply other threads:[~2023-10-19 4:40 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-14 19:09 bug#66546: 30.0.50; save-buffer to write-protected file without backup fails Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-14 19:32 ` Eli Zaretskii
2023-10-14 20:31 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-15 5:33 ` Eli Zaretskii
2023-10-15 9:34 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-15 9:54 ` Eli Zaretskii
2023-10-15 11:39 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-15 12:12 ` Eli Zaretskii
2023-10-15 18:59 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-16 11:19 ` Eli Zaretskii
2023-10-16 20:04 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-17 10:48 ` Eli Zaretskii
2023-10-17 20:12 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-18 11:32 ` Eli Zaretskii
2023-10-18 20:36 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-19 4:40 ` Eli Zaretskii [this message]
2023-10-19 21:12 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-20 6:06 ` Eli Zaretskii
2023-10-21 17:56 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-21 19:02 ` Eli Zaretskii
2023-10-21 20:17 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-22 4:57 ` Eli Zaretskii
2023-10-22 9:45 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 12:58 ` Eli Zaretskii
2023-10-29 14:23 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-29 14:39 ` Eli Zaretskii
2023-11-01 19:06 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-02 6:47 ` Eli Zaretskii
2023-11-03 21:02 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04 8:58 ` Eli Zaretskii
2023-11-04 12:30 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04 12:59 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83y1fzmdhm.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=66546@debbugs.gnu.org \
--cc=jschmidt4gnu@vodafonemail.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).