Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-1167

Authentication failure in Atom API leads to NullPointerException in RollerAtomHandler

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3
    • None
    • Web Services
    • None
    • All
    • Trivial, see patch above

    Description

      If an incorrect username or password is used ehen e.g. posting a new entry via the Atom API instead of getting a 401 error (Unauthorized) you get a 500 server error because of a NullPOinterException in RollerAtomHandler.

      RollerAtomHandler#getAuthenticatedUsername was not checking if this.user was null.

      The patch for my proposed fix is below :
      Index: RollerAtomHandler.java
      ===================================================================
      — RollerAtomHandler.java (revision 414838)
      +++ RollerAtomHandler.java (working copy)
      @@ -121,6 +121,9 @@

      • Return weblogHandle of authenticated user or null if there is none.
        */
        public String getAuthenticatedUsername()
        Unknown macro: {+ if (this.user == null) { + return null; + } return this.user.getUserName(); }

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--patchfile.txt
          0.5 kB
          Padraig O hIceadha
        2. ASF.LICENSE.NOT.GRANTED--RollerAtomHandler.java
          33 kB
          Padraig O hIceadha

        Activity

          People

            Unassigned Unassigned
            padraigo Padraig O hIceadha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: