[Python-Dev] cpython (3.2): Issue #11956: Skip test_import.test_unwritable_directory on FreeBSD when run as

Cameron Simpson cs at zip.com.au
Thu Oct 6 01:55:07 CEST 2011


On 04Oct2011 20:44, Charles-Fran�ois Natali <cf.natali at gmail.com> wrote:
| >> summary:
| >>   Issue #11956: Skip test_import.test_unwritable_directory on FreeBSD when
| >>
| >>   run as
| >> root (directory permissions are ignored).
| >
| > The same directory permission semantics apply to other (all?)
| > BSD-derived systems, not just FreeBSD.  For example, the test still
| > fails in the same way on OS X when run via sudo.
| >
| 
| Thanks, I didn't know: I only noticed this on the FreeBSD buildbots (I
| guess OS-X buildbots don't run as root). Note that it does behave as
| "expected" on Linux (note the use of quotation marks, I'm not sure
| whether this behavior is authorized by POSIX).
| I changed the test to skip when the effective UID is 0, regardless of
| the OS, to stay on the safe side.

I'd have expect this test to fail on _any_ UNIX system if run as root.
Root's allowed to write to stuff! Any stuff! About the only permission
with any effect on root is the eXecute bit for the exec call, to prevent
blindly running random data files.

Equally, why on earth are you running tests as root!?!?!?!?! Madness.
It's as bad as compiling stuff as root etc etc. A bad idea all around,
securitywise.

Especially, I would think, a builtbot. "Oh, let's fetch some shiny new
code and run it as the system superuser."

I know this post sounds shouty, but I've just reread it a few times and
still cannot bring myself to tone it down.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

If he's not one thing, he's another.    - Buckaroo Banzai


More information about the Python-Dev mailing list