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

Diff for /src/usr.bin/find/function.c between version 1.45 and 1.46

version 1.45, 2017/01/03 21:31:16 version 1.46, 2018/09/16 02:44:06
Line 933 
Line 933 
 c_group(char *gname, char ***ignored, int unused)  c_group(char *gname, char ***ignored, int unused)
 {  {
         PLAN *new;          PLAN *new;
         struct group *g;  
         gid_t gid;          gid_t gid;
   
         ftsoptions &= ~FTS_NOSTAT;          ftsoptions &= ~FTS_NOSTAT;
   
         g = getgrnam(gname);          if (gid_from_group(gname, &gid) == -1) {
         if (g == NULL) {  
                 const char *errstr;                  const char *errstr;
   
                 gid = strtonum(gname, 0, GID_MAX, &errstr);                  gid = strtonum(gname, 0, GID_MAX, &errstr);
                 if (errstr)                  if (errstr)
                         errx(1, "-group: %s: no such group", gname);                          errx(1, "-group: %s: no such group", gname);
         } else          }
                 gid = g->gr_gid;  
   
         new = palloc(N_GROUP, f_group);          new = palloc(N_GROUP, f_group);
         new->g_data = gid;          new->g_data = gid;
Line 1543 
Line 1540 
 c_user(char *username, char ***ignored, int unused)  c_user(char *username, char ***ignored, int unused)
 {  {
         PLAN *new;          PLAN *new;
         struct passwd *p;  
         uid_t uid;          uid_t uid;
   
         ftsoptions &= ~FTS_NOSTAT;          ftsoptions &= ~FTS_NOSTAT;
   
         p = getpwnam(username);          if (uid_from_user(username, &uid) == -1) {
         if (p == NULL) {  
                 const char *errstr;                  const char *errstr;
   
                 uid = strtonum(username, 0, UID_MAX, &errstr);                  uid = strtonum(username, 0, UID_MAX, &errstr);
                 if (errstr)                  if (errstr)
                         errx(1, "-user: %s: no such user", username);                          errx(1, "-user: %s: no such user", username);
         } else          }
                 uid = p->pw_uid;  
   
         new = palloc(N_USER, f_user);          new = palloc(N_USER, f_user);
         new->u_data = uid;          new->u_data = uid;

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