=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/find/function.c,v retrieving revision 1.45 retrieving revision 1.46 diff -c -r1.45 -r1.46 *** src/usr.bin/find/function.c 2017/01/03 21:31:16 1.45 --- src/usr.bin/find/function.c 2018/09/16 02:44:06 1.46 *************** *** 1,4 **** ! /* $OpenBSD: function.c,v 1.45 2017/01/03 21:31:16 tedu Exp $ */ /*- * Copyright (c) 1990, 1993 --- 1,4 ---- ! /* $OpenBSD: function.c,v 1.46 2018/09/16 02:44:06 millert Exp $ */ /*- * Copyright (c) 1990, 1993 *************** *** 933,952 **** c_group(char *gname, char ***ignored, int unused) { PLAN *new; - struct group *g; gid_t gid; ftsoptions &= ~FTS_NOSTAT; ! g = getgrnam(gname); ! if (g == NULL) { const char *errstr; gid = strtonum(gname, 0, GID_MAX, &errstr); if (errstr) errx(1, "-group: %s: no such group", gname); ! } else ! gid = g->gr_gid; new = palloc(N_GROUP, f_group); new->g_data = gid; --- 933,949 ---- c_group(char *gname, char ***ignored, int unused) { PLAN *new; gid_t gid; ftsoptions &= ~FTS_NOSTAT; ! if (gid_from_group(gname, &gid) == -1) { const char *errstr; gid = strtonum(gname, 0, GID_MAX, &errstr); if (errstr) errx(1, "-group: %s: no such group", gname); ! } new = palloc(N_GROUP, f_group); new->g_data = gid; *************** *** 1543,1562 **** c_user(char *username, char ***ignored, int unused) { PLAN *new; - struct passwd *p; uid_t uid; ftsoptions &= ~FTS_NOSTAT; ! p = getpwnam(username); ! if (p == NULL) { const char *errstr; uid = strtonum(username, 0, UID_MAX, &errstr); if (errstr) errx(1, "-user: %s: no such user", username); ! } else ! uid = p->pw_uid; new = palloc(N_USER, f_user); new->u_data = uid; --- 1540,1556 ---- c_user(char *username, char ***ignored, int unused) { PLAN *new; uid_t uid; ftsoptions &= ~FTS_NOSTAT; ! if (uid_from_user(username, &uid) == -1) { const char *errstr; uid = strtonum(username, 0, UID_MAX, &errstr); if (errstr) errx(1, "-user: %s: no such user", username); ! } new = palloc(N_USER, f_user); new->u_data = uid;