Subject: RE: how to become root to change ownership
From: "Gareth Pearce" <[email-masked]>
To: <[email-masked]>
Cc: <[email-masked]>
Date: Wed, 19 Nov 2003 18:09:29 +1100

Your post is offtopic for cygwin-apps - I've cc'd cygwin instead.  Although
its possible that your almost offtopic there as well.  Since it isn't clear
that what your experiencing is a cygwin problem only

> 
> somehow the permissions on my main drive became garbled.
> How do I go about fixing this? I have already tried
> loggin in as the administrator without success. Would someone
> please shed some light on this? Thanks you. jake
> 
> 539 <wdoz>[/c] ls -tld /cygdrive/c /cygdrive/e /cygdrive/g
> d---------   12 ???????? ????????        0 Nov 19 01:24 /cygdrive/c/
> dr-xr-xr-x+  35 jakez    None            0 Nov 19 01:24 /cygdrive/e/
> d---------    8 ???????? ????????        0 Nov 19 01:24 /cygdrive/g/
> 540 <wdoz>[/c] chown jakez:None /cygdrive/c
> chown: changing ownership of `/cygdrive/c': Permission denied
> 541 <wdoz>[/c] chmod 755 /cygdrive/c
> chmod: changing permissions of `/cygdrive/c': Permission denied
> 542 <wdoz>[/c] ls /cygdrive/c
> ls: /cygdrive/c: Permission denied
> 
> (running the latest snapshot 11/11/2003 dll)
> -rwx------+   1 jakez    None      1081698 Nov 16 03:23 /bin/cygwin1.dll*
First off, is it only showing up with the snapshot? If not...

Theres a few possibilities here, that come to my mind at least.   1. Your
/etc/passwd /etc/groups are out of date and need repairing.  

mkpasswd/mkgroup commands might be of help here.  

Hopefully it is not...

2. You're seeing actual corrupted (or out of date) permissions.  To fix this
case ... well ... with windows xp, and not using 'simple sharing' mode, I
find editing the security settings tab in the properties window for the
directory in explorer helps - you'll want to select advanced and 'take over
ownership' of the files from their currently corrupted versions - quite
possibly recursively.  I personally did this to some success after I mashed
my windows install trying to move it from one hard drive to another.  In the
end however I had to do a reinstall though, too many cases of bad
permissions that I didn't find.
You might be able to correct them via cygwin to (setfacl?). But I don't know
for sure.

Gareth

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/