Check group membership correctly; ingroup() returns a truth value, not a gid.

PR bin/41995.
This commit is contained in:
dholland 2009-09-05 06:18:55 +00:00
parent aaa57659d5
commit 39ad663dea
1 changed files with 1 additions and 2 deletions

View File

@ -282,8 +282,7 @@ isaccessible (const char *file, const int mode)
omask |= S_IXOTH;
}
mask = sb.st_uid == uid ? umask : sb.st_gid == ingroup(sb.st_gid) ?
gmask : omask;
mask = sb.st_uid == uid ? umask : ingroup(sb.st_gid) ? gmask : omask;
if ((sb.st_mode & mask) == mask)
return true;
errno = EACCES;