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

Diff for /src/usr.bin/passwd/pwd_check.c between version 1.6 and 1.7

version 1.6, 2002/06/28 22:28:17 version 1.7, 2004/03/14 22:53:18
Line 87 
Line 87 
         int i, res, min_len;          int i, res, min_len;
         char *cp, option[LINE_MAX];          char *cp, option[LINE_MAX];
         int pipefds[2];          int pipefds[2];
           pid_t child;
   
         min_len = (int) login_getcapnum(lc, "minpasswordlen", 6, 6);          min_len = (int) login_getcapnum(lc, "minpasswordlen", 6, 6);
         if (min_len > 0 && strlen(password) < min_len) {          if (min_len > 0 && strlen(password) < min_len) {
Line 150 
Line 151 
                 goto out;                  goto out;
         }          }
   
         res = fork();          child = fork();
         if (res == 0) {          if (child == 0) {
                 char *argp[] = { "sh", "-c", NULL, NULL};                  char *argp[] = { "sh", "-c", NULL, NULL};
   
                 /* Drop privileges */                  /* Drop privileges */
Line 168 
Line 169 
                 if (execv(_PATH_BSHELL, argp) == -1)                  if (execv(_PATH_BSHELL, argp) == -1)
                         exit(1);                          exit(1);
                 /* NOT REACHED */                  /* NOT REACHED */
         } else if (res == -1) {          } else if (child == -1) {
                 warn("fork");                  warn("fork");
                 goto out;                  goto out;
         }          }
Line 179 
Line 180 
         close(pipefds[1]);          close(pipefds[1]);
   
         /* get the return value from the child */          /* get the return value from the child */
         wait(&res);          wait(&child);
         if (WIFEXITED(res) && WEXITSTATUS(res) == 0)          if (WIFEXITED(child) && WEXITSTATUS(child) == 0)
                 return (1);                  return (1);
   
  out:   out:
Line 190 
Line 191 
 }  }
   
 int  int
 pwd_gettries( struct passwd *pwd, login_cap_t *lc )  pwd_gettries(struct passwd *pwd, login_cap_t *lc)
 {  {
         char option[LINE_MAX];          char option[LINE_MAX];
         char *ep = option;          char *ep = option;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7