google / rpmpack

rpmpack (tar2rpm) - package rpms in pure golang or cli
Apache License 2.0
116 stars 32 forks source link

Size of payload in header is incorrect - should be size of compressed payload, not uncompressed #60

Open mharvey-jt opened 3 years ago

mharvey-jt commented 3 years ago

Hi,

The size of the payload written to the Size header is incorrect. It should be the length of the compressed payload, not the sun of the sizes of the uncompressed payload files. This makes the rpm2cpio program exit with a failure, as it does a comparison between the header value and that returned by librpm's ufdCopy() function.

jarondl commented 3 years ago

Are you sure? According to https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-package-structure.html

The RPMTAG_SIZE tag holds the size of all the regular files in the payload

Doesn't the error actually mean that the cpio size is incorrect?

Also, is this the same as #61? Does it happen only with certain compression algos?

mharvey-jt commented 3 years ago

Interesting, I hadn't found the spec, but rather come to that conclusion by comparison with distro rpms.