[ python-Bugs-1117601 ] os.path.exists returns false negatives in MAC environments.

SourceForge.net noreply at sourceforge.net
Wed Feb 16 21:26:21 CET 2005


Bugs item #1117601, was opened at 2005-02-06 19:57
Message generated for change (Comment added) made by tjreedy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1117601&group_id=5470

Category: Python Library
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Stephen Bennett (sbennett)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.path.exists returns false negatives in MAC environments.

Initial Comment:
In Mandatory Access Control environments (such as
SELinux), it's quite possible for stat to fail with
permission denied. In this case, os.path.exists will
return False incorrectly. The simple(ish) fix is to
check for an access denied error (which would indicate
present, but not readable) when using stat to check for
existence of files.

----------------------------------------------------------------------

Comment By: Terry J. Reedy (tjreedy)
Date: 2005-02-16 15:26

Message:
Logged In: YES 
user_id=593130

Does 'access denied' always mean 'present but not readable' 
in every environment that gives such messages?  I ask 
because I have vague memories of wasting time trying to 
get access to something that did not exist, because access 
denied (or something like that) meant that I was denied 
access even to info about whether it existed or not.

In any case, a reproducible example would help someone to 
verify, fix, and write a test case for this if it is deemed to be 
a fixable bug.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1117601&group_id=5470


More information about the Python-bugs-list mailing list