imbajin commented on code in PR #784:
URL: 
https://github.com/apache/hugegraph-toolchain/pull/784#discussion_r4213962147


##########
hugegraph-hubble/hubble-dist/assembly/travis/run_live_hubble_smoke.py:
##########
@@ -122,12 +122,17 @@ def assert_safe_tar_member(member, work_dir):
             raise RuntimeError(f"Unsafe tar link outside work dir: 
{member.name}")
 
 
-def extract_tarball(tarball, work_dir):
-    with tarfile.open(tarball, "r:gz") as archive:
+def extract_archive(tarball, work_dir):
+    with tarfile.open(tarball) as archive:
         members = archive.getmembers()
         for member in members:
             assert_safe_tar_member(member, work_dir)
-        archive.extractall(work_dir, members)
+        # Recheck each member against links already written during extraction.
+        archive.extractall(work_dir, members, filter="data")

Review Comment:
   Fixed with a tarfile.data_filter capability check before archive 
preparation. Unsupported Python versions receive an explicit upgrade message; 
extraction still requires filter=data, with no unsafe fallback. Added 
regression cases to the existing test file; local tests were not run.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to