JDK-8215966 : GeneratePropertyPassword.sh uses bash syntax
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2018-12-28
  • Updated: 2019-01-07
  • Resolved: 2018-12-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b02Fixed
Related Reports
Relates :  
Relates :  
Description
Filed on behalf of Sergei Ustimenko (merkel05@gmail.com).

In JDK9, the patch for JDK-8025886 fixed jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh to not use '==' bash syntax, but the patch didn't make it into newer releases. See http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/a2551e12a9ea for the trivial patch:

-if [[ $OS == CYGWIN_NT* ]] ; then
+case $OS in
+CYGWIN_NT*)
     OS="Windows_NT"
     if [ -z "$SystemRoot" ] ;  then
-	SystemRoot=$SYSTEMROOT
+        SystemRoot=$SYSTEMROOT
     fi
-fi
+esac
Comments
[~dholmes] - The errant change showed up in the 01 webrev: http://cr.openjdk.java.net/~hb/8192953/webrev.01/ The email for that webrev originally did not go out on the open alias on 2018.06.27. You happened to notice that fact and sent a reply on that thread to the open list on 2018.06.28. There is a closed version of this script (yuck) and it looks like Harsha copied the (bad) logic from the closed version of the script to the open version of the script. The original fix from JDK-8025886 was made to the open version of the script and not to the closed version of the script. We need to make sure that the closed version of the script gets this issue resolved before someone else copies the bad code back into the open again.
29-12-2018

No idea why it was changed. It wasn't in the original version of the patch that went out for review, but was what was pushed!
28-12-2018

The NT change doesn't seem to have anything to do with the rest of the patch. Perhaps it was a copy paste error?
28-12-2018

It isn't that this change didn't make it into post 9, the change was reverted by JDK-8192953: changeset: 50861:2b7d0e9405cf user: hb date: Thu Jun 28 09:40:46 2018 +0530 summary: 8192953: sun/management/jmxremote/bootstrap/*.sh tests fail with error : revokeall.exe: Permission denied diff -r 480a96a43b62 -r 2b7d0e9405cf test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh --- a/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh +++ b/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2018, 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 @@ -34,13 +34,12 @@ OS=`uname -s` UMASK=`umask` -case $OS in -CYGWIN_NT*) +if [[ $OS == CYGWIN_NT* ]] ; then OS="Windows_NT" if [ -z "$SystemRoot" ] ; then - SystemRoot=$SYSTEMROOT + SystemRoot=`cygpath $SYSTEMROOT` fi -esac +fi case $OS in SunOS | Linux | Darwin | AIX ) @@ -70,17 +69,17 @@ if [ "$OS" = "Windows_NT" ]; then USER=`id -u -n` CACLS="$SystemRoot/system32/cacls.exe" - REVOKEALL="${TESTSRC}/../../windows/revokeall.exe" + TEST_SRC=`cygpath ${TESTSRC}` + REVOKEALL="$TEST_SRC/../../windows/revokeall.exe" if [ ! -f "$REVOKEALL" ] ; then echo "$REVOKEALL missing" exit 1 fi + chmod ug+x $REVOKEALL fi - - ;; *) - echo "Unrecognized system!" + echo "Unrecognized system! $OS" exit 1 ;; esac
28-12-2018

Forward port from JDK9.
28-12-2018