delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/07/14/11:58:04

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,TW_RW
X-Spam-Check-By: sourceware.org
Message-ID: <4C3DDE7C.8060805@bopp.net>
Date: Wed, 14 Jul 2010 10:57:48 -0500
From: Jeremy Bopp <jeremy AT bopp DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: vim and file permissions on Windows 7
References: <4C3DCD3D DOT 6000404 AT codeware DOT com>
In-Reply-To: <4C3DCD3D.6000404@codeware.com>
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 7/14/2010 9:44 AM, Cory Riddell wrote:
> My Windows 7 (64-bit) machine is part of a domain and I normally log
> into it as a domain user.
> 
> Something is misconfigured because Cygwin programs seem to have a
> problem with file permissions. For example:
>   $ ls -l visitor*
>   ----------+ 1 cory Domain Users 3236 2010-07-11 22:37 visitor.cpp
>   ----------+ 1 cory Domain Users 2260 2010-07-14 09:16 visitor.h
> 
> If I open visitor.cpp with Cygwin vim, it tells me it is read-only. I
> can force a save though with w!. If I open this same file with notepad
> or my Windows version of gvim, I can edit and save the file and am never
> told it is read-only.
> 
> I've been researching quite a bit and I recreated my /etc/passwd and
> group files with the -d switch. I thought it had something to do with
> the domain, but now I don't think that's the case. I'm starting to think
> it might be the filesystem or perhaps how it is mounted. The mount
> command reports:
> $ mount
>   C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
>   C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
>   C:/cygwin on / type ntfs (binary,auto)
>   C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
>   Y: on /cygdrive/y type ntfs (binary,posix=0,user,noumount,auto)

By default, Cygwin attempts to emulate POSIX permission settings for
files and directories using specially contrived ACLs.  The files in
question appear to have been created using a Windows-native program
which set the ACLs such that Cygwin computes the POSIX permissions as
denying all operations to all people.  You are still the owner, however,
so you are able to override the permission and force vim to write to the
files.

Read about the noacl mount option here:

http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

Using that option for the mounts which contain problematic files may
correct things for you.

> Drive Y is a mapping to a network location. Interestingly, ls -l
> /cygdrive returns:
>   d---------+ 1 ????????       ????????     24576 2010-07-09 11:18 c
>   drwx------+ 1 Administrators Domain Users     0 2010-07-14 06:58 y
> 
> The c folder looks weird, the y folder looks correct.

Try ls -ln /cygdrive.  The user and group ownerships on the root of the
C: drive are most likely not found in your passwd and group files.  The
-n option for ls will print the user and group IDs rather than try to
look up their names.  Unfortunately, I can't think of any way offhand to
generate the passwd and group entries given only user and group IDs.
Maybe someone else can comment on that.

-Jeremy

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