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

Security manager dialog check-box malfunction when printing from applet.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • None
    • 7
    • deploy
    • windows_7

      FULL PRODUCT VERSION :
      java version " 1.7.0_07 "
      Java(TM) SE Runtime Environment (build 1.7.0_07-b11)
      Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 Enterprise SP1,
      Windows XP Professional SP3,
      Mac OSX 10.8.2


      A DESCRIPTION OF THE PROBLEM :
      Signed java applet that accesses client printer list. Applet is called via JavaScript therefore acting as an Unsigned applet. Security Warning message dialog is triggered with the below text.

       " The applet has requested access to the printer. Do you want to allow this action?

      Name: MyAppletName

      Check-box: Always allow this applet to access the printer "

      PrinterJob.lookupPrintServices(); was found to be populated when the check-box in the dialog was NOT checked. However when the check-box IS checked the object is not populated with the local printers.

      REGRESSION. Last worked in version 7

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Note: This site demonstrates the same behavior as the original problem, however is not the exact implementation.

      Fail:
      1) go to http://wordle.net
      2) Click on one of the examples
      3) Applet loads
      4) Click the Print... button below the graphic
      5) Security warning appears (expected)
      6) Check the check-box " Always allow " && Hit " OK "
      7) Repeat step 6 for each security dialog that appears.
      Result = Printer dialog is never shown

      Pass:
      1) go to http://wordle.net
      2) Click on one of the examples
      3) Applet loads
      4) Click the Print... button below the graphic
      5) Security warning appears (expected)
      6) DO NOT Check the check-box " Always allow " && Hit " OK "
      7) Repeat step 6 for each security dialog that appears.
      Result = Printer dialog appears
       


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Fail Scenario: Print dialog is expected to be shown.
      ACTUAL -
      Fail Scenario: Print dialog is never shown

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      // Variable Result by Checking && Not Checking The Security Dialog //Checkbox

      javax.print.PrintService ps[] = PrinterJob.lookupPrintServices();

      JOptionPane.showMessageDialog(null, ps[0].toString());


      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Clicking " OK " && NOT checking the check-box will allow the application to behave as expected.

            dmarkov Dmitry Markov
            webbuggrp Webbug Group
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: