8001329: Augment RMI logging
authordmocek
Tue, 05 Feb 2013 16:38:25 -0800
changeset 16874 acf47f31a0da
parent 16873 fb95bea093ea
child 16875 a29830a7e5b3
8001329: Augment RMI logging Reviewed-by: smarks, hawtin, alanb
jdk/src/share/classes/java/rmi/server/LogStream.java
--- a/jdk/src/share/classes/java/rmi/server/LogStream.java	Thu Mar 14 13:10:32 2013 +0100
+++ b/jdk/src/share/classes/java/rmi/server/LogStream.java	Tue Feb 05 16:38:25 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -120,6 +120,13 @@
      */
     @Deprecated
     public static synchronized void setDefaultStream(PrintStream newDefault) {
+        SecurityManager sm = System.getSecurityManager();
+
+        if (sm != null) {
+            sm.checkPermission(
+                new java.util.logging.LoggingPermission("control", null));
+        }
+
         defaultStream = newDefault;
     }