提交 5c21ef2e 编写于 作者: A amenkov

6738524: JDK13Services allows read access to system properties from untrusted code

Reviewed-by: hawtin
上级 9944a997
/* /*
* Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -41,6 +41,15 @@ import javax.sound.midi.spi.MidiFileWriter; ...@@ -41,6 +41,15 @@ import javax.sound.midi.spi.MidiFileWriter;
import javax.sound.midi.spi.SoundbankReader; import javax.sound.midi.spi.SoundbankReader;
import javax.sound.midi.spi.MidiDeviceProvider; import javax.sound.midi.spi.MidiDeviceProvider;
import javax.sound.midi.Receiver;
import javax.sound.midi.Sequencer;
import javax.sound.midi.Synthesizer;
import javax.sound.midi.Transmitter;
import javax.sound.sampled.Clip;
import javax.sound.sampled.Port;
import javax.sound.sampled.SourceDataLine;
import javax.sound.sampled.TargetDataLine;
/** /**
* JDK13Services uses the Service class in JDK 1.3 * JDK13Services uses the Service class in JDK 1.3
...@@ -186,6 +195,16 @@ public class JDK13Services { ...@@ -186,6 +195,16 @@ public class JDK13Services {
If the property is not set, null is returned. If the property is not set, null is returned.
*/ */
private static synchronized String getDefaultProvider(Class typeClass) { private static synchronized String getDefaultProvider(Class typeClass) {
if (!SourceDataLine.class.equals(typeClass)
&& !TargetDataLine.class.equals(typeClass)
&& !Clip.class.equals(typeClass)
&& !Port.class.equals(typeClass)
&& !Receiver.class.equals(typeClass)
&& !Transmitter.class.equals(typeClass)
&& !Synthesizer.class.equals(typeClass)
&& !Sequencer.class.equals(typeClass)) {
return null;
}
String value; String value;
String propertyName = typeClass.getName(); String propertyName = typeClass.getName();
value = JSSecurityManager.getProperty(propertyName); value = JSSecurityManager.getProperty(propertyName);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册