Skip to content

Commit

Permalink
Merge pull request #249 from matejak/extract_tar_8
Browse files Browse the repository at this point in the history
Make tar extraction safer on RHEL8
  • Loading branch information
jan-cerny authored Jul 18, 2023
2 parents e3e7804 + 6ac75d5 commit 77b3803
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions org_fedora_oscap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def extract_data(archive, out_dir, ensure_has_files=None):
raise ExtractionError(msg)

utils.ensure_dir_exists(out_dir)
zfile.extractall(path=out_dir)
zfile.extractall(path=out_dir, filter="data")
result = [utils.join_paths(out_dir, info.filename) for info in zfile.filelist]
zfile.close()
elif archive.endswith(".tar"):
Expand Down Expand Up @@ -418,7 +418,7 @@ def _extract_tarball(archive, out_dir, ensure_has_files, alg):
raise ExtractionError(msg)

utils.ensure_dir_exists(out_dir)
tfile.extractall(path=out_dir)
tfile.extractall(path=out_dir, filter="data")
result = [utils.join_paths(out_dir, member.path) for member in tfile.getmembers()]
tfile.close()

Expand Down

0 comments on commit 77b3803

Please sign in to comment.