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

Diff for /src/usr.bin/finger/finger.c between version 1.24 and 1.25

version 1.24, 2015/10/18 03:54:22 version 1.25, 2015/10/26 16:57:13
Line 130 
Line 130 
                 err(1, "pledge");                  err(1, "pledge");
   
         (void)time(&now);          (void)time(&now);
         setpassent(1);  
         if (!*argv) {          if (!*argv) {
                 /*                  /*
                  * Assign explicit "small" format if no names given and -l                   * Assign explicit "small" format if no names given and -l
Line 174 
Line 173 
         if (!freopen(_PATH_UTMP, "r", stdin))          if (!freopen(_PATH_UTMP, "r", stdin))
                 err(2, _PATH_UTMP);                  err(2, _PATH_UTMP);
         name[UT_NAMESIZE] = '\0';          name[UT_NAMESIZE] = '\0';
           setpassent(1);
         while (fread((char *)&user, sizeof(user), 1, stdin) == 1) {          while (fread((char *)&user, sizeof(user), 1, stdin) == 1) {
                 if (!user.ut_name[0])                  if (!user.ut_name[0])
                         continue;                          continue;
Line 185 
Line 185 
                 }                  }
                 enter_where(&user, pn);                  enter_where(&user, pn);
         }          }
           endpwent();
         for (pn = phead; lflag && pn != NULL; pn = pn->next)          for (pn = phead; lflag && pn != NULL; pn = pn->next)
                 enter_lastlog(pn);                  enter_lastlog(pn);
 }  }
Line 227 
Line 228 
          * traverse the list of possible login names and check the login name           * traverse the list of possible login names and check the login name
          * and real name against the name specified by the user.           * and real name against the name specified by the user.
          */           */
           setpassent(1);
         if ((mflag - Mflag) > 0) {          if ((mflag - Mflag) > 0) {
                 for (i = 0; i < argc; i++)                  for (i = 0; i < argc; i++)
                         if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {                          if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
Line 241 
Line 243 
                                 enter_person(pw);                                  enter_person(pw);
                                 used[i] = 1;                                  used[i] = 1;
                         }                          }
           endpwent();
   
         /* list errors */          /* list errors */
         for (i = 0; i < argc; i++)          for (i = 0; i < argc; i++)

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25