Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dpdispatcher/contexts/hdfs_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
tgz_file_list = glob(os.path.join(self.local_root, "tmp/*_download.tar.gz"))
for tgz in tgz_file_list:
with tarfile.open(tgz, "r:gz") as tar:
for member in tar.getmembers():
member_path = os.path.join(gz_dir, member.name)
if os.path.isabs(member.name) or ".." in member.name:
raise ValueError(f"Illegal tar archive entry: {member.name}")

Check warning on line 150 in dpdispatcher/contexts/hdfs_context.py

View check run for this annotation

Codecov / codecov/patch

dpdispatcher/contexts/hdfs_context.py#L147-L150

Added lines #L147 - L150 were not covered by tests
tar.extractall(path=gz_dir)

for task in submission.belonging_tasks:
Expand Down
Loading