[BACK]Return to channels.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/channels.c between version 1.57 and 1.57.2.1

version 1.57, 2000/05/08 17:42:24 version 1.57.2.1, 2000/06/12 02:37:32
Line 147 
Line 147 
         return c;          return c;
 }  }
   
 void  
 set_nonblock(int fd)  
 {  
         int val;  
         val = fcntl(fd, F_GETFL, 0);  
         if (val < 0) {  
                 error("fcntl(%d, F_GETFL, 0): %s", fd, strerror(errno));  
                 return;  
         }  
         if (val & O_NONBLOCK)  
                 return;  
         debug("fd %d setting O_NONBLOCK", fd);  
         val |= O_NONBLOCK;  
         if (fcntl(fd, F_SETFL, val) == -1)  
                 error("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd, strerror(errno));  
 }  
   
 /*  /*
  * Register filedescriptors for a channel, used when allocating a channel or   * Register filedescriptors for a channel, used when allocating a channel or
  * when the channel consumer/producer is ready, e.g. shell exec'd   * when the channel consumer/producer is ready, e.g. shell exec'd
Line 2074 
Line 2057 
 }  }
   
 /*  /*
  * This if called to process SSH_CMSG_AGENT_REQUEST_FORWARDING on the server.   * This is called to process SSH_CMSG_AGENT_REQUEST_FORWARDING on the server.
  * This starts forwarding authentication requests.   * This starts forwarding authentication requests.
  */   */
   
 void  int
 auth_input_request_forwarding(struct passwd * pw)  auth_input_request_forwarding(struct passwd * pw)
 {  {
         int sock, newch;          int sock, newch;
Line 2096 
Line 2079 
         strlcpy(channel_forwarded_auth_socket_dir, "/tmp/ssh-XXXXXXXX", MAX_SOCKET_NAME);          strlcpy(channel_forwarded_auth_socket_dir, "/tmp/ssh-XXXXXXXX", MAX_SOCKET_NAME);
   
         /* Create private directory for socket */          /* Create private directory for socket */
         if (mkdtemp(channel_forwarded_auth_socket_dir) == NULL)          if (mkdtemp(channel_forwarded_auth_socket_dir) == NULL) {
                 packet_disconnect("mkdtemp: %.100s", strerror(errno));                  packet_send_debug("Agent forwarding disabled: mkdtemp() failed: %.100s",
                       strerror(errno));
                   restore_uid();
                   xfree(channel_forwarded_auth_socket_name);
                   xfree(channel_forwarded_auth_socket_dir);
                   channel_forwarded_auth_socket_name = NULL;
                   channel_forwarded_auth_socket_dir = NULL;
                   return 0;
           }
         snprintf(channel_forwarded_auth_socket_name, MAX_SOCKET_NAME, "%s/agent.%d",          snprintf(channel_forwarded_auth_socket_name, MAX_SOCKET_NAME, "%s/agent.%d",
                  channel_forwarded_auth_socket_dir, (int) getpid());                   channel_forwarded_auth_socket_dir, (int) getpid());
   
Line 2132 
Line 2123 
                                  xstrdup("auth socket"));                                   xstrdup("auth socket"));
         strlcpy(channels[newch].path, channel_forwarded_auth_socket_name,          strlcpy(channels[newch].path, channel_forwarded_auth_socket_name,
             sizeof(channels[newch].path));              sizeof(channels[newch].path));
           return 1;
 }  }
   
 /* This is called to process an SSH_SMSG_AGENT_OPEN message. */  /* This is called to process an SSH_SMSG_AGENT_OPEN message. */

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.57.2.1