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

Diff for /src/usr.bin/passwd/local_passwd.c between version 1.18 and 1.19

version 1.18, 2001/08/16 18:29:27 version 1.19, 2001/08/18 19:58:46
Line 70 
Line 70 
         sigset_t fullset;          sigset_t fullset;
         time_t period;          time_t period;
         int pfd, tfd = -1;          int pfd, tfd = -1;
           int secureonly = 0;
         char *s = NULL;          char *s = NULL;
   
         if (!(pw = getpwnam(uname))) {          if (!(pw = getpwnam(uname))) {
Line 96 
Line 97 
   
         /* Reset password change time based on login.conf. */          /* Reset password change time based on login.conf. */
         period = login_getcaptime(lc, "passwordtime", 0, 0);          period = login_getcaptime(lc, "passwordtime", 0, 0);
         if (period > 0)          if (period > 0) {
                 pw->pw_change = time(NULL) + period;                  pw->pw_change = time(NULL) + period;
         else          } else {
                 pw->pw_change = 0;                  /*
                    * If the pw change time is the same we only need
                    * to update the spwd.db file.
                    */
                   if (pw->pw_change != 0)
                           pw->pw_change = 0;
                   else
                           secureonly = 1;
           }
   
         /* Drop user's real uid and block all signals to avoid a DoS. */          /* Drop user's real uid and block all signals to avoid a DoS. */
         setuid(0);          setuid(0);
Line 152 
Line 161 
   
         /* Update master.passwd file and rebuild spwd.db. */          /* Update master.passwd file and rebuild spwd.db. */
         pw_copy(pfd, tfd, pw);          pw_copy(pfd, tfd, pw);
         if (pw_mkdb(uname, 1) < 0)          if (pw_mkdb(uname, secureonly) < 0)
                 pw_error((char *)NULL, 0, 1);                  pw_error(NULL, 0, 1);
   
         return(0);          return(0);
 }  }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19