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

Diff for /src/usr.bin/ssh/auth.c between version 1.137 and 1.138

version 1.137, 2019/01/19 21:37:48 version 1.138, 2019/01/19 21:41:18
Line 65 
Line 65 
 #include "compat.h"  #include "compat.h"
 #include "channels.h"  #include "channels.h"
   
 #include "opacket.h" /* XXX */  
 extern struct ssh *active_state; /* XXX */  
   
 /* import */  /* import */
 extern ServerOptions options;  extern ServerOptions options;
 extern int use_privsep;  extern int use_privsep;
Line 86 
Line 83 
  * Otherwise true is returned.   * Otherwise true is returned.
  */   */
 int  int
 allowed_user(struct passwd * pw)  allowed_user(struct ssh *ssh, struct passwd * pw)
 {  {
         struct ssh *ssh = active_state; /* XXX */  
         struct stat st;          struct stat st;
         const char *hostname = NULL, *ipaddr = NULL;          const char *hostname = NULL, *ipaddr = NULL;
         int r;          int r;
Line 242 
Line 238 
 }  }
   
 void  void
 auth_log(Authctxt *authctxt, int authenticated, int partial,  auth_log(struct ssh *ssh, int authenticated, int partial,
     const char *method, const char *submethod)      const char *method, const char *submethod)
 {  {
         struct ssh *ssh = active_state; /* XXX */          Authctxt *authctxt = (Authctxt *)ssh->authctxt;
         int level = SYSLOG_LEVEL_VERBOSE;          int level = SYSLOG_LEVEL_VERBOSE;
         const char *authmsg;          const char *authmsg;
         char *extra = NULL;          char *extra = NULL;
Line 287 
Line 283 
 }  }
   
 void  void
 auth_maxtries_exceeded(Authctxt *authctxt)  auth_maxtries_exceeded(struct ssh *ssh)
 {  {
         struct ssh *ssh = active_state; /* XXX */          Authctxt *authctxt = (Authctxt *)ssh->authctxt;
   
         error("maximum authentication attempts exceeded for "          error("maximum authentication attempts exceeded for "
             "%s%.100s from %.200s port %d ssh2",              "%s%.100s from %.200s port %d ssh2",
Line 297 
Line 293 
             authctxt->user,              authctxt->user,
             ssh_remote_ipaddr(ssh),              ssh_remote_ipaddr(ssh),
             ssh_remote_port(ssh));              ssh_remote_port(ssh));
         packet_disconnect("Too many authentication failures");          ssh_packet_disconnect(ssh, "Too many authentication failures");
         /* NOTREACHED */          /* NOTREACHED */
 }  }
   
Line 472 
Line 468 
 }  }
   
 struct passwd *  struct passwd *
 getpwnamallow(const char *user)  getpwnamallow(struct ssh *ssh, const char *user)
 {  {
         struct ssh *ssh = active_state; /* XXX */  
         extern login_cap_t *lc;          extern login_cap_t *lc;
         auth_session_t *as;          auth_session_t *as;
         struct passwd *pw;          struct passwd *pw;
Line 492 
Line 487 
                     user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));                      user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));
                 return (NULL);                  return (NULL);
         }          }
         if (!allowed_user(pw))          if (!allowed_user(ssh, pw))
                 return (NULL);                  return (NULL);
         if ((lc = login_getclass(pw->pw_class)) == NULL) {          if ((lc = login_getclass(pw->pw_class)) == NULL) {
                 debug("unable to get login class: %s", user);                  debug("unable to get login class: %s", user);
Line 567 
Line 562 
 }  }
   
 void  void
 auth_debug_send(void)  auth_debug_send(struct ssh *ssh)
 {  {
         struct ssh *ssh = active_state;         /* XXX */  
         char *msg;          char *msg;
         int r;          int r;
   

Legend:
Removed from v.1.137  
changed lines
  Added in v.1.138