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

Developer profile is broken after saving credentials again

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • xcode-plugin
    • None

      how to reproduce:

      • download and start jenkins
        $ cd /tmp
        $ curl -L -o jenkins-1.638.war http://mirrors.jenkins-ci.org/war/1.638/jenkins.war
        $ mkdir jenkins-1.638
        $ export JENKINS_HOME=/tmp/jenkins-1.638
        $ java -Dhudson.DNSMultiCast.disabled=true -jar jenkins-1.638.war
        
      • install Jenkins plugins
      • open Manage Jenkins -> Manage Credentials
      • add a Apple Developer Profile
      • save
      • open Manage Jenkins -> Manage Credentials again
      • the profile and certificates are shown correctly
      • save
      • open Manage Jenkins -> Manage Credentials again
      • now an error message is shown:
        There's no certificate in this profile

      When saving the form the size of the profile on disk changes from 48k to 16b.

      All Jenkins using this developer profile fail with this error message:

      FATAL: remote file operation failed: /Users/jenkins/developer-profiles/75c9e18b-e0f3-4d42-bcea-6e110f4995dd at hudson.remoting.Channel@48e89e1c:Build Mac Pro HH: java.util.zip.ZipException: archive is not a ZIP archive
      

          [JENKINS-31723] Developer profile is broken after saving credentials again

          in au.com.rayh.DeveloperProfile.java

          if (image != null) {
              // for added secrecy, store this in the confidential store
              new ConfidentialKeyImpl(id).store(image);
          }
          

          has to be changed to

          if (!image.getName().isEmpty()) {
              // for added secrecy, store this in the confidential store
              new ConfidentialKeyImpl(id).store(image);
          }
          

          Clifford Sanders added a comment - in au.com.rayh.DeveloperProfile.java if (image != null) { // for added secrecy, store this in the confidential store new ConfidentialKeyImpl(id).store(image); } has to be changed to if (!image.getName().isEmpty()) { // for added secrecy, store this in the confidential store new ConfidentialKeyImpl(id).store(image); }

          or even better use the StringUtils:

          if (!StringUtils.isBlank(image.getName())) {
              // for added secrecy, store this in the confidential store
              new ConfidentialKeyImpl(id).store(image);
          }
          

          Clifford Sanders added a comment - or even better use the StringUtils: if (!StringUtils.isBlank(image.getName())) { // for added secrecy, store this in the confidential store new ConfidentialKeyImpl(id).store(image); }

            clifford_jenkins Clifford Sanders
            clifford_jenkins Clifford Sanders
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: