From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#13226: 24.3.50; set-file-acl on MS Windows shall check ACL string format Date: Wed, 19 Dec 2012 18:23:48 +0200 Message-ID: <83y5gunh7v.fsf@gnu.org> References: <877goexm9e.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1355934249 2765 80.91.229.3 (19 Dec 2012 16:24:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Dec 2012 16:24:09 +0000 (UTC) Cc: 13226@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 19 17:24:23 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TlMRR-0008Ak-74 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Dec 2012 17:24:21 +0100 Original-Received: from localhost ([::1]:45497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlMRD-0002LW-KF for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Dec 2012 11:24:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlMRA-0002KO-NH for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2012 11:24:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlMR5-0005vN-KY for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2012 11:24:04 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlMR5-0005vJ-IM for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2012 11:23:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TlMR8-0007wY-Ab for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2012 11:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Dec 2012 16:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13226 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13226-submit@debbugs.gnu.org id=B13226.135593423230519 (code B ref 13226); Wed, 19 Dec 2012 16:24:02 +0000 Original-Received: (at 13226) by debbugs.gnu.org; 19 Dec 2012 16:23:52 +0000 Original-Received: from localhost ([127.0.0.1]:51007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlMQx-0007wA-O6 for submit@debbugs.gnu.org; Wed, 19 Dec 2012 11:23:52 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:54212) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TlMQu-0007vz-Tr for 13226@debbugs.gnu.org; Wed, 19 Dec 2012 11:23:50 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MFA00500DFW8Y00@a-mtaout20.012.net.il> for 13226@debbugs.gnu.org; Wed, 19 Dec 2012 18:23:33 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MFA004RSDJ8Z870@a-mtaout20.012.net.il>; Wed, 19 Dec 2012 18:23:32 +0200 (IST) In-reply-to: <877goexm9e.fsf@gmx.de> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:68743 Archived-At: > From: Michael Albinus > Date: Wed, 19 Dec 2012 13:24:45 +0100 > > File ACLs have different formats on MS Windows and POSIX systems: > > --8<---------------cut here---------------start------------->8--- > (file-acl "~/.emacs") > > "O:S-1-5-21-3955186872-1115707380-970145838-1000G:S-1-5-21-3955186872-1115707380-970145838-513D:(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;S-1-5-21-3955186872-1115707380-970145838-1000)" > > (file-acl "/plink:albinus@ford:~/.emacs") > > "user::rwx > group::rwx > other::r-x > " > --8<---------------cut here---------------end--------------->8--- > > If one copies a file with POSIX ACLs to MS Windows, `set-file-acl' > raises an error. This shall be suppressed: I assume that you want the error suppressed on MS-Windows, is that right? (The Subject of the report says "shall check the ACL string", which the code already does; I guess you wanted to say "shall not" or some such.) If so, I don't think I agree, for several reasons. First, this is in no way Windows specific. In fact, when I added ACL support for MS-Windows, I didn't change a single line in set-file-acl, the code which tested for errors and signaled a file_error was already there. If I try this on GNU/Unix: (set-file-acl "foobar" "foo bar") I get the same error: Debugger entered--Lisp error: (file-error "Converting ACL" "invalid argument" "/home/e/eliz/foobar") set-file-acl("foobar" "foo bar") Which doesn't surprise me, since the code is not Windows specific, and acl_from_text is documented to be able to produce EINVAL when its string argument could not be converted to a valid ACL. Second, I think it would be wrong to remove the error-checking code from set-file-acl. That function is a primitive, so signaling an error when it cannot do its job is TRT; removing that would at best take away a valuable diagnostics, and at worst disable your last line of defense in some cases. After all, whoever wants to set the file's ACL to something does that for a reason; silently failing to do that would give them no chance to take some corrective action. OTOH, if an application, in this case Tramp, decides that it can ignore these errors in some cases, it should catch the error and ignore it. It shouldn't pass the baton to primitives, IMO. IOW, if you want this suppressed, I think you should do it inside the Tramp handler for copy-file. Finally, I question the whole idea of copying ACLs between machines, because they are inherently system-dependent, and even if both machines run the same system, a user "foo" and a group "bar" on both machines are likely to map to very different users and groups, at least on Posix hosts. (On Windows, the Security Identifiers, or SIDs, of the user and the group that are recorded in the ACL are universal, so this problem doesn't exist.) So I'd actually suggest that we explicitly refrain from doing this with remote files.