Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process.open_files() on Linux might swallow AccessDenied #571

Closed
giampaolo opened this issue Jan 3, 2015 · 0 comments
Closed

Process.open_files() on Linux might swallow AccessDenied #571

giampaolo opened this issue Jan 3, 2015 · 0 comments

Comments

@giampaolo
Copy link
Owner

...that's because we pre emptively use os.path.islink() which might return False in case we don't have the permission to perform os.stat() against the designated path:

if os.path.islink(file):

Instead we should just call os.readlink() directly and "continue" in case of EINVAL (meaning the path is not a link).
By swallowing AD the function may indirectly return an incomplete list of open files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant