You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2010/10/12 14:49:20 UTC

DO NOT REPLY [Bug 50081] New: SignJar: error signing if path for signing jar contains relative elements

https://issues.apache.org/bugzilla/show_bug.cgi?id=50081

           Summary: SignJar: error signing if path for signing jar
                    contains relative elements
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: kirill.balod@gmail.com


If path for signing jar look like c:\aaa\..\bbb\my.jar and not destDir nor
destFile are defined sign procedure finish with error:
jzfile = 43261776,
total = 5, 
name = c:\bbb\my.jar\com.borland.orbit_8.2.3.v20101012-1621.jar,
i = 1, 
message = couldn't read LOC header
at java.util.zip.ZipFile$3.nextElement(ZipFile.java:429)
at java.util.zip.ZipFile$3.nextElement(ZipFile.java:415)
at sun.security.tools.JarSigner.getManifestFile(JarSigner.java:1449)
at sun.security.tools.JarSigner.signJar(JarSigner.java:836)
at sun.security.tools.JarSigner.run(JarSigner.java:194)
at sun.security.tools.JarSigner.main(JarSigner.java:75)

It happened because in SignJar.signOneJar(File jarSource, File jarTarget) 
jarSource = c:\aaa\..\bbb\my.jar
jarTarget = c:\bbb\my.jar
It points on the same file but !jarSource.equals(targetFile)
So code add "-signedjar" argument in command call but should not.

SignJar.signOneJar:377
        //DO NOT SET THE -signedjar OPTION if source==dest
        //unless you like fielding hotspot crash reports
        if (!jarSource.equals(targetFile)) {
            addValue(cmd, "-signedjar");
            addValue(cmd, targetFile.getPath());
        }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50081] SignJar: error signing if path for signing jar contains relative elements

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50081

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #3 from Stefan Bodewig <bo...@apache.org> 2010-10-22 10:46:37 EDT ---
Opening a bug report with Eclipse is fine, but then again we are providing
the task with a public API and so should be more defensive about the paths.

I'll get this fixed inside of Ant (as well - if the Eclipse people
could fix their side, it would benefit users of released versions of
Ant).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50081] SignJar: error signing if path for signing jar contains relative elements

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50081

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.8.2

--- Comment #4 from Stefan Bodewig <bo...@apache.org> 2010-10-25 05:10:45 EDT ---
svn revision 1026982

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50081] SignJar: error signing if path for signing jar contains relative elements

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50081

--- Comment #2 from Kirill <ki...@gmail.com> 2010-10-22 10:14:31 EDT ---
I'm sorry. I thought about it just after submitting this bug.
It is used via Java API in Eclipse PDE build.
I will submit bug in Eclipse bugzilla.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50081] SignJar: error signing if path for signing jar contains relative elements

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50081

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2010-10-22 10:09:48 EDT ---
Kiril, are you using the task from an ant build file or via its Java API.

When usied from the Ant API, the "jarSource" should have been "normalized" by
Ant and shpuld not contain any relative path remainders anymore.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.