Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-1965

Prevent NPE on decrypting a null password

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Component/s: admin
    • Labels:
      None

      Description

      If no password is specified, the logs show a NPE:

      java.lang.NullPointerException
          at com.sun.jersey.core.util.Base64.decode(Base64.java:324)
          at org.apache.ranger.plugin.util.PasswordUtils.decrypt(PasswordUtils.java:126)
          at org.apache.ranger.plugin.util.PasswordUtils.decryptPassword(PasswordUtils.java:120)
          at org.apache.ranger.plugin.client.BaseClient.login(BaseClient.java:108)
          at org.apache.ranger.plugin.client.BaseClient.<init>(BaseClient.java:61)
          at org.apache.ranger.services.sqoop.client.SqoopClient.<init>(SqoopClient.java:74)
          at org.apache.ranger.services.sqoop.client.SqoopClient.getSqoopClient(SqoopClient.java:357)
          at org.apache.ranger.services.sqoop.client.SqoopClient.connectionTest(SqoopClient.java:321)

      Instead, we should only try to decrypt the password if it's not null.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coheigea Colm O hEigeartaigh
                Reporter:
                coheigea Colm O hEigeartaigh
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: