From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#29455: backup-by-copying ACL Operation not permitted with Windows 7 and Samba Date: Tue, 28 Nov 2017 19:28:19 +0200 Message-ID: <83wp2a48jw.fsf@gnu.org> References: <83bmjp6kkt.fsf@gnu.org> <83wp2b67nq.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1511890263 23283 195.159.176.226 (28 Nov 2017 17:31:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Nov 2017 17:31:03 +0000 (UTC) Cc: 29455@debbugs.gnu.org To: Shuguang Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 28 18:30:58 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJjij-0005bY-51 for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Nov 2017 18:30:57 +0100 Original-Received: from localhost ([::1]:39271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJjiq-0000fS-AQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Nov 2017 12:31:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJjgy-0007AZ-45 for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 12:29:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJjgs-0007aA-QQ for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 12:29:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJjgs-0007Zz-K8 for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 12:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eJjgs-0004EL-Cc for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 12:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Nov 2017 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29455 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29455-submit@debbugs.gnu.org id=B29455.151189011916215 (code B ref 29455); Tue, 28 Nov 2017 17:29:02 +0000 Original-Received: (at 29455) by debbugs.gnu.org; 28 Nov 2017 17:28:39 +0000 Original-Received: from localhost ([127.0.0.1]:34960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJjgU-0004DT-Nf for submit@debbugs.gnu.org; Tue, 28 Nov 2017 12:28:38 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJjgT-0004DC-Np for 29455@debbugs.gnu.org; Tue, 28 Nov 2017 12:28:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJjgJ-0006zM-H9 for 29455@debbugs.gnu.org; Tue, 28 Nov 2017 12:28:32 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJjgJ-0006zF-Ck; Tue, 28 Nov 2017 12:28:27 -0500 Original-Received: from [176.228.60.248] (port=3182 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eJjgI-0000s4-PD; Tue, 28 Nov 2017 12:28:27 -0500 In-reply-to: (message from Shuguang Sun on Tue, 28 Nov 2017 18:43:53 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140494 Archived-At: > From: Shuguang Sun > Date: Tue, 28 Nov 2017 18:43:53 +0800 > Cc: 29455@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.