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: Tue, 28 Nov 2017 17:11:34 +0800 Message-ID: References: <83bmjp6kkt.fsf@gnu.org> <83wp2b67nq.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1147603cd45fc8055f076738" X-Trace: blaine.gmane.org 1511860339 29318 195.159.176.226 (28 Nov 2017 09:12:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Nov 2017 09:12:19 +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 Tue Nov 28 10:12:14 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 1eJbw3-00078z-Cl for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Nov 2017 10:12:11 +0100 Original-Received: from localhost ([::1]:36655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJbwA-0006Gv-Io for geb-bug-gnu-emacs@m.gmane.org; Tue, 28 Nov 2017 04:12:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJbvz-0006G4-7a for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 04:12:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJbvu-0005Dl-Qz for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 04:12:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJbvu-0005Dc-Nl for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 04:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eJbvu-0005Bw-Ch for bug-gnu-emacs@gnu.org; Tue, 28 Nov 2017 04:12: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: Tue, 28 Nov 2017 09:12:01 +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.151186030219925 (code B ref 29455); Tue, 28 Nov 2017 09:12:01 +0000 Original-Received: (at 29455) by debbugs.gnu.org; 28 Nov 2017 09:11:42 +0000 Original-Received: from localhost ([127.0.0.1]:33469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJbvZ-0005BJ-MR for submit@debbugs.gnu.org; Tue, 28 Nov 2017 04:11:42 -0500 Original-Received: from mail-qk0-f176.google.com ([209.85.220.176]:41300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJbvY-0005B7-EH for 29455@debbugs.gnu.org; Tue, 28 Nov 2017 04:11:40 -0500 Original-Received: by mail-qk0-f176.google.com with SMTP id f63so36105901qke.8 for <29455@debbugs.gnu.org>; Tue, 28 Nov 2017 01:11:40 -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=xPf+iUD/ZTXFMzPycLVqxmhyph4gBvGd7Ym6GB0tit0=; b=jjt4myWMi822YWYO2UTFnGTaxtsaZUuqbJoQjn7fMiGLQg+rPSDcQpuv1jJBxPI7x+ E0N68H/d+TPGJ0Gw1tslAsCJoqUrg6zutdDHCSkvjYZvmWAZ3Jj6Sv5UbWGEv+DTOK0c 57oSDyKbGh6wXN8jSrGDqCIHwTXb2V1VFPCEbZ7XCtodcBfp4RWixom/Mm+TqtjkL/fg xJY5157hAg1YpEWIdyQDXF9JAfJ0OLO1wMQKt5eAJb0m7PQuxUtorKp9TDkIeoC07NTM XWvow0FjO7EjQAa7qvH5TV70otN1qE+uaZJ2+g1GLqcRmWEVa8Rdv/Z4y0Wea4udor7u qLHQ== 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=xPf+iUD/ZTXFMzPycLVqxmhyph4gBvGd7Ym6GB0tit0=; b=ZvWoLadRGzXBWYR9U7Z03RDstc2cg6nxodDTuat5fKZt40B/nvV2j1K0+7FWqm1GLl zYYq/WoDlnS/Ykvlr60ZhgKtg8K2sdIuWTCGDahxNnVhZIYLjy5Ce1BPDa3lIVehuaHb NV1CDyyRZJPCsaHtfl3InfdwIBHUOeADgFj/xZR4Ky3/xuMFX5C5vnIcDW6Dm4Rp7nRV YyKC/JqC8zI0eN06eaZpaud9DmrKx27UKCQTOgXGUa7QR/C08cfWCIW/QRzVFM0oG0x0 MUTNGUB/XPYgXQ+Dc6e7ceZ7PO18sKxt2mS3GlJGYfHy4eixTzDQutbAFUMyxs/LbHvV wRuQ== X-Gm-Message-State: AJaThX7R47XfuaMnZXaVSJRkh8tpw5QwF6KKveWASC/Bby/de78jyjE3 v+ATWhNB78BR/WQ+Rjk3K9/32m6lbewflO/nA0zK6w== X-Google-Smtp-Source: AGs4zMZ40Bn5T79zq4aliRYI3XD84/b/V9TPmkton5zVOyhHkod23RRxZeDy7Y/3LS65rOnvlxri1YRx+hNg4cVw6Pc= X-Received: by 10.55.15.208 with SMTP id 77mr60408614qkp.193.1511860294932; Tue, 28 Nov 2017 01:11:34 -0800 (PST) Original-Received: by 10.237.43.166 with HTTP; Tue, 28 Nov 2017 01:11:34 -0800 (PST) In-Reply-To: <83wp2b67nq.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:140483 Archived-At: --001a1147603cd45fc8055f076738 Content-Type: text/plain; charset="UTF-8" On Mon, Nov 27, 2017 at 11:52 PM, Eli Zaretskii wrote: > > From: Shuguang Sun > > Date: Mon, 27 Nov 2017 14:29:18 +0800 > > Cc: 29455@debbugs.gnu.org > > > > The debug-on-error is set to t. If setq it to nil, it just raise and > error warning, and will not stop backup. > > May I ask why do you have it set to t? The default is nil, and for a > good reason. > It is a long history and I can't recall when I put it my init file... old user > > 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.) > > 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 > > (This is one long line.) Then tell me if this succeeded or signaled > an error. > It raises the same error message: (file-error "Setting ACL" "Operation not permitted" "c:/Users/username/Documents/base/subtitle.txt") eval: Setting ACL: Operation not permitted, c:/Users/username/HOME/.emacs.d/autosave/.bashrc.~1~ > If the above succeeds for an arbitrary file, then please try the same > for a file under the c:/Users/username/HOME/.emacs.d/ directory, maybe > the problem is with the permissions of that directory. > > The "Operation not permitted" error seems to indicate that your user > is unable to acquire the privileges needed for setting the DACL of a > file on your local disk. Or it could mean some other problem. The > above test might give a hint about the reason for the failure. > > > 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). > > I don't think this is related to the networked drive, because the > failure happens when Emacs tries to set the DACL of the backup file, > which is stored on your local disk drive. > It copies the DACL from the file in the network drive. I don't know the exact underlying logic under Windows 7. But if I copy the file from the netdrive to local disk drive, the ACL will change from O:S-1-22-1 to O:S-1-5-21, vise versa. The owner (O:S-) changes. --001a1147603cd45fc8055f076738 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Nov 27, 2017 at 11:52 PM, Eli Zaretskii <<= a href=3D"mailto:eliz@gnu.org" target=3D"_blank">eliz@gnu.org> wrote:
> From: Sh= uguang Sun <shuguang@gmail.com= >
> Date: Mon, 27 Nov 2017 14:29:18 +0800
> Cc: 29455@debbugs.gnu.org=
>
> The debug-on-error is set to t. If setq it to nil, it just raise and e= rror warning, and will not stop backup.

May I ask why do you have it set to t?=C2=A0 The default is nil, and= for a
good reason.
It is a long history and I can't reca= ll when I put it my init file... old user


> 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)&q= uot;
> (xx masks some numbers)
> (S-1-5-21 is SECURITY_NT_NON_UNIQUE, SIDS are not unique.)

Thanks, but that's not what I asked.=C2=A0 I asked you to create= a local
file (which I call "SOME-FILE" below, replace that with the actua= l
name of the file), and then type this inside Emacs:

=C2=A0 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)(<= wbr>A;;FR;;;WD)") RET

(This is one long line.)=C2=A0 Then tell me if this succeeded or signaled an error.
It raises the same error message:
=
(file-error "Setting ACL" "Operation not perm= itted" "c:/Users/username/Documents/base/subtitle.txt")

eval: Setting ACL: Operation not permitted, c:/Users/u= sername/HOME/.emacs.d/autosave/.bashrc.~1~


If the above succeeds for an arbitrary file, then please try the same
for a file under the c:/Users/username/HOME/.emacs.d/ directory, maybe=
the problem is with the permissions of that directory.

The "Operation not permitted" error seems to indicate that your u= ser
is unable to acquire the privileges needed for setting the DACL of a
file on your local disk.=C2=A0 Or it could mean some other problem.=C2=A0 T= he
above test might give a hint about the reason for the failure.

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

I don't think this is related to the networked drive, because th= e
failure happens when Emacs tries to set the DACL of the backup file,
which is stored on your local disk drive.
It copies th= e DACL from the file in the network drive. I don't know the exact under= lying logic under Windows 7. But if I copy the file from the netdrive to lo= cal disk drive, the ACL will change from O:S-1-22-1= =C2=A0 to
O:S-1-5-= 21, vise versa. The owner (O:S-) changes.

=
--001a1147603cd45fc8055f076738--