S_ISSOCK fails in openssh >= 5.1

petesea at bigfoot.com petesea at bigfoot.com
Tue Feb 23 14:22:24 EST 2010


Starting with openssh 5.1 the following code fails (when executed on a 
remote host)... prior to 5.0 this worked, ie S_ISSOCK says STDIN is a 
socket.

   struct stat s;
   fstat(STDIN_FILENO, &s);
   if (S_ISSOCK(s.st_mode))
     // STDIN is a socket
   else
     // STDIN is not a socket

Soo... if I have a command on a remote host that includes the above code 
and I ssh to the remote host and execute the command, S_ISSOCK will fail if 
the ssh server is >= 5.1.

Is this change on purpose or a bug?


More information about the openssh-unix-dev mailing list