[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#43723: 27.1; Errors in file-extended-attributes prevent from saving
From: |
Eli Zaretskii |
Subject: |
bug#43723: 27.1; Errors in file-extended-attributes prevent from saving buffer |
Date: |
Tue, 07 Jun 2022 14:35:17 +0300 |
> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 43723@debbugs.gnu.org
> Date: Tue, 07 Jun 2022 11:26:17 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > You can easily simulate this situation by writing a replacement for
> > file-acl that always signals a file-error, or advising it to that
> > effect.
>
> It's always better to have an actual test case so that we're not fixing
> the wrong thing...
Yes, but all of my actual examples were fixed "by other means". So
only the theoretical issue is left.
> But in this case, I guess it's `set-file-extended-attributes' that
> should be signalling an error if we want to emulate the problem?
> `file-acl' would presumably just return nil in these cases, so there'd
> be no warnings or errors?
No, the problem is exactly that file-extended-attributes signals an
error. The set-file-extended-attributes part is handled correctly:
;; If set-file-extended-attributes fails, fall back on
;; set-file-modes.
(unless
(with-demoted-errors "Error setting attributes: %s"
(set-file-extended-attributes buffer-file-name
(nth 1 setmodes)))
(set-file-modes buffer-file-name
(logior (car setmodes) 128)))))
Which to me is just one more argument in favor of showing a simple
message when file-extended-attributes fails, instead of signaling an
error and breaking the save-buffer command.