From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Young Newsgroups: gmane.emacs.bugs Subject: bug#44627: 25.2; tempsetmodes handling does not update extended attributes Date: Fri, 13 Nov 2020 23:50:28 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7617"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 To: 44627@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 14 09:39:11 2020 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 1kdr5R-0001pi-MF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Nov 2020 09:39:10 +0100 Original-Received: from localhost ([::1]:39004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdr5Q-0000Rx-92 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Nov 2020 03:39:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdr5K-0000Rd-8G for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 03:39:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdr5J-0000gw-VI for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 03:39:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdr5J-0001ac-TR for bug-gnu-emacs@gnu.org; Sat, 14 Nov 2020 03:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Young Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Nov 2020 08:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44627 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16053430916045 (code B ref -1); Sat, 14 Nov 2020 08:39:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Nov 2020 08:38:11 +0000 Original-Received: from localhost ([127.0.0.1]:49689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdr4U-0001ZL-6t for submit@debbugs.gnu.org; Sat, 14 Nov 2020 03:38:11 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:59352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdnX0-0004Yc-VF for submit@debbugs.gnu.org; Fri, 13 Nov 2020 23:51:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdnX0-0006DA-MI for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 23:51:22 -0500 Original-Received: from resqmta-ch2-09v.sys.comcast.net ([2001:558:fe21:29:69:252:207:41]:58790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdnWy-0006Fe-5Q for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 23:51:22 -0500 Original-Received: from resomta-ch2-11v.sys.comcast.net ([69.252.207.107]) by resqmta-ch2-09v.sys.comcast.net with ESMTP id dnSjkPZ91fRqGdnWskvBSu; Sat, 14 Nov 2020 04:51:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20180828_2048; t=1605329474; bh=jiXl33LoOf4BFowZvBWyB+mv3wFD6AIEgMvWJGFeRwQ=; h=Received:Received:From:Subject:To:Message-ID:Date:MIME-Version: Content-Type; b=hVL9/bY/rnsv/D+qfgaIKgi3v/6EWW5eFiK9eUOL2wuu52nEY0HjRJDVb5h+1yDWh jhQ3Crds7YkGtCc68tqLnVH8ON1uRRvHWrP7YqB44QHB3dwTAmFc7+SpyVVYgOf+c0 Ox82QAd0WxHhBVxgaZXHYydF1pmI//BMI078J6bCsoEOppcVUx3v8Jv864MvKG8sNy q8CFGiOGi8Jzx1//mqHIWY1D8qgNqVyod3FojUBeJ4QOImZEWo9J2hTmd65behcV7O o/MjvkOfRVthEBiUqU9O2wpBUFR2Jfg+drrMbmLrE0fzqnR79FkMq5BZIN38iaJm4r gCHGeYYseRMhw== Original-Received: from [172.17.22.37] ([24.131.31.129]) by resomta-ch2-11v.sys.comcast.net with ESMTPA id dnW9k2qZXDCzhdnWpkcieQ; Sat, 14 Nov 2020 04:51:11 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedujedruddviedgjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvehomhgtrghsthdqtfgvshhipdfqfgfvpdfpqffurfetoffkrfenuceurghilhhouhhtmecufedtudenucenucfjughrpefhuffvkffffgggtgfgsehtkeertddtfeejnecuhfhrohhmpefoihgthhgrvghlucgjohhunhhguceomhifhidqhhhshiiifhhosehthhgvqdihohhunhhgshdrohhrgheqnecuggftrfgrthhtvghrnhepgeekhfehiefghfekteetgedvgeetudekhfehfefggeevgeefjeeuuefgvefgheehnecuffhomhgrihhnpehgnhhurdhorhhgpdhgihhthhhusgdrtghomhenucfkphepvdegrddufedurdefuddruddvleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludejvddrudejrddvvddrfeejngdpihhnvghtpedvgedrudefuddrfedurdduvdelpdhmrghilhhfrhhomhepmhifhidqhhhshiiifhhosehthhgvqdihohhunhhgshdrohhrghdprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg X-Xfinity-VMeta: sc=0.00;st=legit Content-Language: en-US Received-SPF: none client-ip=2001:558:fe21:29:69:252:207:41; envelope-from=mwy-hsyzfo@the-youngs.org; helo=resqmta-ch2-09v.sys.comcast.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/13 23:51:14 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 14 Nov 2020 03:38:07 -0500 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" Xref: news.gmane.io gmane.emacs.bugs:193257 Archived-At: This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgment at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from 'emacs -Q': Open a read-only file, toggle read-only mode, and modify the file. Attempt to save the file. Answer "yes" to the prompt File is write-protected; try to save anyway? (yes or no) If the filesystem housing supports extended attributes, the attempt to temporarily change the file mode doesn't do anything, and the subsequent attempt to write fails in basic-save-buffer-2: Opening output file: Permission denied, This section of files.el appears to be the problem: https://github.com/emacs-mirror/emacs/blob/d408866ff2a0de7af5d8bb40d9c1c310573f1800/lisp/files.el#L5444 It retrieves the extended attributes, but then does not make any changes to them before setting them. If the attempt to set the extended attributes fails, it falls back on set-file-modes to set the POSIX user write permission (128) -- that appears to work as intended. I'm not sure whether the right fix is to add the write bit in the extended-attributes ACL entry somehow, or to execute the set-file-modes (with the 128 bit) even when there are extended attirbutes. The description of file-extended-attributes at the top of files.el says that they are platform-specific metadata, so it's not clear to me how to modify the ACL in a portable way, or if there is library support for doing that. I have encountered this behavior in several different versions of emacs, including 25.2.2 and 27.1. Let me know if you need any more information. Thanks for your support! If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: 'bt full' and 'xbacktrace'. For information about debugging Emacs, please read the file /usr/share/emacs/25.2/etc/DEBUG. In GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2017-09-22, modified by Debian built on lgw01-amd64-050 System Description: Ubuntu 18.04.4 LTS Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs25-jYekUr/emacs25-25.2+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t mouse-wheel-mode: t tool-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done Loading /etc/emacs/site-start.d/50lilypond-data.el (source)...done Loading /home/mwyoung/lib/emacs/mwyoung.el (source)...done For information about GNU Emacs and the GNU system, type C-a. Mark set Note: file is write protected Read-Only mode disabled in current buffer ‘toggle-read-only’ is an obsolete command (as of 24.3); use ‘read-only-mode’ instead. Saving file /tmp/hi... basic-save-buffer-2: Opening output file: Permission denied, /tmp/hi Load-path shadows: /usr/share/emacs/25.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /home/mwyoung/lib/emacs/vi hides /usr/share/emacs/25.2/lisp/obsolete/vi Features: (shadow sort mail-extr emacsbug message format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils dired time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 104135 6434) (symbols 48 19842 0) (miscs 40 48 135) (strings 32 14416 4804) (string-bytes 1 411539) (vectors 16 9391) (vector-slots 8 385376 17862) (floats 8 162 258) (intervals 56 8579 0) (buffers 976 20))