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

Diff for /src/usr.bin/ssh/auth-passwd.c between version 1.46 and 1.47

version 1.46, 2018/03/03 03:15:51 version 1.47, 2018/07/09 21:26:02
Line 45 
Line 45 
 #include <stdarg.h>  #include <stdarg.h>
   
 #include "packet.h"  #include "packet.h"
 #include "buffer.h"  #include "sshbuf.h"
   #include "ssherr.h"
 #include "log.h"  #include "log.h"
 #include "misc.h"  #include "misc.h"
 #include "servconf.h"  #include "servconf.h"
 #include "key.h"  #include "sshkey.h"
 #include "hostfile.h"  #include "hostfile.h"
 #include "auth.h"  #include "auth.h"
 #include "auth-options.h"  #include "auth-options.h"
   
 extern Buffer loginmsg;  extern struct sshbuf *loginmsg;
 extern ServerOptions options;  extern ServerOptions options;
 int sys_auth_passwd(struct ssh *, const char *);  int sys_auth_passwd(struct ssh *, const char *);
   
Line 97 
Line 98 
 static void  static void
 warn_expiry(Authctxt *authctxt, auth_session_t *as)  warn_expiry(Authctxt *authctxt, auth_session_t *as)
 {  {
         char buf[256];          int r;
         quad_t pwtimeleft, actimeleft, daysleft, pwwarntime, acwarntime;          quad_t pwtimeleft, actimeleft, daysleft, pwwarntime, acwarntime;
   
         pwwarntime = acwarntime = TWO_WEEKS;          pwwarntime = acwarntime = TWO_WEEKS;
Line 112 
Line 113 
         }          }
         if (pwtimeleft != 0 && pwtimeleft < pwwarntime) {          if (pwtimeleft != 0 && pwtimeleft < pwwarntime) {
                 daysleft = pwtimeleft / DAY + 1;                  daysleft = pwtimeleft / DAY + 1;
                 snprintf(buf, sizeof(buf),                  if ((r = sshbuf_putf(loginmsg,
                     "Your password will expire in %lld day%s.\n",                      "Your password will expire in %lld day%s.\n",
                     daysleft, daysleft == 1 ? "" : "s");                      daysleft, daysleft == 1 ? "" : "s")) != 0)
                 buffer_append(&loginmsg, buf, strlen(buf));                          fatal("%s: buffer error: %s", __func__, ssh_err(r));
         }          }
         if (actimeleft != 0 && actimeleft < acwarntime) {          if (actimeleft != 0 && actimeleft < acwarntime) {
                 daysleft = actimeleft / DAY + 1;                  daysleft = actimeleft / DAY + 1;
                 snprintf(buf, sizeof(buf),                  if ((r = sshbuf_putf(loginmsg,
                     "Your account will expire in %lld day%s.\n",                      "Your account will expire in %lld day%s.\n",
                     daysleft, daysleft == 1 ? "" : "s");                      daysleft, daysleft == 1 ? "" : "s")) != 0)
                 buffer_append(&loginmsg, buf, strlen(buf));                          fatal("%s: buffer error: %s", __func__, ssh_err(r));
         }          }
 }  }
   

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47