At 01:27 PM 11/1/2003 +0100, you wrote: >On Fri, Oct 31, 2003 at 07:05:41PM -0500, Pierre A. Humblet wrote: >> At 11:52 AM 10/31/2003 +0100, Corinna Vinschen wrote: >> >I've just again tested it on 98 and it works fine. Could you please >> >figure out what happens on your machine? >> >> 2 things: >> - I had accidentally deleted the next (23) line in services, so awk >> didn't find the pattern. > >Ok, so how do you suggest to react in the script if that happens? >Should the script just emit a warning or should it append the ssh lines >at the end of the services file? The new script will just emit a >warning for now. Both solutions are fine with me. >> - ssh crashes even with the CR. I also had to shorten the line. It works >> with 18 spaces between {tcp,udp} and the # > >Ouch. How many spaces do I emit currently... hmm, 27. This matches >the file layout on NT. A quick look on a 98 machine... yes, only >18 spaces. Oh boy... > >> Please send the next version, just to be sure. > >I've created a new script and attached it to this mail. I have just spent a few hours on this :( What I wrote initially is correct: ssh doesn't crash when the ssh lines are removed from the services file. But neither having a CR nor shortening the line have much to do with the problem. The only reason they made a difference is that I had the services file opened in Word. In that case the getservbyname call fails cleanly and ssh uses the default. The real problem is that the s_proto pointer of the struct servent returned by the Windows getservbyname on Win95 is invalid. That didn't matter before dup_ent was introduced. The problem concerns all services, not only ssh, and also affects getservbyport. Olivier@erg ~ $ gcc getserv.c -mno-cygwin -lwsock32 Olivier@erg ~ $ ./a 25 ptr = 410732 name 4107cc smtp aliases: 0, 4107e9 mail port 25 Checking validy of ptr->s_proto 7e90041 (IsBadStringPtr returns true) On Win98 one gets ~: ./a 25 ptr = 861400 name 86141d smtp aliases: 0, 861418 mail port 25 Checking validy of ptr->s_proto 861422 proto tcp I attach the getserv.c program, in case others want to experiment. A solution would be to use IsBadStringPtr (or wincap) in dup_ent. A workaround is to delete lines in the services file. Pierre