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

"grant always" choice in optional package download dialog is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.1
    • 1.3.0
    • deploy
    • ladybird
    • generic
    • generic



        Name: pa48320 Date: 12/20/2000


        java version "1.3.0_01"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
        Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)

        A simple signed extension that installs correctly when the user chooses "grant
        this session" fails if the user instead chooses "grant always". The console
        indicates that the user denied the download.

        The test case is a simple applet with a subclassed label in an optional
        package. It's all basic Plug-in stuff.

        sources:

        save the following to Bug.java

        import java.applet.*;
        import java.awt.*;
        import javax.swing.*;

        public class Bug extends Applet
        {
        public Bug()
        {
        initGUI(this);
        }

        protected void initGUI(Container c) {
        c.setLayout( new FlowLayout( FlowLayout.CENTER ) );
        add( new MyLabel() );
        }
        }

        save the following to MyLabel.java

        import java.applet.*;
        import java.awt.*;
        import javax.swing.*;

        public class MyLabel extends JLabel
        {
        public MyLabel()
        {
        super("this is MY label");
        }
        }


        compile each and put the resulting classes in Bug.jar and ext.jar respectively,
        using the following manifest info:

        bug.mf

        Extension-List: myExt
        myExt-Extension-Name: com.moi
        myExt-Specification-Version: 0.5
        myExt-Implementation-URL: http://localhost/bug/grantAlways/ext.jar

        ext.mf

        Extension-Name: bug.grantAlways.myExt
        Specification-Vendor: Moi
        Implementation-Vendor-Id: com.moi
        Implementation-Vendor: Moi
        Specification-Version: 0.5
        Implementation-Version: 0.5


        sign ext.jar and deploy.

        I placed all files (including the following html file) at
        http://localhost/bug/grantAlways/

        bug.html is as follows:

        <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
        <HTML>
        <HEAD>
        <TITLE>Bug</TITLE>
        </HEAD>
        <BODY>
        <HR>
        <!{{~SAS~(APPLET)- Generated Code - Do Not Edit!>
        <SCRIPT LANGUAGE="JavaScript"><!--
        var _info = navigator.userAgent;
        var _ns = false;
        var _ie = (_info.indexOf("MSIE") > 0
             && _info.indexOf("Win") > 0
             && _info.indexOf("Windows 3.1") < 0);
        //--></SCRIPT>
        <COMMENT>
        <SCRIPT LANGUAGE="JavaScript1.1"><!--
            var _ns = (navigator.appName.indexOf("Netscape") >= 0
                      && ((_info.indexOf("Win") > 0
        && _info.indexOf("Win16") < 0
        && java.lang.System.getProperty("os.version").indexOf
        ("3.5") < 0)
        || (_info.indexOf("Sun") > 0) || (_info.indexOf
        ("Linux") > 0) ));
        //--></SCRIPT>
        </COMMENT>
        <SCRIPT LANGUAGE="JavaScript"><!--
        if (_ie == true) {
        document.writeln(" <OBJECT");
        document.writeln(" CLASSID=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
        \"");
        document.writeln("
        CODEBASE=\"http://java.sun.com/products/plugin/1.3.0_01/jinstall-130_01-
        win32.cab#Version=1,3,0,1\"");
        document.writeln(" HEIGHT=400");
        document.writeln(" WIDTH=600");
        document.writeln(" >");
        document.writeln(" <NOEMBED><XMP>");
        }
        else if (_ns == true) {
        document.writeln(" <EMBED");
        document.writeln("
        PLUGINSPAGE=\"http://java.sun.com/products/plugin/1.3.0_01/plugin-
        install.html\"");
        document.writeln(" TYPE=\"application/x-java-applet;jpi-version=1.3.0_01
        \"");
        document.writeln(" HEIGHT=400");
        document.writeln(" WIDTH=600");
        document.writeln(" ARCHIVE=\"Bug.jar\"");
        document.writeln(" CODE=\"Bug.class\"");
        document.writeln(" ><NOEMBED><XMP>");
        }
        //--></SCRIPT>
        <APPLET CODE="Bug.class" WIDTH=600 HEIGHT=400 ARCHIVE="Bug.jar" ></XMP>
        <PARAM NAME="ARCHIVE" VALUE="Bug.jar">
        <PARAM NAME="CODE" VALUE="Bug.class">
        </APPLET>
        </NOEMBED></EMBED></OBJECT>
        <!}}~SAS~(APPLET)>
        <HR>
        </BODY>
        </HTML>

        Make sure ext.jar isn't in the Plug-in's lib/ext/ and run the html. When asked
        about downloading ext.jar, choose "grant this session" and observe that
        everything works fine -- ext.jar is downloaded and installed and the applet
        runs.

        Remove ext.jar from lib/ext/, nuke all browser sessions and try again. This
        time, choose "grant always". Download fails (and the applet fails to run).

        Here's my console log:

        Java(TM) Plug-in: Version 1.3.0_01
        Using JRE version 1.3.0_01 Java HotSpot(TM) Client VM
          User home directory = C:\WINNT\Profiles\<***EDITED***>
        Proxy Configuration: Automatic Proxy Configuration

        ----------------------------------------------------
        c: clear console window
        f: finalize objects on finalization queue
        g: garbage collect
        h: display this help message
        l: dump classloader list
        m: print memory usage
        q: hide console
        s: dump system properties
        t: dump thread list
        x: clear classloader cache
        0-5: set trace level to <n>
        ----------------------------------------------------
        sun.misc.ExtensionInstallationException: User denied installation of
        http://localhost/bug/grantAlways/ext.jar
        at sun.plugin.extension.ExtensionInstallationImpl$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.plugin.extension.ExtensionInstallationImpl.installExtension
        (Unknown Source)
        at sun.misc.ExtensionDependency.installExtension(Unknown Source)
        at sun.misc.ExtensionDependency.checkExtension(Unknown Source)
        at sun.misc.ExtensionDependency.checkExtensions(Unknown Source)
        at sun.misc.ExtensionDependency.checkExtensionsDependencies(Unknown
        Source)
        at sun.misc.URLClassPath$JarLoader.parseExtensionsDependencies(Unknown
        Source)
        at sun.misc.URLClassPath$JarLoader.getClassPath(Unknown Source)
        at sun.misc.URLClassPath.getLoader(Unknown Source)
        at sun.misc.URLClassPath.getResource(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at sun.applet.AppletClassLoader.findClass(Unknown Source)
        at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.applet.AppletClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.applet.AppletClassLoader.loadCode(Unknown Source)
        at sun.applet.AppletPanel.createApplet(Unknown Source)
        at sun.plugin.AppletViewer.createApplet(Unknown Source)
        at sun.applet.AppletPanel.runLoader(Unknown Source)
        at sun.applet.AppletPanel.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        java.lang.NoClassDefFoundError: MyLabel
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Unknown Source)
        at sun.applet.AppletPanel.createApplet(Unknown Source)
        at sun.plugin.AppletViewer.createApplet(Unknown Source)
        at sun.applet.AppletPanel.runLoader(Unknown Source)
        at sun.applet.AppletPanel.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        java.lang.NoClassDefFoundError: MyLabel
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Unknown Source)
        at sun.applet.AppletPanel.createApplet(Unknown Source)
        at sun.plugin.AppletViewer.createApplet(Unknown Source)
        at sun.applet.AppletPanel.runLoader(Unknown Source)
        at sun.applet.AppletPanel.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
        (Review ID: 114052)
        ======================================================================

              duke J. Duke
              pallenba Peter Allenbach (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: