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

Diff for /src/usr.bin/ssh/ssh-agent.c between version 1.187 and 1.188

version 1.187, 2014/07/03 03:11:03 version 1.188, 2014/07/15 15:54:14
Line 1022 
Line 1022 
         u_int nalloc;          u_int nalloc;
         char *shell, *format, *pidstr, *agentsocket = NULL;          char *shell, *format, *pidstr, *agentsocket = NULL;
         fd_set *readsetp = NULL, *writesetp = NULL;          fd_set *readsetp = NULL, *writesetp = NULL;
         struct sockaddr_un sunaddr;  
         struct rlimit rlim;          struct rlimit rlim;
         extern int optind;          extern int optind;
         extern char *optarg;          extern char *optarg;
Line 1134 
Line 1133 
          * Create socket early so it will exist before command gets run from           * Create socket early so it will exist before command gets run from
          * the parent.           * the parent.
          */           */
         sock = socket(AF_UNIX, SOCK_STREAM, 0);          sock = unix_listener(socket_name, SSH_LISTEN_BACKLOG, 0);
         if (sock < 0) {          if (sock < 0) {
                 perror("socket");                  /* XXX - unix_listener() calls error() not perror() */
                 *socket_name = '\0'; /* Don't unlink any existing file */                  *socket_name = '\0'; /* Don't unlink any existing file */
                 cleanup_exit(1);  
         }  
         memset(&sunaddr, 0, sizeof(sunaddr));  
         sunaddr.sun_family = AF_UNIX;  
         strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path));  
         if (bind(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0) {  
                 perror("bind");  
                 *socket_name = '\0'; /* Don't unlink any existing file */  
                 cleanup_exit(1);  
         }  
         if (listen(sock, SSH_LISTEN_BACKLOG) < 0) {  
                 perror("listen");  
                 cleanup_exit(1);                  cleanup_exit(1);
         }          }
   

Legend:
Removed from v.1.187  
changed lines
  Added in v.1.188