Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6359

[classlib][luni] With root privilege, test_setReadOnly of org.apache.harmony.luni.tests.java.io.FileTest fails to pass

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • 5.0M11
    • 5.0M12
    • Classlib
    • None
    • x86/redhat EL5

    Description

      This reduced test representing test_setReadOnly of org.apache.harmony.luni.tests.java.io.FileTest.java fails under root user.

      import java.io.*;

      class test_setReadOnly {
      public static void main(String args[]) throws Exception

      { test_setReadOnly sl = new test_setReadOnly(); sl.test(); }

      void test() throws Exception
      {
      File f = File.createTempFile("hyts_tf", ".tmp");
      f.setReadOnly();
      try

      { new FileOutputStream(f); System.err.println("failure: IOException not thrown"); }

      catch (IOException ioe)

      { System.err.println("pass: IOException expected"); }

      f.delete();
      }
      }

      Under root user, DRL vm prints:
      failure: IOException not thrown

      From non root user:
      pass: IOException expected

      Attachments

        Activity

          People

            tellison Tim Ellison
            kylecho Kyle Cho
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: