Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions moto/awslambda/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ def zip2tar(zip_bytes: bytes) -> io.BytesIO:
tarinfo = tarfile.TarInfo(name=zipinfo.filename)
tarinfo.size = zipinfo.file_size
tarinfo.mtime = calendar.timegm(zipinfo.date_time) - timeshift
tarinfo.mode = zipinfo.external_attr >> 16
# Ensure minimum read bits for all users.
# Lambda extracts these files to /var/task and needs
# at least 0444 (read) for files and 0555 (read+execute) for dirs.
if zipinfo.is_dir():
tarinfo.mode |= 0o555
else:
tarinfo.mode |= 0o444
infile = zipf.open(zipinfo.filename)
tarf.addfile(tarinfo, infile)

Expand Down
Loading