From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77216 invoked by alias); 13 Aug 2016 02:59:55 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 77037 invoked by uid 89); 13 Aug 2016 02:59:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=BAYES_05,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Eliot, H*R:D*edu, H*f:sk:5703de0, H*MI:sk:5703de0 X-HELO: mailsrv.cs.umass.edu Received: from mailsrv.cs.umass.edu (HELO mailsrv.cs.umass.edu) (128.119.240.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 13 Aug 2016 02:59:48 +0000 Received: from [192.168.0.29] (cpe-108-183-163-31.maine.res.rr.com [108.183.163.31]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id 507BC4015261; Fri, 12 Aug 2016 22:59:46 -0400 (EDT) Reply-To: moss@cs.umass.edu Subject: Re: What would it take to get Cygwin and NTFS file permissions to play nice? References: <5703de0b-e931-8120-ebdd-72da52c49879@gmail.com> To: cygwin@cygwin.com From: Eliot Moss Message-ID: Date: Sat, 13 Aug 2016 09:22:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <5703de0b-e931-8120-ebdd-72da52c49879@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00223.txt.bz2 On 8/12/2016 10:26 PM, Thomas Taylor wrote: > I use rsync to back up my Cygwin user directories to an external USB disk drive, formatted as NTFS. > This fails from time to time, usually due to permission failures when trying to update the > destination files. The Windows permissions of the destination files turn out to be in the wrong > order, and to contain extraneous entries. Further checking of other files on the destination drive > reveal the same problem with their Windows permissions. Rather that try to correct the Windows > permissions of each file in turn, I go as far up the directory tree as needed, and recursively reset > all Windows file permissions all the way down. When I then rsync the USB drive back to my user > directories, the UNIX permissions of every file are now set to executable. This has the unfortunate > effect of granting execute permission on every file restored, even those that are not executable. I > gave up on correcting the permissions of the restored files (via a long-running recursive script), > and learned to live with the problem. Until now, that is. I thought I'd try "ls --color", and was > disappointed to find that almost everything (except directories and symbolic links) came out light > green. This happened because almost everything was marked as executable, and this happened because > rsync mangled the Windows permissions, which are most easily reset to be the same on all files in a > given directory and all subdirectories. These Windows permissions inevitably involve "Full Control" > (including execute permission) for somebody, especially the owner. Yeah, I've read the Cygwin doc > on this, and I get the feeling that solving it is too difficult/impossible/not worth the effort. > For starters, could we at least set the Windows permissions in proper order? I won't wade into the argument as to what constitutes "proper" order. I will just say that I have tended to get better result when I have given files a group different from the one associated with my user name. To wit, my user name is "moss" and that is the "group" with Windows typically associates with my files. But I established another group, that I choose to call "Cygwin", and then I give my cygwin-oriented files group "Cygwin", which at least allows their group permissions to be set more as permissions go under POSIX. I have also found it helpful (perhaps necessary), for the sake of access by backup programs, to add explicit read access by user "SYSTEM". Cygwin's current permission scheme recognizes this specially, ignoring system/admin access since it is like that of root under POSIX. Perhaps some of this will help you figure out a good way to set your permissions. I agree that it is sometimes a pain, but I also think that Corinna and the Cygwin community have converged on what is likely the best solution to a complex problem that may have no ideal solution. Regards -- Eliot Moss -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple