From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: set-file-extended-attributes and backups Date: Fri, 21 Dec 2012 09:48:20 -0800 Message-ID: <50D4A0E4.3050004@cs.ucla.edu> References: <83obhntq1m.fsf@gnu.org> <50D48781.1050303@cs.ucla.edu> <83a9t7qrrw.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1356112115 7562 80.91.229.3 (21 Dec 2012 17:48:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Dec 2012 17:48:35 +0000 (UTC) Cc: romain@orebokech.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 21 18:48:49 2012 Return-path: Envelope-to: ged-emacs-devel@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 1Tm6iH-0000Ut-Al for ged-emacs-devel@m.gmane.org; Fri, 21 Dec 2012 18:48:49 +0100 Original-Received: from localhost ([::1]:39543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm6i3-0004pE-Bn for ged-emacs-devel@m.gmane.org; Fri, 21 Dec 2012 12:48:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm6hz-0004oy-I8 for emacs-devel@gnu.org; Fri, 21 Dec 2012 12:48:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tm6ht-0002ng-3h for emacs-devel@gnu.org; Fri, 21 Dec 2012 12:48:31 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:60319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tm6hp-0002nC-VG; Fri, 21 Dec 2012 12:48:22 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 11ADE39E8108; Fri, 21 Dec 2012 09:48:21 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PkyKgxlb2DFT; Fri, 21 Dec 2012 09:48:20 -0800 (PST) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9F1EB39E8105; Fri, 21 Dec 2012 09:48:20 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <83a9t7qrrw.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155739 Archived-At: On 12/21/12 08:44, Eli Zaretskii wrote: > How about if it tried to copy ACLs, and if that failed, attempted to > copy the file modes? That would DTRT if possible, and fall back on > the pre-ACL method if not. That could lead to security issues if the file modes are more permissive than the ACLs. Is there an easy way to test whether a file's ACLs could deny access when the file's modes would allow it? If so, Emacs could follow your suggestion when that test says "no". If not, Emacs could fall back on a conservative approximation to that test. The simplest conservative approximation that I can think of offhand is to test whether a file has any nontrivial ACLs. Whatever test Emacs uses, if the test says "yes" Emacs should be more cautious: create a destination file with a restrictive mode (e.g., -rw-------), copy the data, then attempt to copy the ACLs, and if the ACL copy fails then Emacs should not attempt to change the mode.