This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] fstat() problem in libc/rexec.cc
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Mon, 6 Apr 2009 22:51:21 +0200
- Subject: Re: [PATCH] fstat() problem in libc/rexec.cc
- References: <49DA641F.8070901@agilent.com>
- Reply-to: cygwin-patches at cygwin dot com
Hi Earl,
On Apr 6 13:20, Earl Chew wrote:
> The current implementation of rexec() uses fstat() and it seems
> to pick up the wrong values for st_mode. As a consequence
> the code keeps complaining about the permissions for ~/.netrc
> and won't complete successfully.
>
> I don't know enough about the how the re-mapping of stat/stat64
> works within cygwin1.dll itself, but changing to fstat64()
> like libc/iruserok.c resolves the problem.
That's exactly the right thing to do. The mapping from fstat to fstat64
only works for applications and libs linked against Cygwin, not within
Cygwin itself. So the call to fstat in rexec calls the old fstat
function which uses the old backward compatible style struct stat with
different member sizes. This explains that the mode bits are not
correct. I really thought I had catched them all, but this slipped
through my cracks, apparently :}
> winsup/cygwin/Changlog
>
> * libc/rexec.cc: Use fstat64() instead of fstat().
Patch applied.
Thank you,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat