pombreda / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

[PATCH] Use os.stat to determine executable bit instead of broken os.access system call #351

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by yaneg...@gmail.com on 20 Jul 2010 at 1:45

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by jpelle...@gmail.com on 20 Jul 2010 at 1:14

GoogleCodeExporter commented 9 years ago
Linked in github issue https://github.com/nose-devs/nose/issues/379 closing here

Original comment by jpelle...@gmail.com on 16 Dec 2011 at 3:36