Skip to content

Commit 1b1e935

Browse files
committed
linting fixes
1 parent e80c877 commit 1b1e935

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/networkcloud/azext_networkcloud/operations/custom_properties.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ def safe_extract(tar, path="."):
106106
for member in tar.getmembers():
107107
member_path = os.path.join(path, member.name)
108108
if not CustomActionProperties.is_within_directory(path, member_path):
109-
raise Exception(
110-
"Attempted Path Traversal in Tar File"
111-
) # pylint: disable=broad-exception-raised
109+
raise ValueError(
110+
f"Path traversal detected: {member_path} is outside target directory {path}"
111+
)
112112
tar.extractall(path)
113113

114114
# Custom handling of response will display the output head and the result_URL/result_ref

0 commit comments

Comments
 (0)