From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: set-file-extended-attributes and backups Date: Fri, 21 Dec 2012 16:53:25 +0200 Message-ID: <83obhntq1m.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1356101628 7205 80.91.229.3 (21 Dec 2012 14:53:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Dec 2012 14:53:48 +0000 (UTC) Cc: Fabrice Popineau To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 21 15:54:03 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tm3z7-0008VA-G0 for ged-emacs-devel@m.gmane.org; Fri, 21 Dec 2012 15:54:01 +0100 Original-Received: from localhost ([::1]:40680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm3yt-0006Fn-Ht for ged-emacs-devel@m.gmane.org; Fri, 21 Dec 2012 09:53:47 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm3yq-0006Fi-15 for emacs-devel@gnu.org; Fri, 21 Dec 2012 09:53:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm3yn-0003AR-CD for emacs-devel@gnu.org; Fri, 21 Dec 2012 09:53:43 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:58346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm3yn-0003AJ-3T for emacs-devel@gnu.org; Fri, 21 Dec 2012 09:53:41 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MFD00F00YLUJ200@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Fri, 21 Dec 2012 16:53:39 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MFD00FHVYPEFG20@a-mtaout21.012.net.il>; Fri, 21 Dec 2012 16:53:39 +0200 (IST) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155728 Archived-At: Fabrice reported that since the introduction of ACLs into backing up of files (as part as saving a buffer), he gets errors (on MS-Windows 8). It turns out his user profile doesn't have the privileges to set file security descriptors. This can be fixed by granting the privileges in the local policy, but the issue I raise is should this problem be exposed in the context of backing up and saving files? I think this problem is not Windows-specific. So I'm asking here: does it make sense to fail backup-buffer and backup-buffer-copy just because set-file-extended-attributes fails? I think we should ignore such errors in these cases, and propose the changes below. P.S. If anyone wants to argue that set-file-acl should ignore this, then I disagree: it's up to the application to decide whether or not to ignore such problems. === modified file 'lisp/files.el' --- lisp/files.el 2012-12-17 15:51:49 +0000 +++ lisp/files.el 2012-12-21 12:10:16 +0000 @@ -4022,7 +4022,8 @@ BACKUPNAME is the backup file name, whic (and modes (set-file-modes to-name (logand modes #o1777))) (and extended-attributes - (set-file-extended-attributes to-name extended-attributes))) + (ignore-errors + (set-file-extended-attributes to-name extended-attributes)))) (defvar file-name-version-regexp "\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(?:~[[:digit:]]+\\)?~\\)" @@ -4738,7 +4739,9 @@ Before and after saving the buffer, this (file-extended-attributes buffer-file-name) buffer-file-name)) (set-file-modes buffer-file-name (logior (car setmodes) 128)) - (set-file-extended-attributes buffer-file-name (nth 1 setmodes))))) + (ignore-errors + (set-file-extended-attributes buffer-file-name + (nth 1 setmodes)))))) (let (success) (unwind-protect (progn