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

java.io.File.mkdir() ignores umask

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: akC57697 Date: 04/23/98



      The java.io.File.mkdir() ignores umask settings when creates a directory.
      The reason is a hard-coded mask in source of native method:

      "
      Java_java_io_File_mkdir0(JNIEnv *env, jobject this)
      {
        .........................
          result = JVM_Mkdir(platformPath, 0771) != -1;
                                           ^^^^^
      "

      ---------------------8-<----------------------
      public class testFile {
        public static void main(String argv[]) {
         java.io.File f= new java.io.File("test_dir");
         f.mkdir();
        }
      }
      --------------------->-8----------------------
      Set umask to -rw-rw-r--
      umask 2
      java testFile
      drwxrwx--x 2 kuzm 512 Apr 23 13:58 test_dir/
      ^^^^^^^^^^
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              akuzminorcl Alexander Kuzmin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: