10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* @test 25 * @bug 4183202 26 * @summary rmid and rmiregistry could allow alternate security manager 27 * @author Laird Dornin 28 * 29 * @library ../../testlibrary 30 * @build TestLibrary JavaVM RMID TestSecurityManager 31 * @run main/othervm AltSecurityManager 32 */ 33 34 /** 35 * Ensure that a user is able to specify alternate security managers to 36 * be used in rmiregistry and rmid. Test specifies a security manager 37 * that throws a runtime exception in its checkListen method, this 38 * will cause rmiregistry and rmid to exit early because those 39 * utilities will be unable to export any remote objects; test fails 40 * if registry and rmid take too long to exit. 41 */ 42 public class AltSecurityManager implements Runnable { 43 private final int regPort; 44 // variable to hold registry and rmid children 45 static JavaVM vm = null; 46 47 // names of utilities 48 static String utilityToStart = null; 49 static final String REGISTRY_IMPL = "sun.rmi.registry.RegistryImpl"; | 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* @test 25 * @bug 4183202 26 * @summary rmid and rmiregistry could allow alternate security manager 27 * @author Laird Dornin 28 * 29 * @library ../../testlibrary 30 * @modules java.rmi/sun.rmi.registry 31 * java.rmi/sun.rmi.server 32 * java.rmi/sun.rmi.transport 33 * java.rmi/sun.rmi.transport.tcp 34 * @build TestLibrary JavaVM RMID TestSecurityManager 35 * @run main/othervm AltSecurityManager 36 */ 37 38 /** 39 * Ensure that a user is able to specify alternate security managers to 40 * be used in rmiregistry and rmid. Test specifies a security manager 41 * that throws a runtime exception in its checkListen method, this 42 * will cause rmiregistry and rmid to exit early because those 43 * utilities will be unable to export any remote objects; test fails 44 * if registry and rmid take too long to exit. 45 */ 46 public class AltSecurityManager implements Runnable { 47 private final int regPort; 48 // variable to hold registry and rmid children 49 static JavaVM vm = null; 50 51 // names of utilities 52 static String utilityToStart = null; 53 static final String REGISTRY_IMPL = "sun.rmi.registry.RegistryImpl"; |