Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 235290 - app-arch/rpm2targz-9.0.0.1g doesn't work for gzip compressed rpm files
Summary: app-arch/rpm2targz-9.0.0.1g doesn't work for gzip compressed rpm files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 235339 235351 235514 235613 235777 235854 235909 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-20 13:53 UTC by Dmitry Karasik
Modified: 2008-09-10 09:43 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Karasik 2008-08-20 13:53:35 UTC
To reproduce the problem try running rpmoffset < /usr/portage/distfiles/RealPlayer11GOLD.rpm for example.

The problem is the change to explicitly specify unsigned char for p. This results in signed to unsigned comparison and promotion to int, which means p[1] == '\213' can never be true.
Comment 1 Jose daLuz 2008-08-21 02:19:31 UTC
Another example, this version causes build of dev-python-pyxf86config-0.3.34-r1 to fail during unpack. Downgrading to 9.0.0.0g eliminates this problem.
Comment 2 SpanKY gentoo-dev 2008-08-21 15:44:06 UTC
*** Bug 235351 has been marked as a duplicate of this bug. ***
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2008-08-21 21:54:22 UTC
*** Bug 235339 has been marked as a duplicate of this bug. ***
Comment 4 Ian Abbott 2008-08-22 21:58:59 UTC
Also, the condition in the 'for' loop is always true:

	for (i = 0; p[2] != 0 || p[2] != 0xff; ++i) {

I'm not sure what the original intention was there!


The original reported problem is easily fixed by using hex constants instead of character constants:

		if (p[0] == 0x1f && p[1] == 0x8b && p[2] == 0x08) {
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2008-08-23 13:10:02 UTC
*** Bug 235514 has been marked as a duplicate of this bug. ***
Comment 6 Jeremy Sermersheim 2008-08-23 19:43:53 UTC
Breaks the emerge of openoffice-bin-2.4.1....had to downgrade to install openoffice.
Comment 7 Rahul Jain 2008-08-24 13:51:59 UTC
Reason for failure of installation of netscape-flash. Had to downgrade to install. 
Comment 8 Rahul Jain 2008-08-24 13:54:27 UTC
Actually, my problem is with rpm2targz-9.0.0.0g. Does not work.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2008-08-25 01:19:58 UTC
*** Bug 235613 has been marked as a duplicate of this bug. ***
Comment 10 YetiBarBar 2008-08-26 12:09:15 UTC
Same problem here when trying to merge bjfilter (not a portage ebuild)

Downgrading to 9.0.0.0g worked
Comment 11 Jeroen Roovers (RETIRED) gentoo-dev 2008-08-26 17:47:02 UTC
*** Bug 235777 has been marked as a duplicate of this bug. ***
Comment 12 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-08-27 03:45:09 UTC
*** Bug 235854 has been marked as a duplicate of this bug. ***
Comment 13 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-08-27 14:04:35 UTC
*** Bug 235909 has been marked as a duplicate of this bug. ***
Comment 14 Robert Buchholz (RETIRED) gentoo-dev 2008-08-28 10:11:28 UTC
can we p.mask =app-arch/rpm2targz-9.0.0.1g ?
Comment 15 Dmitry Karasik 2008-08-28 18:04:11 UTC
Why can't you just fix it? It's a simple 1 line fix!
Comment 16 SpanKY gentoo-dev 2008-08-29 04:12:03 UTC
i was trying to fix a warning, but guess that didnt go so well

no idea what's with that for loop limit ... that was from the cleanup in Bug 219711

i just rewrote rpmoffset again to use stdio layers and be much faster
Comment 17 Dmitry Karasik 2008-08-29 13:00:45 UTC
It mostly works now however the move offset is wrong:

                memmove(p, p + read_cnt - MAGIC_SIZE - 1, MAGIC_SIZE - 1);

should probably be moved before left is adjusted and changed to:

                memmove(p, p + left + read_cnt - MAGIC_SIZE - 1, MAGIC_SIZE - 1);

Should I open a seperate bug for that?
Comment 18 Dmitry Karasik 2008-08-29 13:04:04 UTC
And of course I'm not perfect either :) It should be + 1, i.e.:

memmove(p, p + left + read_cnt - MAGIC_SIZE + 1, MAGIC_SIZE -
1);
Comment 19 Peter Volkov (RETIRED) gentoo-dev 2008-09-10 09:43:03 UTC
(In reply to comment #17)
> Should I open a seperate bug for that?

If there is a new bug, open a new bug report, please.