GNU bug report logs - #29455
backup-by-copying ACL Operation not permitted with Windows 7 and Samba

Previous Next

Package: emacs;

Reported by: Shuguang Sun <shuguang <at> gmail.com>

Date: Sun, 26 Nov 2017 15:00:02 UTC

Severity: normal

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Shuguang Sun <shuguang <at> gmail.com>
Cc: 29455 <at> debbugs.gnu.org
Subject: bug#29455: backup-by-copying ACL Operation not permitted with Windows 7 and Samba
Date: Tue, 28 Nov 2017 19:28:19 +0200
> From: Shuguang Sun <shuguang <at> gmail.com>
> Date: Tue, 28 Nov 2017 18:43:53 +0800
> Cc: 29455 <at> debbugs.gnu.org
> 
>  Thanks, but that's not what I asked.  I asked you to create a local
>  file (which I call "SOME-FILE" below, replace that with the actual
>  name of the file), and then type this inside Emacs:
> 
>    M-: (set-file-acl "SOME-FILE" "O:S-1-22-1-79077G:S-1-22-2-108D:P(A;;0x1e01ff;;;S-1-22-1-79077)
>  (A;;FR;;;S-1-22-2-108)(A;;FR;;;WD)") RET
> 
> It raises the same error message:
> (file-error "Setting ACL" "Operation not permitted" "c:/Users/username/Documents/base/subtitle.txt")
> 
> or
> eval: Setting ACL: Operation not permitted, c:/Users/username/HOME/.emacs.d/autosave/.bashrc.~1~

OK, I think I understand what causes this: the problem is with setting
the owner of the file to a user whose SID the local system doesn't
recognize, because it's not a local user.  If you omit the
O:S-1-22-1-79077G:S-1-22-2-108 part from the argument, the
set-file-acl call will most probably succeed.

I think that Emacs works correctly in this case: it tries to preserve
the ACLs of the original file in the backup file, and when that fails,
falls back to preserving only the read-write mode bits.  Your original
problem was caused by debug-on-error being non-nil, which shouldn't be
done except when debugging something.

I don't see how we could avoid showing the error message, because
Emacs cannot possibly know which user SID values are known to the
local system.  When you configure your backups of files from networked
drives to be stored on a local disk, you should realize that you run
the risk of having these problems with preserving extended
permissions.

So I think we see Emacs working as designed, and this bug should be
closed.




This bug report was last modified 5 years and 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.