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

Add UnixFileOutputStream, UnixFile with permissions support

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_9

      Description

      Current Java file support does not include support for specifying UNIX permissions on files and directories that are created.

      This leads to an easy pitfall for Java applications: they can easily create files or directories with permissions looser than they should be. I've just filed a P2 security bug against another Sun product the root cause of which was that it used the Java file support to create files and directories and did not take extra care to get their permissions set right. Particularly vexing is the fact that it's actually somewhat hard to do right - the best theory I've come up with is to create the file or directory using JNI or an external program run through Runtime.exec, and then write to it using core Java.

      Such Unix* classes might well live in com.sun.something, though it seems like 3rd parties will need these capabilities too.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jordan Jordan Brown
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: