This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fstat() problem in libc/rexec.cc


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]