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

ld.so.1: java: fatal: libjli.so: open failed: No such file or directory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • tools
    • sparc
    • solaris_10

      FULL PRODUCT VERSION :
      1.6.0_18

      ADDITIONAL OS VERSION INFORMATION :
      bash-3.00# uname -a
      SunOS zcydsd768 5.10 Generic_142900-11 sun4u sparc SUNW,Netra-240

      A DESCRIPTION OF THE PROBLEM :
      non-root user can't successfully exec java if it called from a ksh shell script ( with user set-ID be set ).



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Please see below reproduce case:
      1. 6 test shell scripts:
      test_ksh_setuid.sh
      test_ksh_nosetid.sh
      test_bash_setuid.sh
      test_bash_nosetuid.sh
      test_sh_setuid.sh
      test_sh_nosetuid.sh

      with following contents and permissions which are only include a line to exec java -version cmd.

      bash-3.00# ls -l test*.sh
      -r-xr-x--- 1 root other 51 Aug 5 11:21 test_bash_nosetuid.sh
      -r-sr-x--- 1 root other 51 Aug 5 11:21 test_bash_setuid.sh
      -r-xr-x--- 1 root other 50 Aug 5 11:22 test_ksh_nosetuid.sh
      -r-sr-x--- 1 root other 50 Aug 5 11:22 test_ksh_setuid.sh
      -r-xr-x--- 1 root other 49 Aug 5 11:22 test_sh_nosetuid.sh
      -r-sr-x--- 1 root root 49 Aug 5 11:27 test_sh_setuid.sh

      bash-3.00# cat test_bash_nosetuid.sh
      #!/bin/bash
      /opt/jre/jre1.6.0_18/bin/java -version
      bash-3.00# cat test_bash_setuid.sh
      #!/bin/bash
      /opt/jre/jre1.6.0_18/bin/java -version
      bash-3.00# cat test_ksh_nosetuid.sh
      #!/bin/ksh
      /opt/jre/jre1.6.0_18/bin/java -version
      bash-3.00# cat test_ksh_setuid.sh
      #!/bin/ksh
      /opt/jre/jre1.6.0_18/bin/java -version
      bash-3.00# cat test_sh_nosetuid.sh
      #!/bin/sh
      /opt/jre/jre1.6.0_18/bin/java -version
      bash-3.00# cat test_sh_setuid.sh
      #!/bin/sh
      /opt/jre/jre1.6.0_18/bin/java -version

      Please note, the jre1.6.0_18 under /opt/jre installed by exec j2re-solaris-sparc.sh and j2re-solaris-sparcv9.sh.

      All these scripts are works well if run by root user.

      However if change to executed by non-root user, for example, a user belongs to the 'other' group which also has the execute permission, error happens.

      Please see the result:
      $ ./test_bash_nosetuid.sh
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)
      $ ./test_bash_setuid.sh
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)
      $ ./test_ksh_nosetuid.sh
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)
      $ ./test_ksh_setuid.sh
      ld.so.1: java: fatal: libjli.so: open failed: No such file or directory
      /bin/ksh[2]: 18030 Killed
      $ ./test_sh_nosetuid.sh
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)
      $ ./test_sh_setuid.sh
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)

      We can see only script: test_ksh_setuid.sh failed.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      ACTUAL -
      ld.so.1: java: fatal: libjli.so: open failed: No such file or directory
      /bin/ksh[2]: 18030 Killed

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      create a softlink under /usr/lib: ln -s /opt/jre/jre1.6.0_18/lib/sparc/jli/libjli.so libjli.so

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: