Skip to content

Update utils.py for proper execution of the archive module #681

Description

@victor5lm

Currently, the code for service folder decompression is outdated:

def uncompress_targz_directory(tar_name, directory):
"""
Untar GZ file
"""
with tarfile.open(tar_name) as out_tar:
out_tar.extractall("/".join(directory.split("/")[:-1]))
return

This should be changed by:
out_tar.extractall("/".join(directory.split("/")[:-1]), filter="fully_trusted").

Plus, fix this:

f"find {copied_folder_path} -type d -exec chmod {permissions_config['directory_chmod']} {{}} \;",

by adding an extra reverse slash.
And the same for:
f"find {copied_folder_path} -type f -exec chmod {permissions_config['file_chmod']} {{}} \;",

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions