From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Shuguang Sun Newsgroups: gmane.emacs.bugs Subject: bug#29455: backup-by-copying ACL Operation not permitted with Windows 7 and Samba Date: Mon, 27 Nov 2017 14:29:18 +0800 Message-ID: References: <83bmjp6kkt.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114e6508abd702055ef105f6" X-Trace: blaine.gmane.org 1511764227 10722 195.159.176.226 (27 Nov 2017 06:30:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 27 Nov 2017 06:30:27 +0000 (UTC) Cc: 29455@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 27 07:30:20 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 1eJCvk-0001Vc-NJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Nov 2017 07:30:13 +0100 Original-Received: from localhost ([::1]:59391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJCvo-0000LW-Rz for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Nov 2017 01:30:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJCvf-0000Km-21 for bug-gnu-emacs@gnu.org; Mon, 27 Nov 2017 01:30:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJCva-00020A-TR for bug-gnu-emacs@gnu.org; Mon, 27 Nov 2017 01:30:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51260) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJCva-0001zc-PS for bug-gnu-emacs@gnu.org; Mon, 27 Nov 2017 01:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eJCva-0006R5-DK for bug-gnu-emacs@gnu.org; Mon, 27 Nov 2017 01:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Shuguang Sun Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Nov 2017 06:30: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.151176416624654 (code B ref 29455); Mon, 27 Nov 2017 06:30:02 +0000 Original-Received: (at 29455) by debbugs.gnu.org; 27 Nov 2017 06:29:26 +0000 Original-Received: from localhost ([127.0.0.1]:59941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJCv0-0006PZ-CY for submit@debbugs.gnu.org; Mon, 27 Nov 2017 01:29:26 -0500 Original-Received: from mail-qk0-f181.google.com ([209.85.220.181]:42115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJCuy-0006PL-9o for 29455@debbugs.gnu.org; Mon, 27 Nov 2017 01:29:24 -0500 Original-Received: by mail-qk0-f181.google.com with SMTP id a194so31067296qkc.9 for <29455@debbugs.gnu.org>; Sun, 26 Nov 2017 22:29:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=muQhJ5YtMNN/iCwBJxgfELH3B4AA2wMZyehMT43Un6g=; b=MglzWvxtJ7n/g19zefuXtc/Xvxx3xh8JbR22NYuQCwRtHSuq0hybVPrT/2Nt/GB6FH rPHzDr2BQmjclgxvoHWpmet67PuH15udzWb4MM7Pz3fKaglPGCSCCvQaYCwA9HzyPX1Q C2usFhPVBTbIQlQ6I8N9TCcnGzLacUmELDAbITkcxQ6JT5P40cr8XWN70/D32p9YTvNV wEBFzmqGNao3QOlt3vs5BqhJQ0mFjJyRzA8fP/fzdRFiwSfMO5M6zGTmU5/Kok+8cm/9 iwTsDBGFZxA0P0NKiMZqFicXq/SQYK1Dj+xBfVF9BVHs4LaB97JQNtp8OLKgNLNqAd/F paPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=muQhJ5YtMNN/iCwBJxgfELH3B4AA2wMZyehMT43Un6g=; b=V3b+aFbGSKBhbCQl/CeqXWInUChfqhlkWDVQhkDttAyW6LJxSQXFblSX53xGp3CMqg d55f2DwFqJLPciSjbVUrgXBJohV288sioB7ywBa64u2gZ4h3NVeKXC5YzE2ucdUEk/D6 qDPjFZ7XlYK+JsDTGK19drdcJagrV24lkQ21EhC7q6pLfikSArjHV/oqWmamoQ5cSbID m4eeBrNcQz7Rn53Mer32MweKvY5Sb4TH+PW8eqvLCvNvXXV2vMwDsxsv7DHljSF8pWv2 36mtMu10INN4F4RtS+T7yJdzsIvqvcr2bgr1Bm7gC+g/VswWKVZyrPgPWSs7sSA7V3gD HsTQ== X-Gm-Message-State: AJaThX6eWjyF/SA+DiGhn03eJdx298Rd6VlT53XeiGXE2FFvm9mjicu7 sx+ZOQ7YxzKd57EaMNTylTLv5kFWnFd+me4PRcU= X-Google-Smtp-Source: AGs4zMYx6j21pdZEapSk3BzMKdGz4nCgzUzjmH8NfXlXG+tWdx3sn6PCoyLR1KlfnBdxMU12dgNbxsYNQyDZz0EisIE= X-Received: by 10.55.87.199 with SMTP id l190mr55315017qkb.30.1511764158827; Sun, 26 Nov 2017 22:29:18 -0800 (PST) Original-Received: by 10.237.43.166 with HTTP; Sun, 26 Nov 2017 22:29:18 -0800 (PST) In-Reply-To: <83bmjp6kkt.fsf@gnu.org> 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:140443 Archived-At: --001a114e6508abd702055ef105f6 Content-Type: text/plain; charset="UTF-8" The debug-on-error is set to t. If setq it to nil, it just raise and error warning, and will not stop backup. The ACE for a local file looks like: "O:S-1-5-21-1213861250-xx-xx-207145G:DUD:AI(A;ID;FA;;;SY)(A;ID;FA;;;BA)(A;ID;FA;;;S-1-5-21-1213861250-xx-xx-207145)(A;ID;FA;;;LA)" (xx masks some numbers) (S-1-5-21 is SECURITY_NT_NON_UNIQUE, SIDS are not unique.) I searched online and find that O:S-1-22 is a unix/linux mapped to windows by samba. And actually in my situation is that I have files in a linux server, and mapped it as network driver in Windows 7 (maybe by Samba). All such kind of files (what I can edit) have ACL/SDDL 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). On Mon, Nov 27, 2017 at 1:01 AM, Eli Zaretskii wrote: > > From: Shuguang Sun > > Date: Sun, 26 Nov 2017 22:59:33 +0800 > > > > Local: Windows 7 > > GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32) of 2017-11-24 > > (backup-by-copying t) > > > > File is on a server which is mapped as network driver in Windows 7. It > seems a samba according to the SID > > below. > > The SDDL from file-acl is > > "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)" > > > > After I edited the file and write it, the backup meets error: > > > > Debugger entered--Lisp error: (file-error "Setting ACL" "Operation not > permitted" > > "c:/Users/username/HOME/.emacs.d/autosave/Rfiles/! > drive_i!test_fixed_IA_time.r.~2~") > > set-file-acl("c:/Users/username/HOME/.emacs.d/ > autosave/Rfiles/!drive_i!test_fixed_IA_time.r.~2~" > > "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)") > > set-file-extended-attributes > > ("c:/Users/username/HOME/.emacs.d/autosave/Rfiles/! > drive_i!test_fixed_IA_time.r.~2~" ((acl . > > "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)") > > (selinux-context nil nil nil nil))) > > backup-buffer-copy("i:/power/permutation_test_fixed_IA_time.r" > > "c:/Users/username/HOME/.emacs.d/autosave/Rfiles/! > drive_i!test_fixed_IA_time.r.~2~" 438 ((acl . > > "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)") > > (selinux-context nil nil nil nil))) > > backup-buffer() > > basic-save-buffer-2() > > basic-save-buffer-1() > > basic-save-buffer(t) > > save-buffer(1) > > funcall-interactively(save-buffer 1) > > call-interactively(save-buffer nil nil) > > command-execute(save-buffer) > > Do you have debug-on-error set to non-nil? In backup-buffer-copy the > function set-file-extended-attributes is called inside > with-demoted-errors, so unless debug-on-error is non-nil, the error > should have been converted to a simple message, and Emacs should have > felled back to set-file-modes. Why isn't this happening in your case? > > Also, does the following fail with SOME-FILE being a local file? > > 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 > --001a114e6508abd702055ef105f6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The debug-on-error is set to t. If setq it to nil, it= just raise and error warning, and will not stop backup.

=
The ACE for a local file looks like:
"O:S-1-5-21-= 1213861250-xx-xx-207145G:DUD:AI(A;ID;FA;;;SY)(A;ID;FA;;;BA)(A;ID;FA;;;S-1-5= -21-1213861250-xx-xx-207145)(A;ID;FA;;;LA)"
(xx masks some n= umbers)
(S-1-5-21 is SECURITY_NT_NON_UNIQUE, SIDS are = not unique.)

I searched online and find that O:S-1= -22 is a unix/linux mapped to windows by samba. And actually in my situatio= n is that I have files in a linux server, and mapped it as network driver i= n Windows 7 (maybe by Samba). All such kind of files (what I can edit) have= ACL/SDDL 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).

=


On Mon, Nov 27, 2017 at 1:01 AM, Eli Zaretskii <eliz@gnu.org&= gt; wrote:
> From: Shuguang Sun= <shuguang@gmail.com>
> Date: Sun, 26 Nov 2017 22:59:33 +0800
>
> Local: Windows 7
> GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32) of 2017-11-24
> (backup-by-copying t)
>
> File is on a server which is mapped as network driver in Windows 7. It= seems a samba according to the SID
> below.
> The SDDL from file-acl is
> "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)"
>
> After I edited the file and write it, the backup meets error:
>
> Debugger entered--Lisp error: (file-error "Setting ACL" &quo= t;Operation not permitted"
> "c:/Users/username/HOME/.emacs.d/autosave/Rfiles/!drive= _i!test_fixed_IA_time.r.~2~")
>=C2=A0 =C2=A0set-file-acl("c:/Users/username/HOME/.emacs.d/autosave/Rfiles/!drive_i!test_fixed_IA_time.r.~2~"
> "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)")
>=C2=A0 =C2=A0set-file-extended-attributes
> ("c:/Users/username/HOME/.emacs.d/autosave/Rfiles/!driv= e_i!test_fixed_IA_time.r.~2~" ((acl .
> "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)")
> (selinux-context nil nil nil nil)))
>=C2=A0 =C2=A0backup-buffer-copy("i:/power/permutation_test_fi= xed_IA_time.r"
> "c:/Users/username/HOME/.emacs.d/autosave/Rfiles/!drive= _i!test_fixed_IA_time.r.~2~" 438 ((acl .
> "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)")
> (selinux-context nil nil nil nil)))
>=C2=A0 =C2=A0backup-buffer()
>=C2=A0 =C2=A0basic-save-buffer-2()
>=C2=A0 =C2=A0basic-save-buffer-1()
>=C2=A0 =C2=A0basic-save-buffer(t)
>=C2=A0 =C2=A0save-buffer(1)
>=C2=A0 =C2=A0funcall-interactively(save-buffer 1)
>=C2=A0 =C2=A0call-interactively(save-buffer nil nil)
>=C2=A0 =C2=A0command-execute(save-buffer)

Do you have debug-on-error set to non-nil?=C2=A0 In backup-buffer-copy the<= br> function set-file-extended-attributes is called inside
with-demoted-errors, so unless debug-on-error is non-nil, the error
should have been converted to a simple message, and Emacs should have
felled back to set-file-modes.=C2=A0 Why isn't this happening in your c= ase?

Also, does the following fail with SOME-FILE being a local file?

=C2=A0 M-: set-file-acl("SOME-FILE" "O:S-1-22-1-79077G:S-1-2= 2-2-108D:P(A;;0x1e01ff;;;S-1-22-1-79077)(A;;FR;;;S-1-22-2-108)(A;;FR;;;WD)") RET

--001a114e6508abd702055ef105f6--