nose-devs/nose — Issue #379: [PATCH] Use os.stat to determine executable bit instead of broken os.access system call
Author: jpellerin
Created: 2011-12-14 16:09:33+00:00
State: open

What steps will reproduce the problem?

Method 1:
1. sudo nosetests nose/tests

Method 2:
1. su
2. nosetests nose/tests

What is the expected output?

Tests are run on all legitimate non-executable testcases.

What do you see instead?

It incorrectly detects the executable bit for the testcases.

What version of the product are you using? On what operating system?

FreeBSD 7.x - 9-CURRENT.

Please provide any additional information below.

This appears to be an item with POSIX that's broken by design (from http://www.opengroup.org/onlinepubs/000095399/functions/access.html )...

In early proposals, some inadequacies in the access() function led to the creation of an eaccess() function because:

1. Historical implementations of access() do not test file access correctly when the process' real user ID is superuser. In particular, they always return zero when testing execute permissions without regard to whether the file is executable.
2. The superuser has complete access to all files on a system. As a consequence, programs started by the superuser and switched to the effective user ID with lesser privileges cannot use access() to test their file access permissions.

However, the historical model of eaccess() does not resolve problem (1), so this volume of IEEE Std 1003.1-2001 now allows access() to behave in the desired way because several implementations have corrected the problem. It was also argued that problem (2) is more easily solved by using open(), chdir(), or one of the exec functions as appropriate and responding to the error, rather than creating a new function that would not be as reliable. Therefore, eaccess() is not included in this volume of IEEE Std 1003.1-2001.

Google Code Info:
Issue #: 351
Author: yaneg...@gmail.com
Created On: 2010-07-20T01:45:00.000Z
Closed On: