From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66546: 30.0.50; save-buffer to write-protected file without backup fails Date: Sun, 15 Oct 2023 08:33:49 +0300 Message-ID: <83cyxgqwjm.fsf@gnu.org> References: <83h6mtq9t7.fsf@gnu.org> <8734ydx7x3.fsf@sappc2.fritz.box> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22528"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66546@debbugs.gnu.org To: Jens Schmidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 15 07:35:00 2023 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 1qrtmG-0005dI-7p for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Oct 2023 07:35:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrtlw-0002cq-7V; Sun, 15 Oct 2023 01:34:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrtlv-0002cN-3v for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 01:34:39 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrtlu-0006Lg-QJ for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 01:34:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrtmI-00054c-DD for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 01:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Oct 2023 05:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66546 X-GNU-PR-Package: emacs Original-Received: via spool by 66546-submit@debbugs.gnu.org id=B66546.169734807619461 (code B ref 66546); Sun, 15 Oct 2023 05:35:02 +0000 Original-Received: (at 66546) by debbugs.gnu.org; 15 Oct 2023 05:34:36 +0000 Original-Received: from localhost ([127.0.0.1]:51097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrtlr-00053o-On for submit@debbugs.gnu.org; Sun, 15 Oct 2023 01:34:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrtlp-00053c-5A for 66546@debbugs.gnu.org; Sun, 15 Oct 2023 01:34:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrtlL-0006En-It; Sun, 15 Oct 2023 01:34:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1SUKDir7pIJydxjiJvsd1MDUWzszTNVsNjiTRJAz+F4=; b=CEIutA3Yzps5 oPkdRPe4SfWddPeZr5d+PWE1LwkzeGm8RsCpndSi458RIKGS0pvVk6fV7D7tcLu1t1njUt6UkO5YA 9pgRbxnZxam4bEYXknCk7kMf8bAVnnSr3V70IQYknnHie6WvOFwXE/exvAfjGkM0JWaXa7U+C9Sml iuKt9sSh5ogm1UoKs/WHblG8T9q06AgoH9JJ9oZaM/K1l4Fi6CMotudg8AEKkQOnXaJ0vd+raFSO0 NkoYXUXNAlP9M3a5yU5oessu9Si6A9jodfK9vBmVbp5Ol0R+5VCYXcuau/SBtYaAJU//1IoKcY2xG h4JWRYBMhDE12Mf5NFzJIQ==; In-Reply-To: <8734ydx7x3.fsf@sappc2.fritz.box> (message from Jens Schmidt on Sat, 14 Oct 2023 22:31:36 +0200) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272482 Archived-At: > From: Jens Schmidt > Cc: 66546@debbugs.gnu.org > Date: Sat, 14 Oct 2023 22:31:36 +0200 > > > Please explain what happens with "C-0 C-x C-s", and why. I don't > > think I understand that, given what you wrote. > > "C-0 C-x C-s" prompts me whether to write the modified buffer to the > write-protected file. When I reply "yes", I expect Emacs to do the > following: > > 1. Get the mode bits/extended attributes of "foo". > 2. Remove the write-potection on "foo". > 3. Write the buffer to "foo", not creating a backup file. > 4. Restore the mode bits/extended attributes on "foo" to their previous > state taken in step 1. So far, so good. > What happens instead: > > Emacs errors out that it cannot write to the file, even though it has > the permissions and means to temporarily remove the write-protection on > it. Why cannot Emacs write to the file, and what do the extended attributes have to do with that? > >> I propose to just drop that call to `set-file-extended-attributes', > >> like this: > > > > Why does it make sense to ignore the extended attributes here, when we > > don't ignore them elsewhere in Emacs? > > Because we do not have the equivalent to `(logior OLD-MODE 128)' for > extended attributes yet. I still don't follow you: why do we need that in this situation? I hope if you answer to me previous question above in enough detail, it will also answer this question. So far I don't understand why this fails and what do extended attributes have to do with it.