unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* set-file-extended-attributes and backups
@ 2012-12-21 14:53 Eli Zaretskii
  2012-12-21 16:00 ` Paul Eggert
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Eli Zaretskii @ 2012-12-21 14:53 UTC (permalink / raw)
  To: emacs-devel; +Cc: Fabrice Popineau

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




^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-12-30 17:21 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-21 14:53 set-file-extended-attributes and backups Eli Zaretskii
2012-12-21 16:00 ` Paul Eggert
2012-12-21 16:44   ` Eli Zaretskii
2012-12-21 17:48     ` Paul Eggert
2012-12-21 18:08       ` Eli Zaretskii
2012-12-21 18:31         ` Paul Eggert
2012-12-23 16:59     ` Romain Francoise
2012-12-23 17:35       ` Eli Zaretskii
2012-12-24  0:59         ` Stefan Monnier
2012-12-24  3:44           ` Eli Zaretskii
2012-12-24  5:18             ` Stefan Monnier
2012-12-24  8:25               ` Michael Albinus
2012-12-24 16:24               ` Eli Zaretskii
2012-12-21 18:31 ` Romain Francoise
2012-12-22 23:03   ` Fabrice Popineau
2012-12-23  3:54     ` Eli Zaretskii
2012-12-23 17:17       ` Eli Zaretskii
2012-12-22 16:05 ` Stefan Monnier
2012-12-22 17:03   ` Eli Zaretskii
2012-12-23 13:37     ` Stefan Monnier
2012-12-29 17:20       ` Eli Zaretskii
2012-12-29 17:50         ` Eli Zaretskii
2012-12-29 19:12           ` Michael Albinus
2012-12-30 10:59             ` Michael Albinus
2012-12-30 17:21               ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).