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

Diff for /src/usr.bin/login/login.c between version 1.70.4.1 and 1.71

version 1.70.4.1, 2019/12/04 09:51:49 version 1.71, 2019/06/28 13:35:01
Line 161 
Line 161 
         backoff = 3;          backoff = 3;
   
         domain = NULL;          domain = NULL;
         if (gethostname(localhost, sizeof(localhost)) < 0) {          if (gethostname(localhost, sizeof(localhost)) == -1) {
                 syslog(LOG_ERR, "couldn't get local hostname: %m");                  syslog(LOG_ERR, "couldn't get local hostname: %m");
                 strlcpy(localhost, "localhost", sizeof(localhost));                  strlcpy(localhost, "localhost", sizeof(localhost));
         } else if ((domain = strchr(localhost, '.'))) {          } else if ((domain = strchr(localhost, '.'))) {
Line 303 
Line 303 
         /*          /*
          * Since login deals with sensitive information, turn off coredumps.           * Since login deals with sensitive information, turn off coredumps.
          */           */
         if (getrlimit(RLIMIT_CORE, &scds) < 0) {          if (getrlimit(RLIMIT_CORE, &scds) == -1) {
                 syslog(LOG_ERR, "couldn't get core dump size: %m");                  syslog(LOG_ERR, "couldn't get core dump size: %m");
                 scds.rlim_cur = scds.rlim_max = QUAD_MIN;                  scds.rlim_cur = scds.rlim_max = QUAD_MIN;
         }          }
         cds.rlim_cur = cds.rlim_max = 0;          cds.rlim_cur = cds.rlim_max = 0;
         if (setrlimit(RLIMIT_CORE, &cds) < 0) {          if (setrlimit(RLIMIT_CORE, &cds) == -1) {
                 syslog(LOG_ERR, "couldn't set core dump size to 0: %m");                  syslog(LOG_ERR, "couldn't set core dump size to 0: %m");
                 scds.rlim_cur = scds.rlim_max = QUAD_MIN;                  scds.rlim_cur = scds.rlim_max = QUAD_MIN;
         }          }
Line 340 
Line 340 
                 }                  }
                 shell = strrchr(script, '/') + 1;                  shell = strrchr(script, '/') + 1;
                 auth_setstate(as, AUTH_OKAY);                  auth_setstate(as, AUTH_OKAY);
                 if (fflag) {                  auth_call(as, script, shell,
                         auth_call(as, script, shell, "-f", "--", username,                      fflag ? "-f" : username, fflag ? username : 0, (char *)0);
                             (char *)NULL);  
                 } else {  
                         auth_call(as, script, shell, "--", username,  
                             (char *)NULL);  
                 }  
                 if (!(auth_getstate(as) & AUTH_ALLOW))                  if (!(auth_getstate(as) & AUTH_ALLOW))
                         quickexit(1);                          quickexit(1);
                 auth_setenv(as);                  auth_setenv(as);
Line 372 
Line 367 
         }          }
   
         /*          /*
          * Request that things like the approval script print things           * Request the things like the approval script print things
          * to stdout (in particular, the nologins files)           * to stdout (in particular, the nologins files)
          */           */
         auth_setitem(as, AUTHV_INTERACTIVE, "True");          auth_setitem(as, AUTHV_INTERACTIVE, "True");
Line 703 
Line 698 
             p + 1 : shell, sizeof(tbuf) - 1);              p + 1 : shell, sizeof(tbuf) - 1);
   
         if ((scds.rlim_cur != QUAD_MIN || scds.rlim_max != QUAD_MIN) &&          if ((scds.rlim_cur != QUAD_MIN || scds.rlim_max != QUAD_MIN) &&
             setrlimit(RLIMIT_CORE, &scds) < 0)              setrlimit(RLIMIT_CORE, &scds) == -1)
                 syslog(LOG_ERR, "couldn't reset core dump size: %m");                  syslog(LOG_ERR, "couldn't reset core dump size: %m");
   
         if (lastchance)          if (lastchance)
Line 800 
Line 795 
   
         motd = login_getcapstr(lc, "welcome", _PATH_MOTDFILE, _PATH_MOTDFILE);          motd = login_getcapstr(lc, "welcome", _PATH_MOTDFILE, _PATH_MOTDFILE);
   
         if ((fd = open(motd, O_RDONLY, 0)) < 0)          if ((fd = open(motd, O_RDONLY, 0)) == -1)
                 return;                  return;
   
         memset(&sa, 0, sizeof(sa));          memset(&sa, 0, sizeof(sa));

Legend:
Removed from v.1.70.4.1  
changed lines
  Added in v.1.71