]> code.ossystems Code Review - openembedded-core.git/commit
rpm: fix intermittent compression failure in do_package_write_rpm
authorbkylerussell@gmail.com <bkylerussell@gmail.com>
Tue, 8 Feb 2022 12:15:08 +0000 (07:15 -0500)
committerSteve Sakoman <steve@sakoman.com>
Sat, 19 Feb 2022 19:59:34 +0000 (09:59 -1000)
commitb093005d31467d89b00af621f86eb5cac7f845af
tree57df2e5c68b591c4333b1b27efafa6bf0502ff4a
parentb293bcf4c312156cb57814dd71f13f8ab2a8ae80
rpm: fix intermittent compression failure in do_package_write_rpm

rpmbuild can start processing random memory when processing the value
provided by XZ_THREADS, and unintentionally disable encoding for a
file descriptor that in fact requires encoding to be enabled in order
for lzwrite() to actually create an rpm.

  *** Fdopen(0x7f2030002b30,w6T16.xzdio)  | fdio 23 fp (nil)
  ==>     lzopen_internal("w6T16", 23, 1)
  ==>     lzopen_internal set encoding
  ==>     lzopen_internal clear encoding
  ==> Fdopen(0x7f2030002b30,"w6T16.xzdio") returns fd 0x7f2030002b30      | xzdio 0x7f2030004e30 fp 23 | fdio -1 fp (nil)
  ==>     lzwrite(0x7f2030004e30, 0x7f20789d8070, 6) encoding 0
  ==>     Fwrite(0x7f2030002b30,0x7f20789d8070,6) rc -1   | xzdio 0x7f2030004e30 fp 23 | fdio -1 fp (nil)
  error: create archive failed: cpio: write

When the encoding bit gets cleared on the LZFILE* struct, lzwrite() then
rightfully complains when it detects !lzfile->encoding, which then gets
bubbled up as a write failure when we go to create the archive.

This fix is available in the rpm 4.17-release.

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-devtools/rpm/files/0001-rpmio-Fix-lzopen_internal-mode-parsing-when-Tn-is-us.patch [new file with mode: 0644]
meta/recipes-devtools/rpm/rpm_4.14.2.1.bb