Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8042641

jcontrol script should use pwd with -P flag

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7u45, 8, 9
    • Fix Version/s: 9
    • Component/s: deploy
    • Labels:

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.7.0_45"
        Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
        Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Linux puppypc23185 3.9.11 #1 SMP Sat Jul 27 19:40:54 GMT-8 2013 i686 i686 i386 GNU/Linux

        EXTRA RELEVANT SYSTEM CONFIGURATION :
        Installed using Linux RPM

        A DESCRIPTION OF THE PROBLEM :
        The jcontrol/ControlPanel shell script should use the pwd -P flag to better handle symbolic links. The dereference() comment says " Note: This function is not capable of detecting that one or more directories in the path is also a link and unravelling that."; pwd -P can handle detect and expand multiple symlinked directories.

        % diff jcontrol.orig jcontrol
        62c62
        < parent="`cd \`dirname \"${path}\"\`; pwd`"
        ---
        > parent="`cd \`dirname \"${path}\"\`; pwd -P`"
        113c113
        < result="`cd \`dirname \"$*\"\`; pwd`"
        ---
        > result="`cd \`dirname \"$*\"\`; pwd -P`"
        117c117
        < result="`cd \`dirname \"$*\"\`/../jre/bin; pwd`"
        ---
        > result="`cd \`dirname \"$*\"\`/../jre/bin; pwd -P`"

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Download Java for Linux RPM (http://java.com/en/download/manual.jsp )
        2. Install (http://java.com/en/download/help/linux_install.xml#rpm )
        3. Add convenience symbolic links:
        % cd /usr/java
        % ln -s jre1.7.0_45 latest
        % cd /usr/bin
        % ln -s ../java/latest/bin/* .
        4. Run jcontrol
        % jcontrol

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The Java ControlPanel launches.
        ACTUAL -
        The error message "ControlPanel: Error: Invalid link or copy: " is printed and the script exits.

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        ControlPanel: Error: Invalid link or copy:

        REPRODUCIBILITY :
        This bug can be reproduced occasionally.

        ---------- BEGIN SOURCE ----------
        The jcontrol script is its own source code.
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        cd /usr/java/latest/bin
        cp jcontrol jcontrol.orig
        sed -e "s/pwd/pwd -P/" jcontrol.orig > jcontrol

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                vdrozdov Victor Drozdov (Inactive)
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: