342N/A# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. 342N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 342N/A# This code is free software; you can redistribute it and/or modify it 342N/A# under the terms of the GNU General Public License version 2 only, as 342N/A# published by the Free Software Foundation. 342N/A# This code is distributed in the hope that it will be useful, but WITHOUT 342N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 342N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 342N/A# version 2 for more details (a copy is included in the LICENSE file that 342N/A# accompanied this code). 342N/A# You should have received a copy of the GNU General Public License version 342N/A# 2 along with this work; if not, write to the Free Software Foundation, 1472N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3678N/A# @summary Check SSL config file permission for out-of-the-box management 342N/A public static void main(String[] args) { 342N/A System.out.println("Inside main method..."); 342N/Acom.sun.management.jmxremote.authenticate=false 3119N/Acom.sun.management.jmxremote.ssl.config.file=$2 342N/Ajavax.net.ssl.keyStore=$2 342N/Ajavax.net.ssl.keyStorePassword=password 342N/A# Check we are run from jtreg 342N/Aif [ -z
"${TESTCLASSES}" ];
then 342N/A echo "Test is designed to be run from jtreg only" 342N/A# Test not suitable for Windows as chmod may not be able to 342N/A# security the password file. 342N/A echo "Test not designed to run on this operating system, skipping..." 342N/A# Create management and SSL configuration files 3120N/A# Test 1 - SSL config file is secure - VM should start 3120N/A# Test 2 - SSL config file is not secure - VM should fail to start 3120N/A# Reset the file permissions on the generated SSL config file 342N/A else echo "All test(s) passed";
fi