[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.109 and 1.109.2.1

version 1.109, 2001/04/17 12:55:03 version 1.109.2.1, 2001/06/12 22:31:48
Line 2524 
Line 2524 
 /* removes the agent forwarding socket */  /* removes the agent forwarding socket */
   
 void  void
 cleanup_socket(void)  auth_sock_cleanup_proc(void *_pw)
 {  {
         unlink(channel_forwarded_auth_socket_name);          struct passwd *pw = _pw;
         rmdir(channel_forwarded_auth_socket_dir);  
           if (channel_forwarded_auth_socket_name) {
                   temporarily_use_uid(pw);
                   unlink(channel_forwarded_auth_socket_name);
                   rmdir(channel_forwarded_auth_socket_dir);
                   channel_forwarded_auth_socket_name = NULL;
                   restore_uid();
           }
 }  }
   
 /*  /*
Line 2566 
Line 2573 
         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());
   
         if (atexit(cleanup_socket) < 0) {          /* delete agent socket on fatal() */
                 int saved = errno;          fatal_add_cleanup(auth_sock_cleanup_proc, pw);
                 cleanup_socket();  
                 packet_disconnect("socket: %.100s", strerror(saved));  
         }  
         /* Create the socket. */          /* Create the socket. */
         sock = socket(AF_UNIX, SOCK_STREAM, 0);          sock = socket(AF_UNIX, SOCK_STREAM, 0);
         if (sock < 0)          if (sock < 0)

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.109.2.1