0

I am trying to edit openssh package & add custom code to create socket and send some message. in other part of openssh package i am able to do but not able to perform same task in openssh-7.8p1->kex.c->choose_kex & in packet.c where we return error from

Code :

{
int sock = 0;
sock = socket(AF_INET, SOCK_STREAM, 0);
if(sock < 0) {
   debug("%s: Unable to create socket: %s",__func__, strerror(errno));
   return;
}
close(sock);
}

above code return error with log : too many open files (error code:24)

is it not possible to create socket while ssh handshake in progress?

hmt1517
  • 11
  • 2
  • I`ve already tried increasing max open file descriptors it didn`t help – hmt1517 Nov 23 '19 at 07:34
  • Is it in the server or the client? Can you tell me what you really want to do? – Gábor Nov 23 '19 at 16:45
  • You're trying to open a socket and getting error 24 which has [a particular meaning](https://stackoverflow.com/q/24862733/13317). What kind of answer are you looking for here? – Kenster Nov 23 '19 at 17:03
  • this is server. i am creating a patch to send msg when negotiation of keyExchange algorithm between C & S fails during ssh handshake. At this time current open file descriptors are under limit & not exceeding. even to be safe side i`ve tried setting max open file descriptor limit to hard high value. still same error persists. if i do socket open in later part of code , i am able to but not during keyExchange in openssh. i am looking for answer why socket creation or any normal file creation can fail during keyExchange in openssh code & how do i solve that? – hmt1517 Nov 24 '19 at 04:06

0 Answers0