harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Cho (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6359) With root privilege, test_setReadOnly of org.apache.harmony.luni.tests.java.io.FileTest fails to pass
Date Mon, 19 Oct 2009 22:37:59 GMT
With root privilege, test_setReadOnly of org.apache.harmony.luni.tests.java.io.FileTest fails
to pass
-----------------------------------------------------------------------------------------------------

                 Key: HARMONY-6359
                 URL: https://issues.apache.org/jira/browse/HARMONY-6359
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M11
         Environment: x86/redhat EL5
            Reporter: Kyle Cho


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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message