Skip to content

ZipArchive permissions on linux #17912

@chris-mackubin

Description

@chris-mackubin

ZipArchive doesn't currently allow manipulation permissions within. I ran into this when creating file in memory, dropping it into a zip and handing off to another system. With this code deployed on Linux, I'm not seeing a way to give the receiving system read access to contents of zip.

Example:

    using (var memoryStream = new MemoryStream())
    {
        using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, true))
        {
            var lambdaFile = archive.CreateEntry("index.js");

            using (var entryStream = lambdaFile.Open())
            using (var streamWriter = new StreamWriter(entryStream))
            {
                streamWriter.Write(functionContent);
            }
        }

        memoryStream.Seek(0, SeekOrigin.Begin);
        svcFile.UploadFile(bucketName, s3Key, memoryStream);
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions