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

Java applets do not work with IE7 "Protect mode ON" on windows Vista.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: deploy
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_vista

      Description

      FULL PRODUCT VERSION :
      Java Plug-in 1.6.0_01, Java Plug-in 1.6.0_02-ea

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.0.6000]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Internet Explorer 7 with Protected Mode ON

      A DESCRIPTION OF THE PROBLEM :
      It seems like applets are having less permission to access files in IE7 running on Windows Vista. It is even stricter in Protected mode On.

      We have couple of applets which write files in %APPDATA% folder under a particular directory. This was not working in Protected mode ON, but was writing the files in Protected mode OFF. We used System.getenv() to get the environment variable and constructed the full path.

      Now the problem is that FileOutputStream.write() does not write the file in the given location. The location is some thing like this "C:\Users\<user name>\AppData\Roaming\<file name>". There is NO exception thrown from the code. We checked that FileOutputStream.getFD().valid() is returning 'true'.

      Problem is reproducible with both JRE 1.5_06 and 1.6_01.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      File written to the APPDATA directory.
      ACTUAL -
      File not written to the APPDATA folder. Also there is no exception thrown from FileOutputStream.write()

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public static void writeFile(byte[] buf, String filename)
      {
            String parent_dir = System.getenv("APPDATA");
            String finalPath = parent_dir + filename;

            java.io.FileOutputStream fout = null;

            try
            {

               fout = new java.io.FileOutputStream(finalPath);

               fout.write(buf);
               fout.flush();
            }
            catch (IOException ex)
            {
               ex.printStackTrace();
            }

            finally
            {
               try
               {
                  if(fout!=null)
                  {
                     fout.close();
                  }
               }
               catch(IOException e)
               {
                  // ensure the program to run more safely. It's not necessary to log
                  // the exception.
               }
            }

         }
      }
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ngthomas Thomas Ng (Inactive)
                Reporter:
                ndcosta Nelson Dcosta
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: