Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-22 Thread Jeff Johnson
Good: identical problem accessing RPM_BIN_TYPE "drips" (i.e. signature tags 
appended to an immutable region).

The problem is in the API access, not in the format, so no painful hacky 
retrofit will be needed.

It sure would be nice to see the 1-line fix pushed back through "supported" 
platforms to prevent waiting another 4-5 years for the next bug report.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-367794187___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-22 Thread Panu Matilainen
Okay so that's actually the same thing as commit 
https://github.com/rpm-software-management/rpm/commit/59f8ca7b85c4fbaad088bd2ac313933c569e638e
 - at least in rpm.org count is set to entry->info.count at the beginning of 
the function so the assignment is just redundant. And yes that alone would've 
fixed the issue at hand.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-367650781___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-21 Thread Jeff Johnson
Here was the cvs checkin for the fix I mentioned: 

https://marc.info/?l=rpm-cvs&m=140579657517602&w=2

At that time, there was similar code in RPM4 header.c

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-367443948___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-21 Thread Jeff Johnson
(I'm sure you know this) NEVRA isn't unique even if commonly used, and pkgid is 
the only candidate for a unique id available for almost all *.rpm packages ever 
built without painful retrofits. The SHA1  hdrid is likelier to be noticed 
sooner because it maps directly into "what git does"' but a UUID representation 
permits choice of a identifier that can be implemented without enormous 
discussions.

It's not the count field in the package file, but rather the value returned 
through the API that goes awry.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-367380315___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-21 Thread Panu Matilainen
@n3npq , I know MD5 is used as the "pkgid" as well, but again that nobody has 
noticed speaks for itself - it's just not being used for much anything. We also 
already check for the count and such things these days. In *this* case it's not 
the package that has invalid count (the reproducer package is linked in the 
original libsolv ticket) but the import process that messes it up as explained 
in the commits.

The case you're talking about is likely something entirely different, which is 
of course not to say *that* bug doesn't exist in rpm.org, I'm quite positive 
there are any number of ancient lurkers still buried in there just waiting for 
their hour in the spotlight... So yeah it'd be interesting to see what the 
oneliner was in that case.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-367289518___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-20 Thread Jeff Johnson
@pmatilai: au contraire, the MD5 of the original package is the only 
"universal" (in the sense of being present all the way back to RPM2) 
precomputed  identifier for a *.rpm package if/when converted to a UUIDv3 (see 
the query format issue) to be (eventually) used as a database key rather than a 
cryptographic verification.

IIUC, you might want to check the MD5 tag count when retrieved from the 
signature header before being appended to the metadata header stored in an 
rpmdb. The root cause and best fix may be earlier in the retrieval.

The RPM5 issue was quite obscure, is/was triggered by padding in a signature 
header when mandatory  elliptic curve signatures were added, changing the tag 
content of a signature header. I'll dig out the one line change when I get a 
chance.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-366998156___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-20 Thread Panu Matilainen
Oh and thanks for reporting @mlschroe 

@n3npq FWIW, on rpm.org side this "only" affects headers coming from the rpmdb 
in rpm >= 4.10.0: the size in actual packages is correct in all versions that 
I'm aware of and the offset optimization is only used for headers coming from 
the rpmdb, not when reading packages from disk. I guess nobody has nobody has 
noticed simply because the md5sum of an already installed package is rather 
uninteresting.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-366954043___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-20 Thread Panu Matilainen
Probably many ways to fix, one supplied as commit 
0093584a6a3841bec0b355b8406d8929edbad205 now - the offset optimization that 
causes this just doesn't make any sense for non-string types anyway. The 
redundant assignment also now removed in commit 
59f8ca7b85c4fbaad088bd2ac313933c569e638e.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-366950806___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-20 Thread Panu Matilainen
Closed #398.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#event-1482216699___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-19 Thread Jeff Johnson
(from memory)
I think I fixed this problem 4-5 years ago in RPM5 (like rpm-5.4.15? I forget).

The MD5 tag length (and RPM_BIN_TYPE in general) includes padding (if present) 
to the next tag.

The bug only shows up if the next tag needs to be aligned.

The real fix wasn't hard, but was rather subtle and surprising.

The proposed fix special casing the MD5 tag is deficient because it ignores 
legacy compatibility: nearly all versions of rpm this century are affected.

Mark Hatle (from Poky/Yocto) likely can supply the actual patch I checked into 
RPM5. I was somewhat surprised at the time that the bug had never been reported 
against RPM4 with identical code.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398#issuecomment-366710446___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] RPM_BIN_TYPE get wrong length if HEADERIMPORT_FAST is used (#398)

2018-02-19 Thread Michael Schroeder
See https://github.com/openSUSE/libsolv/pull/255 for the background.

I think rpm should not overwrite the count with the entry length (line 1107 in 
header.c). I don't know if everything still works if the line is removed. 
Please investigate ;)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/398___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint