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

jar does not preserve permissions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0"
      Java(TM) SE Runtime Environment (build 1.6.0-b105)
      Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux johnkrlx.dev.qpass.corp 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      jar does not preserve permissions. It just uses the umask to create the file permissions.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      mkdir -p /var/tmp/foobar && cd /var/tmp/foobar && touch foo && chmod 675 foo && jar cf foo.jar foo && rm -f foo && jar xf foo.jar&& ls -l

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      -rw-rwxr-x 1 johnkr Develope 0 Jul 1 15:34 foo
      -rw-r--r-- 1 johnkr Develope 423 Jul 1 15:33 foo.jar
      drwxr-xr-x 2 johnkr Develope 4096 Jul 1 15:33 META-INF
      ACTUAL -
      -rw-r--r-- 1 johnkr Develope 0 Jul 1 15:33 foo
      -rw-r--r-- 1 johnkr Develope 423 Jul 1 15:33 foo.jar
      drwxr-xr-x 2 johnkr Develope 4096 Jul 1 15:33 META-INF


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Here's some bash source code:

      mkdir -p /var/tmp/foobar && cd /var/tmp/foobar && touch foo && chmod 675 foo && jar cf foo.jar foo && rm -f foo && jar xf foo.jar&& ls -l
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Don't use jar. Use unzip.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: