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

FILE.MKDIRS DOES NOT RESPECT UMASK SET IN THE ENVIRONMENT

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.1.8_003
    • 1.1.7
    • other-libs
    • None
    • b03
    • generic
    • solaris_2.5

      This is a shadow to Bug report: 4259827 which is filed against java_solaris.


      FILE.MKDIRS DOES NOT RESPECT UMASK SET IN THE ENVIRONMENT
      set the umask to 002 in the environment.
      Run a simple class that calls File.mkdirs.
      See that the permission set on the directory is 771 instead of 775.

      Test case :
      /** Set the umask in the environment before
      *** Running this test case **/
      import java.io.*;

      public class TestDir
      {
          public TestDir(String sDir)
          {
              File f = new File(sDir);
              f.mkdirs();
          }
          public static void main(String args[])
          {
              if (args.length < 1)
              {
                  System.out.println("Usage : Testdir <dirname>");
                  System.exit(0);
              }

              TestDir td = new TestDir(args[0]);
              System.exit(0);
         }
      }

            duke J. Duke
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: