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))),
|
base=self.resolve_path(os.path.join(base, os.path.dirname(tarinfo.name))),
|
||||||
)
|
)
|
||||||
|
|
||||||
def extract_item(self, item, dest_dir):
|
# def extract_item(self, item, dest_dir):
|
||||||
bad_conds = [
|
# bad_conds = [
|
||||||
self.is_link(item) and self.is_bad_link(item, dest_dir),
|
# 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),
|
# not self.is_link(item) and self.is_bad_path(item.name, dest_dir),
|
||||||
]
|
# ]
|
||||||
if not any(bad_conds):
|
# if not any(bad_conds):
|
||||||
super(TARArchive, self).extract_item(item, dest_dir)
|
# super(TARArchive, self).extract_item(item, dest_dir)
|
||||||
else:
|
# else:
|
||||||
click.secho(
|
# click.secho(
|
||||||
"Blocked insecure item `%s` from archive" % item.name,
|
# "Blocked insecure item `%s` from archive" % item.name,
|
||||||
fg="red",
|
# fg="red",
|
||||||
err=True,
|
# err=True,
|
||||||
)
|
# )
|
||||||
|
|
||||||
|
|
||||||
class ZIPArchive(ArchiveBase):
|
class ZIPArchive(ArchiveBase):
|
||||||
|
Reference in New Issue
Block a user