2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 11:57:37 +00:00

Correct fd used in libarchive

Actually use the cloned file descriptors
This commit is contained in:
Jarrod Johnson 2021-03-04 08:43:17 -05:00
parent ce92ea4084
commit d08ce9e563

View File

@ -228,7 +228,7 @@ def extract_file(archfile, flags=0, callback=lambda x: None, imginfo=(), extract
dfd = os.dup(archfile.fileno())
os.lseek(dfd, 0, 0)
try:
with libarchive.fd_reader(archfile.fileno()) as archive:
with libarchive.fd_reader(dfd) as archive:
extract_entries(archive, flags, callback, totalsize, extractlist)
finally:
os.close(dfd)
@ -451,7 +451,7 @@ def scan_iso(archive):
dfd = os.dup(archive.fileno())
os.lseek(dfd, 0, 0)
try:
with libarchive.fd_reader(archive.fileno()) as reader:
with libarchive.fd_reader(dfd) as reader:
for ent in reader:
if str(ent).endswith('TRANS.TBL'):
continue