Corinna Vinschen wrote: >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 :}
I think this should also fix the (long-standing) problem documented in the rexecd section of /usr/share/doc/Cygwin/inetutils*README: I verified that the REXEC_USER/REXEC_PASS variables work, but cygwin's rcmd() implementation is problematic. It complained that my ~/.netrc file was readable by others, and refused to use it; however, the permissions were 0600. I did not track this down further. -- Chuck
