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

Diff for /src/usr.bin/ssh/session.c between version 1.79 and 1.80

version 1.79, 2001/06/03 14:55:39 version 1.80, 2001/06/04 21:59:43
Line 94 
Line 94 
 void    do_child(Session *s, const char *command);  void    do_child(Session *s, const char *command);
 void    do_motd(void);  void    do_motd(void);
 int     check_quietlogin(Session *s, const char *command);  int     check_quietlogin(Session *s, const char *command);
 void    xauthfile_cleanup_proc(void *ignore);  void    xauthfile_cleanup_proc(void *pw);
   
 void    do_authenticated1(Authctxt *authctxt);  void    do_authenticated1(Authctxt *authctxt);
 void    do_authenticated2(Authctxt *authctxt);  void    do_authenticated2(Authctxt *authctxt);
Line 157 
Line 157 
   
         /* remote user's local Xauthority file and agent socket */          /* remote user's local Xauthority file and agent socket */
         if (xauthfile)          if (xauthfile)
                 xauthfile_cleanup_proc(NULL);                  xauthfile_cleanup_proc(authctxt->pw);
         if (auth_get_socket_name())          if (auth_get_socket_name())
                 auth_sock_cleanup_proc(NULL);                  auth_sock_cleanup_proc(authctxt->pw);
 }  }
   
 /*  /*
  * Remove local Xauthority file.   * Remove local Xauthority file.
  */   */
 void  void
 xauthfile_cleanup_proc(void *ignore)  xauthfile_cleanup_proc(void *_pw)
 {  {
         debug("xauthfile_cleanup_proc called");          struct passwd *pw = _pw;
           char *p;
   
           debug("xauthfile_cleanup_proc called");
         if (xauthfile != NULL) {          if (xauthfile != NULL) {
                 char *p;                  temporarily_use_uid(pw);
                 unlink(xauthfile);                  unlink(xauthfile);
                 p = strrchr(xauthfile, '/');                  p = strrchr(xauthfile, '/');
                 if (p != NULL) {                  if (p != NULL) {
Line 180 
Line 182 
                 }                  }
                 xfree(xauthfile);                  xfree(xauthfile);
                 xauthfile = NULL;                  xauthfile = NULL;
                   restore_uid();
         }          }
 }  }
   
Line 356 
Line 359 
                         if (fd >= 0)                          if (fd >= 0)
                                 close(fd);                                  close(fd);
                         restore_uid();                          restore_uid();
                         fatal_add_cleanup(xauthfile_cleanup_proc, NULL);                          fatal_add_cleanup(xauthfile_cleanup_proc, s->pw);
                         success = 1;                          success = 1;
                         break;                          break;
   
Line 1433 
Line 1436 
         if (fd >= 0)          if (fd >= 0)
                 close(fd);                  close(fd);
         restore_uid();          restore_uid();
         fatal_add_cleanup(xauthfile_cleanup_proc, s);          fatal_add_cleanup(xauthfile_cleanup_proc, s->pw);
         return 1;          return 1;
 }  }
   

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.80