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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.0M11
    • Fix Version/s: 5.0M12
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      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

        Activity

        Kyle Cho created issue -
        Kyle Cho made changes -
        Field Original Value New Value
        Priority Major [ 3 ] Minor [ 4 ]
        Tim Ellison made changes -
        Summary With root privilege, test_setReadOnly of org.apache.harmony.luni.tests.java.io.FileTest fails to pass [classlib][luni] With root privilege, test_setReadOnly of org.apache.harmony.luni.tests.java.io.FileTest fails to pass
        Tim Ellison made changes -
        Assignee Tim Ellison [ tellison ]
        Hide
        Tim Ellison added a comment -

        I've run that test program on IBM Java and Sun Java and in both cases I get the same behavior as Harmony, namely that the IO exception is thrown if running as a regular user, and the exception is not thrown if running as root.

        Please re-open the issue if you see different behavior, and provide some more details if possible.

        Thanks.

        Show
        Tim Ellison added a comment - I've run that test program on IBM Java and Sun Java and in both cases I get the same behavior as Harmony, namely that the IO exception is thrown if running as a regular user, and the exception is not thrown if running as root. Please re-open the issue if you see different behavior, and provide some more details if possible. Thanks.
        Tim Ellison made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0M12 [ 12314191 ]
        Resolution Cannot Reproduce [ 5 ]

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Kyle Cho
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development