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

"jar uf" changes file permissions unexpectedly

    Details

    • Subcomponent:
      jar
    • Introduced In Build:
      b01
    • Introduced In Version:
      7u5
    • Resolved In Build:
      b32
    • CPU:
      generic, x86
    • OS:
      generic, linux, linux_redhat_5.0, solaris
    • Verification:
      Verified

      Backports

        Description

        There seems a regression in jdk6u33 (linux am64)
        Jar command changes the permission of file.

        REPRODUCE :
        1. run "umask 022"
        2. run "jar cvf new-file any-file"
        3. confirm the permission of new-file in the above step2
          (permission is set to 644)
        4. run "jar uvf new-file any-file2"
        5. confirm the permission of new-file again.
        You can see the permission is changed to 600

        FREQUENCY:
        This problem occurs every time the command is run.

        EXPECTED:
        The behavior in jdk6u32 is expected.(permission is not changed by jar command)
        ---- JDK6u32 ---
        jle-esxi-redhat:/home/tbaba 42 % umask 022
        jle-esxi-redhat:/home/tbaba 43 % jar cvf test.jar te.csh
        added manifest
        adding: te.csh(in = 476) (out= 96)(deflated 79%)
        jle-esxi-redhat:/home/tbaba 44 % ls -l test.jar
        -rw-r--r--+ 1 tbaba javasoft 545 Jun 10 23:25 test.jar
        jle-esxi-redhat:/home/tbaba 45 % jar uvf test.jar cmd
        adding: cmd(in = 149) (out= 91)(deflated 38%)
        jle-esxi-redhat:/home/tbaba 46 % ls -l test.jar
        -rw-r--r--+ 1 tbaba javasoft 734 Jun 10 23:25 test.jar
        jle-esxi-redhat:/home/tbaba 47 % java -version
        java version "1.6.0_32"
        Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
        Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)
        ----------

        ACTUAL:
        Permission of file is changed by jar command.
        --- JDK6u33 ----
        jle-esxi-redhat:/home/tbaba 43 % umask 022
        jle-esxi-redhat:/home/tbaba 44 % jar cvf test.jar te.csh
        added manifest
        adding: te.csh(in = 476) (out= 96)(deflated 79%)
        jle-esxi-redhat:/home/tbaba 45 % ls -l test.jar
        -rw-r--r--+ 1 tbaba javasoft 545 Jun 10 23:28 test.jar
        jle-esxi-redhat:/home/tbaba 46 % jar uvf test.jar cmd
        adding: cmd(in = 149) (out= 91)(deflated 38%)
        jle-esxi-redhat:/home/tbaba 47 % ls -l test.jar
        -rw-------+ 1 tbaba javasoft 734 Jun 10 23:29 test.jar <==== Permission is changed !!
        jle-esxi-redhat:/home/tbaba 48 % java -version
        java version "1.6.0_33"
        Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
        Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)
        ---------------

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mbankal Mala Bankal (Inactive)
                  Reporter:
                  tbaba Tadayuki Baba (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: