Skip to content

Commit

Permalink
make sure pattern is not going up dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmarshall committed Feb 17, 2024
1 parent ab37a01 commit feda106
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/util/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def get_pattern_tier(setup, tier, check_in_cycle=True):
else:
msg = "invalid tier"
raise Exception(msg)
if tier_path(setup) not in file_pattern and check_in_cycle is True:
if tier_path(setup) not in file_pattern and check_in_cycle is True and ".." not in file_pattern:
return "/tmp/{experiment}-{period}-{run}-{datatype}-{timestamp}" + f"tier_{tier}.lh5"
else:
return file_pattern
Expand Down Expand Up @@ -387,7 +387,7 @@ def get_pattern_pars(setup, tier, name=None, extension="json", check_in_cycle=Tr
else:
msg = "invalid tier"
raise Exception(msg)
if pars_path(setup) not in file_pattern and check_in_cycle is True:
if pars_path(setup) not in file_pattern and check_in_cycle is True and ".." not in file_pattern:
if name is None:
return "/tmp/{experiment}-{period}-{run}-cal-{timestamp}" + f"par_{tier}.{extension}"
else:
Expand Down

0 comments on commit feda106

Please sign in to comment.