- /* get new uid/groups each time, they may have changed */
- if (getuid() == p->statb.st_uid) {
- if (!(p->statb.st_mode&S_IRUSR))
- return(FTS_DNR);
- if (!(p->statb.st_mode&S_IXUSR))
- return(FTS_DNX);
- return(FTS_D);
- }
- if ((ngroups = getgroups(NGROUPS, gidset)) == -1)
- return(FTS_ERR);
- for (gp = gidset; ngroups--;)
- if (*gp++ == p->statb.st_gid) {
- if (!(p->statb.st_mode&S_IRGRP))
- return(FTS_DNR);
- if (!(p->statb.st_mode&S_IXGRP))
- return(FTS_DNX);
- return(FTS_D);
- }
- if (!(p->statb.st_mode&S_IROTH))
- return(FTS_DNR);
- if (!(p->statb.st_mode&S_IXOTH))
- return(FTS_DNX);