-
Notifications
You must be signed in to change notification settings - Fork 280
Closed
Labels
Milestone
Description
In path_in_confined_paths(), what is the reason for the following?
# Get the directory name (i.e., strip off the file_path+extension)
directory_name = os.path.dirname(test_path)
if directory_name == os.path.dirname(pattern):
return True
I've mentioned this issue before. This is where a relative path
'test_path' is checked against a 'confined_paths'. The paths are
stripped, and only the directories are compared. What is the reason
behind this?
So, if the 'test_path' is 'a/c.txt' and a confined path is
'/a/b/c.txt' (given c.txt's are the same) it's a no go. They'll
match only when test_path = 'a/b/c.txt' and a confined path =
'/a/b/c.txt'.
I, probably, should have said: a path in the list of the confined
paths instead of a "confined path", to be more clear.