Skip to content

Commit

Permalink
ebuild.repository: fix traversal from root of overlays
Browse files Browse the repository at this point in the history
Resolves: pkgcore/pkgcheck#418
Signed-off-by: Arthur Zamarin <[email protected]>
  • Loading branch information
arthurzam committed Feb 4, 2023
1 parent c546811 commit cdcf8df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pkgcore/ebuild/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,10 @@ def path_restrict(self, path):
path_chunks = path.split(os.path.sep)
else:
path = os.path.realpath(os.path.abspath(path))
relpath = path[len(os.path.realpath(self.location)) :].strip("/")
path_chunks = relpath.split(os.path.sep)
if relpath := path[len(os.path.realpath(self.location)) :].strip("/"):
path_chunks = relpath.split(os.path.sep)
else:
path_chunks = ()

if os.path.isfile(path):
if not path.endswith(".ebuild"):
Expand Down

0 comments on commit cdcf8df

Please sign in to comment.