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

tar function is breaking symlinks

    Details

    • Similar Issues:

      Description

      While debugging the shelve plugin I noticed that the tar function available in the FilePath class is not conserving the symlinks anymore. The shelve plugin is calling the archive function in FilePath:

      archive(final ArchiverFactory factory, OutputStream os, final DirScanner scanner) // factory use is TarArchiverFactory with no compression

       

      Both tar archiving function do not properly handle the symlinks to directory (but it works correctly for symlinks to files):

      * public int tar(OutputStream out, final String glob) -> uses a DirScanner.Glob (ant style FileSets) that follows the symlink, therefore creates a brand new directory in place of the symlink, not what we want for a tar archive.

      * public int tar(OutputStream out, FileFilter filter) -> uses a FileFilter wrapper which for some reasons doesn't redirect the symlink calls to the wrapped FileFilter

       

      Why this is important: this issue has been here for long, but a change made on 2.91 (see my comment below for Issue 2), made this appear more clearly.

       

        Attachments

          Issue Links

            Activity

            Hide
            brianjmurrell Brian J Murrell added a comment -

            This seems to have been In Review for for 5 months now.  Is it really in review or is it stalled for some reason?  Where is the PR?

            Show
            brianjmurrell Brian J Murrell added a comment - This seems to have been In Review for for 5 months now.  Is it really in review or is it stalled for some reason?  Where is the PR?
            Hide
            pierrebtz Pierre Beitz added a comment -

            Brian J Murrell Review is stalled, the changes are a bit touchy and would need to be reviewed/discussed with more people. PR is linked to the ticket: https://github.com/jenkinsci/jenkins/pull/3569

            Show
            pierrebtz Pierre Beitz added a comment - Brian J Murrell Review is stalled, the changes are a bit touchy and would need to be reviewed/discussed with more people. PR is linked to the ticket:  https://github.com/jenkinsci/jenkins/pull/3569
            Hide
            pierrebtz Pierre Beitz added a comment -

            As discussed in the associated PR this work will be superseded by https://issues.jenkins-ci.org/browse/JENKINS-37862.

            Show
            pierrebtz Pierre Beitz added a comment - As discussed in the associated PR  this work will be superseded by  https://issues.jenkins-ci.org/browse/JENKINS-37862 .
            Hide
            jglick Jesse Glick added a comment -

            Pierre Beitz the Shelve plugin could probably work around this issue by excluding known symlink filenames from its patternset.

            Show
            jglick Jesse Glick added a comment - Pierre Beitz the Shelve plugin could probably work around this issue by excluding known symlink filenames from its patternset.
            Hide
            pierrebtz Pierre Beitz added a comment -
            Show
            pierrebtz Pierre Beitz added a comment - Jesse Glick you're right. Added this in the plugin:  https://github.com/jenkinsci/shelve-project-plugin/pull/19

              People

              • Assignee:
                pierrebtz Pierre Beitz
                Reporter:
                pierrebtz Pierre Beitz
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: