-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
5.0
-
sparc
-
solaris_9
The spec of File.setReadOnly() reads:
After invoking this method the file or directory is guaranteed not to change until it is either deleted or marked to allow write access.
However, it is discovered that when executing as root in Linux, File.setReadOnly() does not affect the ability to write the file later on even if setReadOnly() returns true. File.canWriter() still returns true on the same file and writing to the file does not throw any exception.
After invoking this method the file or directory is guaranteed not to change until it is either deleted or marked to allow write access.
However, it is discovered that when executing as root in Linux, File.setReadOnly() does not affect the ability to write the file later on even if setReadOnly() returns true. File.canWriter() still returns true on the same file and writing to the file does not throw any exception.
- duplicates
-
JDK-6931128 (spec) File attribute tests fail when run as root.
-
- Closed
-
- relates to
-
JDK-6236543 JCK14a 2 failures in api/java_io/File/descriptions.html#setPermissions
-
- Closed
-