[issue9311] os.access can return bogus values when run as superuser
Garrett Cooper <yanegomi@gmail.com> added the comment: My initial analysis was incorrect after talking with the bash(1) folks. test(1) is doing things wrong too: case FILEX: /* XXX work around eaccess(2) false positives for superuser */ if (eaccess(nm, X_OK) != 0) return 0; if (S_ISDIR(s.st_mode) || geteuid() != 0) return 1; return (s.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0; So it looks like test(1) is broken as well (doesn't check for ACLs, or MAC info). Interesting why it's only implemented for X_OK though... Based on this analysis, I'd say that access(2) is broken on FreeBSD and needs to be fixed. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9311> _______________________________________
participants (1)
-
Garrett Cooper