Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-329

DefaultUsersJdbcRepository readUserFromResultSet incorrect

    Details

      Description

      Lines 49-50 in the DefaultUsersJdbcRepository.java are reversed for the getString values.

      Consequently, the class is unable to authenticate any users.

      The lines are:
      String passwordAlg = rsUsers.getString(2);
      String passwordHash = rsUsers.getString(3);

      They should be:
      String passwordHash = rsUsers.getString(2);
      String passwordAlg = rsUsers.getString(3);

      Alternatively, the SQLResources.xml file can be changed on line 148 from:
      <sql name="select">SELECT username, pwdHash, pwdAlgorithm
      to:
      <sql name="select">SELECT username, pwdAlgorithm, pwdHash
      but this would then be out of line with the rest of the file.

        Activity

        Hide
        noel Noel J. Bergman added a comment -

        We can fix or remove DefaultUsersJdbcRepository. It is unused. The JamesUsersJdbcRepository is the class that we do use, and it has the fields in the correct order.

        Show
        noel Noel J. Bergman added a comment - We can fix or remove DefaultUsersJdbcRepository. It is unused. The JamesUsersJdbcRepository is the class that we do use, and it has the fields in the correct order.
        Hide
        bago Stefano Bagnara added a comment -

        Fixed in trunk.

        Show
        bago Stefano Bagnara added a comment - Fixed in trunk.
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            bago Stefano Bagnara
            Reporter:
            vhines Vaughan Hines
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development