Permalink
Browse files

In the os.open call to get the fd to check if the user specific build…

… directory

is in fact owned by another user - add the os.O_NOFOLLOW flag to not follow symbolic links.

Signed-off-by: David <db@d1b.org>
  • Loading branch information...
1 parent 61c444e commit dc3a359671944dc5c922004197e51cd48ecb8c5b @d1b d1b committed Nov 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 pip/locations.py
View
@@ -39,7 +39,7 @@ def _get_build_prefix():
except OSError:
file_uid = None
try:
- fd = os.open(path, os.O_RDONLY)
+ fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW)
file_uid = os.fstat(fd).st_uid
os.close(fd)
except OSError:

0 comments on commit dc3a359

Please sign in to comment.