Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51303

unzip step doesn't set permissions on extracted files

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Run this pipeline:

      node() {
          // create an example ZIP file
          sh '''\
              base64 -d > test.zip << EOF
              UEsDBAoAAAAAAJ2SrkwAAAAAAAAAAAAAAAAIABwAdGVzdC5iaW5VVAkAA1qp+VpaqfladXgLAAEE
              6AMAAAToAwAAUEsBAh4DCgAAAAAAnZKuTAAAAAAAAAAAAAAAAAgAGAAAAAAAAAAAAP2BAAAAAHRl
              c3QuYmluVVQFAANaqfladXgLAAEE6AMAAAToAwAAUEsFBgAAAAABAAEATgAAAEIAAAAAAA==
              EOF'''.stripIndent()
          sh 'unzip -o test.zip && ls -l test.bin && rm test.bin'
          unzip zipFile: 'test.zip', quiet: true
          sh 'ls -l test.bin'
      }
      

      The (relevant) output is:

      + ls -l test.bin
      -rwxrwxr-x 1 jenkins jenkins 0 May 14 15:20 test.bin
      ...
      + ls -l test.bin
      -rw-r--r-- 1 jenkins jenkins 0 May 14 15:51 test.bin
      

      You can see that the native unzip program extracts the file with the permissions it actually has in the archive (775), while the unzip step extracts it with default permissions (644).

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            rsandell rsandell
            Reporter:
            rdonchen_intel Roman Donchenko
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: