Fix test to account for GNO stat() giving only "owner" permission bits.

This commit is contained in:
Stephen Heumann 2014-12-04 12:22:52 -06:00
parent 2d16296748
commit a549af27ca
1 changed files with 5 additions and 0 deletions

View File

@ -590,10 +590,15 @@ static int test_eaccess(char *path, int mode)
return 0;
}
#ifndef __GNO__
if (st.st_uid == euid) /* owner */
mode <<= 6;
else if (is_a_group_member(st.st_gid))
mode <<= 3;
#else
/* GNO stat() only gives "owner" permissions (really applicable to anyone) */
mode <<= 6;
#endif
if (st.st_mode & mode)
return 0;