From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens Schmidt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66546: 30.0.50; save-buffer to write-protected file without backup fails Date: Sat, 21 Oct 2023 22:17:18 +0200 Message-ID: <87bkcrafxt.fsf@sappc2.fritz.box> References: <83h6mtq9t7.fsf@gnu.org> <8734ydx7x3.fsf@sappc2.fritz.box> <83cyxgqwjm.fsf@gnu.org> <87lec4cjqe.fsf@sappc2.fritz.box> <83ttqsp5x1.fsf@gnu.org> <87il78cdyf.fsf@sappc2.fritz.box> <83pm1gozi6.fsf@gnu.org> <87edhvd84h.fsf@sappc2.fritz.box> <838r82q0gi.fsf@gnu.org> <87wmvmfi68.fsf@sappc2.fritz.box> <83o7gxo771.fsf@gnu.org> <87ttqpgg8l.fsf@sappc2.fritz.box> <83cyxcnp2f.fsf@gnu.org> <87sf671xe3.fsf@sappc2.fritz.box> <83y1fzmdhm.fsf@gnu.org> <87zg0ez57o.fsf@sappc2.fritz.box> <835y31u8t0.fsf@gnu.org> <87edhnamg3.fsf@sappc2.fritz.box> <83a5sbre7x.fsf@gnu.org> Reply-To: Jens Schmidt Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9794"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: 66546@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 21 22:18:48 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 1quIQp-0002L6-OK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Oct 2023 22:18:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quIQg-0002oR-NX; Sat, 21 Oct 2023 16:18:38 -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 1quIQe-0002oB-0U for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 16:18:36 -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 1quIQc-000134-5q for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 16:18:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quIR3-0005c6-Jr for bug-gnu-emacs@gnu.org; Sat, 21 Oct 2023 16:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jens Schmidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2023 20:19:01 +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.169791948621514 (code B ref 66546); Sat, 21 Oct 2023 20:19:01 +0000 Original-Received: (at 66546) by debbugs.gnu.org; 21 Oct 2023 20:18:06 +0000 Original-Received: from localhost ([127.0.0.1]:45143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quIQA-0005av-3l for submit@debbugs.gnu.org; Sat, 21 Oct 2023 16:18:06 -0400 Original-Received: from mr6.vodafonemail.de ([145.253.228.166]:60594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quIQ7-0005aO-W0 for 66546@debbugs.gnu.org; Sat, 21 Oct 2023 16:18:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-23sep; t=1697919450; bh=9cGWUTqovTPhS5GHoI013dPsaYrQbyHyoVokv9X2w84=; h=From:To:Subject:References:Date:In-Reply-To:Message-ID:User-Agent: Content-Type:From; b=hx6IOJ98r5t/sDTaHGVHoIZg7QHhRed0i1Imq1VR5Fy7N5TXiynosstsTX8iu/fOb 4TjZKpkOoc5Uf4LDveqxQrvQgmLc+Fj5WCNYrBvfyrhub+hzkUVbZa0Tq1Op/2AuHK hxTVvs4raWvL4dTxfY99Q6WLkBMRwzHFpaGSzj8I= Original-Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr6.vodafonemail.de (Postfix) with ESMTPS id 4SCXn5750kz1xx9; Sat, 21 Oct 2023 20:17:29 +0000 (UTC) Original-Received: from sappc2 (port-92-194-212-157.dynamic.as20676.net [92.194.212.157]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4SCXmy3K8zzMkrt; Sat, 21 Oct 2023 20:17:19 +0000 (UTC) In-Reply-To: <83a5sbre7x.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Oct 2023 22:02:26 +0300") X-purgate-type: clean X-purgate: clean X-purgate-size: 770 X-purgate-ID: 155817::1697919445-367F8228-487943ED/0/0 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:272938 Archived-At: Eli Zaretskii writes: >> From: Jens Schmidt >> Cc: 66546@debbugs.gnu.org >> Date: Sat, 21 Oct 2023 19:56:44 +0200 >> I wanted to make 100% sure that we execute that first cond-branch if and >> only if we previously changed the file mode. IOW, I feel I cannot >> exclude that by some strange configuration >> >> (equal buffer-file-name (nth 2 setmodes)) >> >> could also be true in other cases. > > It doesn't matter which cases could cause this. What matters is that > only when these two are identical that we need to make sure the file > ends up read-only as it was before the call to set-file-modes. Makes sense, will do. In that case, would a plain `equal' be enough to compare file paths?