changeset 5634:76eb3fb80740

8001329: Augment RMI logging Reviewed-by: smarks, hawtin, alanb
author dmocek
date Tue, 05 Feb 2013 16:38:25 -0800
parents 8261e56b7f91
children 47114a90798b
files src/share/classes/java/rmi/server/LogStream.java
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/rmi/server/LogStream.java	Tue Feb 05 20:18:16 2013 +0400
+++ b/src/share/classes/java/rmi/server/LogStream.java	Tue Feb 05 16:38:25 2013 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2004, 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;
     }