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

getConfigPath() in RollerContext.java doesn't handle SecurityException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9.8.2
    • 1.1
    • None
    • None
    • IE 6.01 SP1
    • MySQL 4.0.20a
    • 1.4.2_04
    • Windows XP SP1 / RedHat Advanced Server 7

    Description

      When the method getConfigPath() tries to look for roller-config.xml at user.home with new File(configPath).exists() [line 468 of RollerContext.java version 0.9.8.2], the executing user could not allow access to its home directory and, in this case, a SecurityException is raised and not handled.
      The natural handling should be treat a file security exception the same as a "file not found".

      So, line 448:
      if (!new File(configPath).exists())

      should be replaced by:
      boolean homeConfig;
      try

      { homeConfig = new File(configPath).exists(); }

      catch (SecurityException se)

      { homeConfig = false; mLogger.info("Permission denied at '" + configPath + "'"); }

      if (!homeConfig)

      Attachments

        Activity

          People

            agangolli Anil Gangolli
            mhavila Marcio Avila
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: