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

SecretRewriter.rewriteRecursive fails to resolve symbolic links on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Jenkins 1.611
      JDK 1.7.0_45
      Windows 8 (64 bits)

      SecretRewriter.rewriteRecursive fails to detect cyclic paths on Windows as File#getCanonicalPath doesn't resolve symbolic links. Resolving symbolic links are performed only on *nix systems.
      http://docs.oracle.com/javase/6/docs/api/java/io/File.html#getCanonicalPath%28%29

      More worse, SecretRewriterTest#recursionDetection doesn't finish on Windows like this:

      Running hudson.util.SecretRewriterTest
      Scanning C:\workspace\jenkins\core\target\junit4449490825533171592\t\a\foo.xml
      Copied C:\workspace\jenkins\core\target\junit4449490825533171592\t\a\foo.xml to C:\workspace\jenkins\core\target\junit4449490825533171592\backup\a\foo.xml as a backup
      Rewritten C:\workspace\jenkins\core\target\junit4449490825533171592\t\a\foo.xml
      Copied C:\workspace\jenkins\core\target\junit4449490825533171592\t\a\symlink\foo.xml to C:\workspace\jenkins\core\target\junit4449490825533171592\backup\a\symlink\foo.xml as a backup
      Rewritten C:\workspace\jenkins\core\target\junit4449490825533171592\t\a\symlink\foo.xml
      Copied C:\workspace\jenkins\core\target\junit4449490825533171592\t\b\foo.xml to C:\workspace\jenkins\core\target\junit4449490825533171592\backup\b\foo.xml as a backup
      Rewritten C:\workspace\jenkins\core\target\junit4449490825533171592\t\b\foo.xml
      Copied C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\d\e\foo.xml to C:\workspace\jenkins\core\target\junit4449490825533171592\backup\c\d\e\foo.xml as a backup
      Rewritten C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\d\e\foo.xml
      Copied C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\d\foo.xml to C:\workspace\jenkins\core\target\junit4449490825533171592\backup\c\d\foo.xml as a backup
      Rewritten C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\d\foo.xml
      Copied C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\foo.xml to C:\workspace\jenkins\core\target\junit4449490825533171592\backup\c\foo.xml as a backup
      Rewritten C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\foo.xml
      Scanning C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\symlink\b\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\foo.xml
      Scanning C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\symlink\c\symlink\c\foo.xml
      Scanning C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\symlink\c\symlink\c\symlink\c\symlink\b\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\symlink\foo.xml
      Scanning C:\workspace\jenkins\core\target\junit4449490825533171592\t\c\symlink\c\symlink\c\symlink\c\symlink\c\symlink\c\symlink\b\symlink\symlink\symlink\symlink\symlink\foo.xml
      ...
      

      I found a related report on Eclipse's Bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=363463

            ikedam ikedam
            ikedam ikedam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: