delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/12/16/07:45:46

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: Re: [1.7] chmod fails with windows path
Date: Mon, 15 Dec 2008 20:44:38 +0000 (UTC)
Lines: 29
Message-ID: <loom.20081215T203756-392@post.gmane.org>
References: <4946A1DF DOT 9020601 AT spiresoftware DOT com> <20081215185705 DOT GB6830 AT calimero DOT vinschen DOT de> <4946B8C4 DOT 5070100 AT byu DOT net> <loom DOT 20081215T202442-649 AT post DOT gmane DOT org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
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

Eric Blake <ebb9 <at> byu.net> writes:

> 
> Eric Blake <ebb9 <at> byu.net> writes:
> 
> > Or, more accurately, a limitation of the coreutils .exe magic getting
> > thrown off by the switch to the new cygwin_conv_path.
> 
> On further thought, chmod doesn't do .exe magic to begin with (cp, mv, and ln 
> do, but not chmod).  Maybe the culprit is the fact that coreutils uses 
fchmodat 
> rather than chmod?

Yep.  I stepped through chmod(1) in the debugger, and this call failed:

fchmodat(AT_FDCWD, "c:/blah", 0755, 0);

even though I previously created "/cygdrive/c/blah".

It looks like gen_full_path_at is to blame; it is not recognizing DOS-style 
absolute paths; it tries to construct {cygheap->cwd.posix}"/c:/blah" rather 
than "c:/blah", and since "./c:" is not a directory, you get the failure.

Which means I don't have to change anything in coreutils, but cygwin1.dll does 
need a refresh.

-- 
Eric Blake



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

- Raw text -


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