Unfortunately, the "euidaccess" function has a bug. It returns a different result than "open". I modified my program. I changed the list of supplemental groups to which the user belongs. "euidaccess" still works incorrectly, but the regular "open" correctly opens (or reports an error) the same file. So I gave up using "euidaccess" and (unfortunately) I have to open file to check what access right it has. Of course the files being checked have additional permissions set by ACL and this may be the problem.