← Commit list

f13f68288

Denys Vlasenko
Denys Vlasenko
2025-04-20
SUCCESS Duration: 154s

Subject

rpm2cpio: extract cpio even if compression is not known

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/rpm.c+6 -1
@@ -533,6 +533,7 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
// /* We need to know whether child (gzip/bzip/etc) exits abnormally */
// signal(SIGCHLD, check_errors_in_children);
+ str = NULL;
if (ENABLE_FEATURE_SEAMLESS_LZMA
&& (str = rpm_getstr0(TAG_PAYLOADCOMPRESSOR)) != NULL
&& strcmp(str, "lzma") == 0
@@ -541,7 +542,11 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
// set up decompressor without detection
setup_lzma_on_fd(rpm_fd);
} else {
- setup_unzip_on_fd(rpm_fd, /*die_if_not_compressed:*/ 1);
+ int signature_bytes = setup_unzip_on_fd(rpm_fd, /*die_if_not_compressed:*/ 0);
+ if (signature_bytes != 0) {
+ xlseek(rpm_fd, - signature_bytes, SEEK_CUR);
+ bb_error_msg("warning, unknown compression '%s'", str);
+ }
}
if (bb_copyfd_eof(rpm_fd, STDOUT_FILENO) < 0)