[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.3 and 1.4

version 1.3, 1999/09/29 06:15:00 version 1.4, 1999/09/29 21:14:16
Line 563 
Line 563 
   
       parent_pid = getpid();        parent_pid = getpid();
   
       sprintf(socket_name, SSH_AGENT_SOCKET, parent_pid);        snprintf(socket_name, sizeof socket_name, SSH_AGENT_SOCKET, parent_pid);
   
       /* Fork, and have the parent execute the command.  The child continues as        /* Fork, and have the parent execute the command.  The child continues as
          the authentication agent. */           the authentication agent. */
       if (fork() != 0)        if (fork() != 0)
         { /* Parent - execute the given command. */          { /* Parent - execute the given command. */
           sprintf(buf, "SSH_AUTHENTICATION_SOCKET=%s", socket_name);            snprintf(buf, sizeof buf, "SSH_AUTHENTICATION_SOCKET=%s", socket_name);
           putenv(buf);            putenv(buf);
           execvp(av[1], av + 1);            execvp(av[1], av + 1);
           perror(av[1]);            perror(av[1]);
Line 584 
Line 584 
         }          }
       memset(&sunaddr, 0, sizeof(sunaddr));        memset(&sunaddr, 0, sizeof(sunaddr));
       sunaddr.sun_family = AF_UNIX;        sunaddr.sun_family = AF_UNIX;
       strncpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path));        strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path));
       if (bind(sock, (struct sockaddr *)&sunaddr, AF_UNIX_SIZE(sunaddr)) < 0)        if (bind(sock, (struct sockaddr *)&sunaddr, AF_UNIX_SIZE(sunaddr)) < 0)
         {          {
           perror("bind");            perror("bind");
Line 643 
Line 643 
       if (fork() != 0)        if (fork() != 0)
         { /* Parent - execute the given command. */          { /* Parent - execute the given command. */
           close(sockets[0]);            close(sockets[0]);
           sprintf(buf, "SSH_AUTHENTICATION_FD=%d", sockets[1]);            snprintf(buf, sizeof buf, "SSH_AUTHENTICATION_FD=%d", sockets[1]);
           putenv(buf);            putenv(buf);
           execvp(av[1], av + 1);            execvp(av[1], av + 1);
           perror(av[1]);            perror(av[1]);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4