Bug 243157

Summary: brp-java-repack-jars fails if jar file contains filenames with spaces
Product: Red Hat Enterprise Linux 5 Reporter: Roy Bonser <rbonser>
Component: redhat-rpm-configAssignee: Jon Masters <jcm>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: 5.0CC: jhutar, k.georgiou, mmalik, overholt
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 22:04:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for brp-java-repack-jars to fix the space issue
none
.src.rpm with jar which contains files with spaces in their names none

Description Roy Bonser 2007-06-07 16:19:55 UTC
Description of problem:
If a jar file contains files with spaces in their names, brp-java-repack-jars
produces errors.

When the results of the find command are fed to the for loop at line #65 the
filenames with spaces are split apart and produce invalid filenames for the
commands within the loop. This may also be a problem with other loops in the
script as well.

Version-Release number of selected component (if applicable):
redhat-rpm-config-8.0.45-17.0.1.el5

How reproducible:
Every time

Steps to Reproduce:
1. Create a jar file that contains files with spaces in their names
2. Build an rpm containing the jar file on x86_64.
3.
  
Actual results:


Expected results:


Additional info:
The problem, for me, showed up while packaging a piece of commercial software so
renaming the files is not an option.

Comment 1 Jeremy Katz 2007-06-19 18:32:11 UTC
*** Bug 207338 has been marked as a duplicate of this bug. ***

Comment 2 Peter Bieringer 2008-06-04 16:00:05 UTC
Created attachment 308362 [details]
Patch for brp-java-repack-jars to fix the space issue

Comment 3 RHEL Program Management 2008-07-21 23:11:02 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 5 RHEL Program Management 2008-07-28 20:11:11 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 6 Jan Hutaƙ 2008-07-30 08:45:03 UTC
Created attachment 312978 [details]
.src.rpm with jar which contains files with spaces in their names

(Thanks jcastro for that jar)
$ jar tvf with-spaces.jar 
    62 Wed Jul 30 10:04:12 CEST 2008 META-INF/MANIFEST.MF
   552 Wed Jul 30 09:51:52 CEST 2008 org/jboss/test/jar/Main.class
   226 Wed Jul 30 09:50:34 CEST 2008 .classpath
   362 Wed Jul 30 09:50:34 CEST 2008 .project
     0 Wed Jul 30 10:03:38 CEST 2008 resources/many spaces here

I can still reproduce with redhat-rpm-config-8.0.45-24.el5.noarch:

# rpmbuild --rebuild with-spaces-in-jar-0.1-1.src.rpm
...
+ /usr/lib/rpm/redhat/brp-java-repack-jars
cp: cannot stat `./resources/many': No such file or directory
cp: cannot stat `spaces': No such file or directory
cp: cannot stat `here': No such file or directory
Processing files: with-spaces-in-jar-0.1-1
...
Wrote: /usr/src/redhat/RPMS/i386/with-spaces-in-jar-0.1-1.i386.rpm
...
+ exit 0

Comment 8 Jon Masters 2008-09-18 12:12:28 UTC
In redhat-rpm-config-8_0_45-27_el5

Comment 13 errata-xmlrpc 2009-01-20 22:04:43 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0224.html