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

Support for .netrc file limited by strict file format requirement

    XMLWordPrintable

Details

    Description

      The support for the .netrc file requires a certain file format, i.e. one line per host with all information on it. This is an unnecessary limitation as the netrc file would also support the format:

      machine host
      login user
      password secret

      which is a format used by many users but not supported by the git client plugin. Also the parser breaks easily as it requires exactly one space between the fields.

      Additionally, when more than one machine is listed in the netrc file, the credentials from the first one are taken, not the one from the matching host.

      Attachments

        Activity

          f_zschocke Florian Zschocke created issue -
          f_zschocke Florian Zschocke made changes -
          Field Original Value New Value
          Description The support for the .netrc file requires a certain file format, i.e. one line per host with all information on it. This is an unnecessary limitation as the netrc file would also support the format:

          machine host
          login user
          password secret

          which is a format used by many users but not supported by the git client plugin. Also the parser breaks easily as it requires exactly one space between the fields.
          The support for the .netrc file requires a certain file format, i.e. one line per host with all information on it. This is an unnecessary limitation as the netrc file would also support the format:

          machine host
          login user
          password secret

          which is a format used by many users but not supported by the git client plugin. Also the parser breaks easily as it requires exactly one space between the fields.

          Additionally, when more than one machine is listed in the netrc file, the credentials from the first one are taken, not the one from the matching host.

          Code changed in jenkins
          User: Florian Zschocke
          Path:
          src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
          src/main/java/org/jenkinsci/plugins/gitclient/Netrc.java
          src/test/java/org/jenkinsci/plugins/gitclient/NetrcTest.java
          src/test/resources/netrc_1.in
          src/test/resources/netrc_1a.in
          src/test/resources/netrc_2.in
          http://jenkins-ci.org/commit/git-client-plugin/3430d9270beeabedfab130e5d987bcf26c336748
          Log:
          [FIXED JENKINS-20684] Parser for .netrc file format

          This path implements a parser for the .netrc file supporting various formats.
          It is not restricted to having a machine definition on a single line but can
          parse any valid format. The one exception is that it does not cope with
          `macdef` definitions.

          handle `macdef` definitons in the netrc file to the parser.
          Anything following a `macdef` keyword will be ignored up to
          the next empty line.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Florian Zschocke Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java src/main/java/org/jenkinsci/plugins/gitclient/Netrc.java src/test/java/org/jenkinsci/plugins/gitclient/NetrcTest.java src/test/resources/netrc_1.in src/test/resources/netrc_1a.in src/test/resources/netrc_2.in http://jenkins-ci.org/commit/git-client-plugin/3430d9270beeabedfab130e5d987bcf26c336748 Log: [FIXED JENKINS-20684] Parser for .netrc file format This path implements a parser for the .netrc file supporting various formats. It is not restricted to having a machine definition on a single line but can parse any valid format. The one exception is that it does not cope with `macdef` definitions. handle `macdef` definitons in the netrc file to the parser. Anything following a `macdef` keyword will be ignored up to the next empty line.
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          f_zschocke Florian Zschocke made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 152493 ] JNJira + In-Review [ 207180 ]

          People

            ndeloof Nicolas De Loof
            f_zschocke Florian Zschocke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: