forked from platformio/platformio-core
Temporary disable security checking for Tar items
This commit is contained in:
@ -73,19 +73,19 @@ class TARArchive(ArchiveBase):
|
||||
base=self.resolve_path(os.path.join(base, os.path.dirname(tarinfo.name))),
|
||||
)
|
||||
|
||||
def extract_item(self, item, dest_dir):
|
||||
bad_conds = [
|
||||
self.is_link(item) and self.is_bad_link(item, dest_dir),
|
||||
not self.is_link(item) and self.is_bad_path(item.name, dest_dir),
|
||||
]
|
||||
if not any(bad_conds):
|
||||
super(TARArchive, self).extract_item(item, dest_dir)
|
||||
else:
|
||||
click.secho(
|
||||
"Blocked insecure item `%s` from archive" % item.name,
|
||||
fg="red",
|
||||
err=True,
|
||||
)
|
||||
# def extract_item(self, item, dest_dir):
|
||||
# bad_conds = [
|
||||
# self.is_link(item) and self.is_bad_link(item, dest_dir),
|
||||
# not self.is_link(item) and self.is_bad_path(item.name, dest_dir),
|
||||
# ]
|
||||
# if not any(bad_conds):
|
||||
# super(TARArchive, self).extract_item(item, dest_dir)
|
||||
# else:
|
||||
# click.secho(
|
||||
# "Blocked insecure item `%s` from archive" % item.name,
|
||||
# fg="red",
|
||||
# err=True,
|
||||
# )
|
||||
|
||||
|
||||
class ZIPArchive(ArchiveBase):
|
||||
|
Reference in New Issue
Block a user