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)
        ---------------

          Issue Links

            Activity

            Hide
            sherman Xueming Shen added a comment -
            BT2:EVALUATION

            This regression is caused by a change that was made in previous release to improve file permission. The temporary file used in this case was "renamed" to overwrite the original file for the jar update.
            Show
            sherman Xueming Shen added a comment - BT2:EVALUATION This regression is caused by a change that was made in previous release to improve file permission. The temporary file used in this case was "renamed" to overwrite the original file for the jar update.
            Hide
            alanb Alan Bateman added a comment -
            BT2:EVALUATION

            Note that this issue does not affect Windows, only Linux/Solaris/Mac and only when jar files are shared between developers. Bob updates a JAR file with the jar command and Alice, on the same system or accessing via NFS, can no longer access it because the file permissions on the .jar file have changed after the update. The short term solution is to back out the changes made for this specific case. Later it can be fixed properly so that the rename over the original JAR file keeps the original permissions.
            Show
            alanb Alan Bateman added a comment - BT2:EVALUATION Note that this issue does not affect Windows, only Linux/Solaris/Mac and only when jar files are shared between developers. Bob updates a JAR file with the jar command and Alice, on the same system or accessing via NFS, can no longer access it because the file permissions on the .jar file have changed after the update. The short term solution is to back out the changes made for this specific case. Later it can be fixed properly so that the rename over the original JAR file keeps the original permissions.
            Show
            jprtbugupd JPRT Bug Updates (Inactive) added a comment - BT2:EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/jdk/rev/819258b5002e

              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: