delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/11/29/10:43:16

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_40,RP_MATCHES_RCVD,TW_RW
X-Spam-Check-By: sourceware.org
Message-ID: <4ED4FD6B.4030109@etr-usa.com>
Date: Tue, 29 Nov 2011 08:42:35 -0700
From: Warren Young <warren AT etr-usa DOT com>
User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version: 1.0
To: Cygwin-L <cygwin AT cygwin DOT com>
Subject: Re: /cygdrive/c permission denied
References: <201111290006 DOT pAT06SJQ2879534 AT mail DOT pittstate DOT edu>
In-Reply-To: <201111290006.pAT06SJQ2879534@mail.pittstate.edu>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 11/28/2011 5:06 PM, Mike Brennan wrote:
>
> When I did "cd /cygdrive; ls -l" I got:
>
> drwx------+ 1 ???????? ???????? 0 Nov 28 17:03 c

I don't think the ???????? is an error.  I see much the same thing here, 
and I have full read/write access to C:\ via the Cygwin shell.

The only serious difference I see here is that I get "d---------+", so 
going by just that, I shouldn't even be able to cd into it!  C:\ gets 
treated differently by Windows, probably for backwards compatibility 
with DOS or something.  I'm guessing that this prevents Cygwin from 
faking POSIX permission semantics for that directory.

(Don't believe C:\ is special?  Try creating a subdirectory in C:\ while 
UAC is enabled and you're logged in as an Admin.  No UAC dim-out as 
you'd expect when WRITING TO THE FRIGGIN' ROOT DIRECTORY, if the UAC 
hype had anything to do with reality.  Also no complaints when other 
programs write to the directory you just created on your behalf, unlike 
what happens if you try the same thing in, say, c:\PROGRA~1. 
<rolleyes>Windows Security&trade;</rolleyes>)

I'm assuming your cpio -p command overwrote the C:\ ACL with that of the 
top level directory of whatever you were copying.  You may be able to 
fix it with setfacl.  Here's what getfacl says here:

$ getfacl /c
# file: /c
# owner: ????????
# group: ????????
user::---
group::---
group:root:rwx
group:SYSTEM:rwx
group:Users:r-x
mask:rwx
other:---
default:user::---
default:group::---
default:group:root:rwx
default:group:SYSTEM:rwx
default:group:Users:r-x
default:mask:rwx
default:other:---

(Yes, I have cygdrive mounted on / here.  I'm an evil, bad man.  I don't 
think that explains anything, though.)

How you use setfacl to apply any diffs you need there is an exercise 
left to the reader. :)

By the way, if mirroring permissions is what you're after, I'm not sure 
cpio -p is the right thing unless you're copying a directory that 
historically has been managed only via programs built for Cygwin.  I 
dunno, maybe Cygwin's cpio knows all about Windows ACLs and such, and 
doesn't just go by the faked POSIX permissions it gets from stat(2).  I 
do know that such problems plagued Mac OS X for quite a while, and the 
impedance mismatch is much smaller between HFS+ and POSIX filesystem 
semantics than between NTFS and POSIX.  I suggest using robocopy 
instead.  I tend not to prefer native tools, but it'll likely give 
better results in this case.

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019