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

sun.misc.Launcher is looking at only the first path in java.app.class.path

XMLWordPrintable

    • 1.2beta2
    • generic
    • solaris_2.5.1
    • Not verified



      This problem was detected by Security Architecture tests. More details are
      given below:

      dodda:/w/AppToApp( 275 )%ls -al *.class
      -rw-r--r-- 1 satyad staff 796 Dec 2 18:22 ExecutionThread.class
      -rw-r--r-- 1 satyad staff 1582 Dec 2 18:22 NoPermFromDomain.class
      -rw-r--r-- 1 satyad staff 1351 Dec 2 18:22 NoPermToDomain.class
      dodda:/w/AppToApp( 276 )%echo $CLASSPATH
      /usr/sqe/pkgs/sqe-tools/promoted/classes:/usr/local/java/jdk1.2/solaris/lib/clas
      ses.zip
      dodda:/w/AppToApp( 277 )%
      dodda:/w/AppToApp( 277 )%ls -alR /tmp/ettestdir
      /tmp/ettestdir:
      total 64
      drwxr-xr-x 3 satyad staff 158 Dec 2 18:22 ./
      drwxrwxrwt 12 sys sys 1670 Dec 2 18:22 ../
      -rw-r--r-- 1 satyad staff 2993 Dec 2 18:22 PrivPermPD.class
      drwxr-xr-x 2 satyad staff 173 Dec 2 18:22 permdir/

      /tmp/ettestdir/permdir:
      total 64
      drwxr-xr-x 2 satyad staff 173 Dec 2 18:22 ./
      drwxr-xr-x 3 satyad staff 158 Dec 2 18:22 ../
      -rw-r--r-- 1 satyad staff 1574 Dec 2 18:22 PermFromDomain.class
      -rw-r--r-- 1 satyad staff 1343 Dec 2 18:22 PermToDomain.class
      dodda:/w/AppToApp( 278 )%
      dodda:/w/AppToApp( 278 )%
      dodda:/w/AppToApp( 278 )%cat ettest.jp

      grant {

              permission java.lang.RuntimePermission "exit";

      };

      grant codeBase "file://localhost/tmp/ettestdir/" {

              Permission java.lang.RuntimePermission "System.test";

      };


      grant codeBase "file://localhost/tmp/ettestdir/permdir/" {

              Permission java.lang.RuntimePermission "System.test";

      };

      dodda:/w/AppToApp( 279 )%java
      -Djava.app.class.path=/tmp/ettestdir:/tmp/ettestdir/permdir:.
      -Djava.policy=ettest.jp sun.misc.Launcher ExecutionThread
      java.io.FileNotFoundException: /tmp/ettestdir/ExecutionThread.class
              at java.io.FileInputStream.<init>(FileInputStream.java:58)
              at
      sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:166)
              at
      sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.jav
      a:186)
              at sun.net.URLClassPath$Resource.getBytes(URLClassPath.java:287)
              at sun.misc.AppClassLoader.findLocalClass(Launcher.java:414)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:228)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:172)
              at sun.misc.AppClassLoader.invokeClass(Launcher.java:515)
              at sun.misc.Launcher.run(Launcher.java:170)
              at sun.misc.Launcher.run(Launcher.java:183)
              at sun.misc.Launcher.main(Launcher.java:266)
      Class not found: ExecutionThread


      > Date: Tue, 2 Dec 1997 18:26:11 -0800 (PST)
      > From: Roland Schemers <schemers@shorter>
      > Subject: Re: Broken Functionality : sun.misc.Launcher & Jarfile
      > To: dac@shorter, satyad@taller
      > MIME-Version: 1.0
      > Content-MD5: ReFKF9MUMrVdd8ZRN4TYYA==
      >
      > I tested sun.misc.Launcher with a jar file and it worked fine. It looks
      > like you are setting java.app.class.path to a jar file and ".", and
      > URLClassLoader is throwing an exception because it couldn't find the
      > class in the jar file (WatchTV.class isn't in the jar file). I assume the
      class
      > file exists on "." though?
      >
      > Sounds like URLClassLoader might not be doing the right thing when
      > it doesn't find the class in the first entry on java.app.class.path.
      >
      > roland
      >
      > > Date: Tue, 2 Dec 1997 18:21:10 -0800 (PST)
      > > From: Satya Dodda <satyad@taller>
      > > Subject: Broken Functionality : sun.misc.Launcher & Jarfile
      > > To: schemers@shorter, dac@shorter
      > > MIME-Version: 1.0
      > > Content-MD5: PyEXKiFsdC2Z8fNQplry2Q==
      > >
      > > Hi,
      > > If a jarfile is specified on the java.app.class.path,
      > > sun.misc.Launcher is not working properly.
      > >
      > > java.security.Main had worked properly earlier.
      > >
      > > I don't know how serious is this bug. Please advise me.
      > >
      > > Most of the Signed Jar tests failed, because of this problem.
      > >
      > > Thanks
      > > Satya
      > >
      > >
      > >
      > >
      > > dodda:/home/satyad/psqe/Security/src/SA/ExtensiblePolicy( 260 )%java
      > > -Djava.app.class.path="./Sign0.jar:." sun.misc.Launcher WatchTV
      > > java.io.FileNotFoundException: JAR entry WatchTV.class not found in
      > > /home/satyad/psqe/Security/src/SA/ExtensiblePolicy/Sign0.jar
      > > at
      > >
      >
      sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:8
      > > 4)
      > > at sun.net.URLClassPath$Resource.getBytes(URLClassPath.java:287)
      > > at sun.misc.AppClassLoader.findLocalClass(Launcher.java:414)
      > > at java.lang.ClassLoader.loadClass(ClassLoader.java:228)
      > > at java.lang.ClassLoader.loadClass(ClassLoader.java:172)
      > > at sun.misc.AppClassLoader.invokeClass(Launcher.java:515)
      > > at sun.misc.Launcher.run(Launcher.java:170)
      > > at sun.misc.Launcher.run(Launcher.java:183)
      > > at sun.misc.Launcher.main(Launcher.java:266)
      > > Class not found: WatchTV
      > > dodda:/home/satyad/psqe/Security/src/SA/ExtensiblePolicy( 261 )%
      > > dodda:/home/satyad/psqe/Security/src/SA/ExtensiblePolicy( 261 )%
      > > dodda:/home/satyad/psqe/Security/src/SA/ExtensiblePolicy( 261 )%jar tvf
      > > Sign0.jar
      > > 223 Tue Dec 02 17:52:32 PST 1997 META-INF/MANIFEST.MF
      > > 5203 Tue Dec 02 17:52:30 PST 1997 TVPermission.class
      > > 1254 Tue Dec 02 17:52:30 PST 1997 TVPermissionCollection.class
      > > dodda:/home/satyad/psqe/Security/src/SA/ExtensiblePolicy( 262 )%echo
      > $CLASSPATH
      > >
      >
      /usr/sqe/pkgs/sqe-tools/promoted/classes:/usr/local/java/jdk1.2/solaris/lib/clas
      > > ses.zip
      > > dodda:/home/satyad/psqe/Security/src/SA/ExtensiblePolicy( 263 )%java
      > > -fullversion
      > > java full version "JDK-1.2beta2-X"
      > >
      >

            rschemersunw Roland Schemers (Inactive)
            sndodda Satya Dodda
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: