Skip to content
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion cactus-engine/src/cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static std::string call_cloud_endpoint(const std::string& url,
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, std::min<long>(timeout_ms, 2000L));
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);

if (!env_flag_enabled("CACTUS_CLOUD_STRICT_SSL")) {
if (env_flag_enabled("CACTUS_CLOUD_INSECURE_SSL")) {
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
} else {
Expand Down
11 changes: 10 additions & 1 deletion python/cactus/convert/export/qdq.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,16 @@ def safe_extract_tar(tar_path: Path, out_dir: Path) -> None:
target = (out_dir / member.name).resolve()
if os.path.commonpath([str(out_resolved), str(target)]) != str(out_resolved):
raise RuntimeError(f"refusing unsafe tar member path: {member.name}")
tf.extractall(out_dir)
if member.issym() or member.islnk():
base = target.parent if member.issym() else out_dir
link_target = (base / member.linkname).resolve()
if os.path.commonpath([str(out_resolved), str(link_target)]) != str(out_resolved):
raise RuntimeError(f"refusing unsafe tar link target: {member.name} -> {member.linkname}")
# filter="data" only exists on Python >=3.10.12/3.11.4/3.12; link targets are validated above for older patches.
if hasattr(tarfile, "data_filter"):
tf.extractall(out_dir, filter="data")
else:
tf.extractall(out_dir)


def materialize_input(input_path: Path, tmp_dir: Path | None) -> tuple[Path, tempfile.TemporaryDirectory[str] | None]:
Expand Down
Loading