Jetty
  1. Jetty
  2. JETTY-691

System.getProperty() calls ... wrap them in doPrivileged

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.0pre3
    • Fix Version/s: 6.1.15.rc3
    • Component/s: HTTP
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Log.class accesses system properties. This requires a permission. That's
      OK for normal deployments, but with custom permissions designs, it can be
      problematic.

      public class Log {
      // ....
      private static String
      __logClass=System.getProperty("org.mortbay.log.class","org.mortbay.log.Slf4jLog");
      private static boolean __verbose =
      System.getProperty("VERBOSE",null)!=null;
      private static boolean __ignored =
      System.getProperty("IGNORED",null)!=null;
      // ...

      Is there any chance in setting those up in a static initializer block to
      allow for simplifying permissions?

      AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
      public Boolean run()

      { __logClass = System.getProperty("org.mortbay.log.class","org.mortbay.log.Slf4jLog"); __verbose = System.getProperty("VERBOSE",null)!=null; __ignored = System.getProperty("IGNORED",null)!=null; return true; }

      });

        Activity

        Hide
        Greg Wilkins added a comment -

        Can you look at this one, as I think it might dove tail with some other tasks coming your way.

        Show
        Greg Wilkins added a comment - Can you look at this one, as I think it might dove tail with some other tasks coming your way.
        Hide
        Jesse McConnell added a comment -

        looks good to me, added to branch and trunk..

        Show
        Jesse McConnell added a comment - looks good to me, added to branch and trunk..

          People

          • Assignee:
            Jesse McConnell
            Reporter:
            Paul Hammant
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: