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

jar can extract and overwrite the wrong file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 6u18
    • tools
    • None
    • jar
    • x86
    • solaris_nevada

      Suppose I try to extract a file from a jar file, and the file I ask
      for isn't in the archive, but what I ask for is a substring of
      something that is in the jar file:

      athyra$ ls
      foo.jar
      athyra$ jar tf foo.jar
      META-INF/
      META-INF/MANIFEST.MF
      foo.pl

      jar will extract the file that's in the archive, even though it's not
      what I asked for.

      athyra$ jar xf foo.jar foo
      athyra$ ls
      foo.jar foo.pl

      Furthermore, if this other file already exists, jar will clobber it.

      athyra$ echo blah >| foo.pl
      athyra$ sum foo.pl
      57449 1
      athyra$ jar xf foo.jar foo
      athyra$ sum foo.pl
      54618 1

            sherman Xueming Shen
            mkupfer Mike Kupfer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: