(directory, target)
| 771 | resolved_archive_file, tempdir)) |
| 772 | with tarfile.open(resolved_archive_file, 'r:gz') as archive: |
| 773 | def is_within_directory(directory, target): |
| 774 | |
| 775 | abs_directory = os.path.abspath(directory) |
| 776 | abs_target = os.path.abspath(target) |
| 777 | |
| 778 | prefix = os.path.commonprefix([abs_directory, abs_target]) |
| 779 | |
| 780 | return prefix == abs_directory |
| 781 | |
| 782 | def safe_extract(tar, path=".", members=None, *, numeric_owner=False): |
| 783 |
nothing calls this directly
no outgoing calls
no test coverage detected