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

Stash and archive should refuse symlinks

    XMLWordPrintable

Details

    Description

      Stash and archive should follow symlinks. Otherwise a symlink that the pipeline tries to archive is broken, a broken symlink is unstashed, unarchived or copied from another job, an error should be thrown.

      Attachments

        Issue Links

          Activity

            jglick Jesse Glick added a comment -

            Presence of symlinks or other special files in the input should just be treated as an error.

            jglick Jesse Glick added a comment - Presence of symlinks or other special files in the input should just be treated as an error.
            oesolutions Chris Dore added a comment -

            jglick why should a symlink be an error?

            Since symlinks are not preserved, we abandoned using stash and instead we are now allocating a node for the entire pipeline, even when that node could be released back to the pool during certain stages. I would love to revisit our workaround and improve node utilization, having stash handle symlinks would make this very easy. Are there other alternative ideas to allow a pipeline to save state containing symlinks across stages on different nodes/workspaces?

            oesolutions Chris Dore added a comment - jglick why should a symlink be an error? Since symlinks are not preserved, we abandoned using stash and instead we are now allocating a node for the entire pipeline, even when that node could be released back to the pool during certain stages. I would love to revisit our workaround and improve node utilization, having stash handle symlinks would make this very easy. Are there other alternative ideas to allow a pipeline to save state containing symlinks across stages on different nodes/workspaces?
            jglick Jesse Glick added a comment -

            Use tar and decide in your script which options to pass to get the desired behavior: preserving symlinks, preserving other special files, preserving owner, preserving mode, etc.

            jglick Jesse Glick added a comment - Use tar and decide in your script which options to pass to get the desired behavior: preserving symlinks, preserving other special files, preserving owner, preserving mode, etc.
            jielpe_fr38 Jean-Luc Pé added a comment -

            I am facing the same issue I also consider as a bug.
            And I really do not understand why I should have to tar before stash and untar after unstash just because stash does not manage symlinks.
            For the best, an option "keep symlink target" should be available. If set, stash should save both the symlink and the target. And if the target is a directory, its content should also be saved. IMHO, the default value for this option should be true. Just because I do not see any good reason to save some sort of hollow shell.

            jielpe_fr38 Jean-Luc Pé added a comment - I am facing the same issue I also consider as a bug. And I really do not understand why I should have to tar before stash and untar after unstash just because stash does not manage symlinks. For the best, an option "keep symlink target" should be available. If set, stash should save both the symlink and the target. And if the target is a directory, its content should also be saved. IMHO, the default value for this option should be true. Just because I do not see any good reason to save some sort of hollow shell.

            People

              Unassigned Unassigned
              neothethird Jan Sprinz
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: