X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:references:to:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=ZGmwAYnuRLaG32Q5 M1m2FueGC3K1jf5w8GqtC2UuDpnW8AKSBtHMGrSTr2lxDgYd6SDEjZVWvEzOTnh7 EhK+EDj2na5snWEytQgMXlKMm1XZJKDUCUdrbwl07QBjGx0lHXDd2+QxdisZE0Re c9eJjAJ/tk3RBuR/g1Gp/95WkRk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:references:to:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=3c9N8s8l5cerNN7UcVwB2/ UucPI=; b=cT2d/IGXAKG0tDwaUygzxaR5k5W01lAxE00qbBLAcBIsLFDnH5Jj1/ 9kgxbt8oM+vDdejXVKOGgsLcPewslick7YoEiUkrXnHU1KgAzIPcUOIuUGUKk725 QMNnuHSchGd0WU4Ya3yEbuuatSHFHaUr5zN3CUaDbZOVWY550IAaE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Reply-To: moss AT cs DOT umass DOT edu Subject: Re: What would it take to get Cygwin and NTFS file permissions to play nice? References: <5703de0b-e931-8120-ebdd-72da52c49879 AT gmail DOT com> To: cygwin AT cygwin DOT com From: Eliot Moss Message-ID: Date: Fri, 12 Aug 2016 22:59:34 -0400 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 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