summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Festi <ffesti@redhat.com>2022-08-03 17:19:02 +0200
committerPanu Matilainen <pmatilai@redhat.com>2022-09-02 08:48:10 +0300
commitb8bdbacecc68021244129568af7e7156b8b30e20 (patch)
treef8481e6c2ee8d1d41d6652eeb50810f329a0855a
parent4d8ac28bfe20cee2f29c6fbdb1e0e3f820521aed (diff)
downloadrpm-b8bdbacecc68021244129568af7e7156b8b30e20.tar.gz
rpm2cpio.sh: only read needed bytes of file magic
As we look at the first 4 bytes anyway there is no reason to read more. Reading more also hits a bug in bash on aarch64 (rhbz#2115206). (cherry picked from commit 8f922eb38a096640e586ba0eda96adc093b74fc4)
-rwxr-xr-xscripts/rpm2cpio.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/rpm2cpio.sh b/scripts/rpm2cpio.sh
index 74aeed851..cea0da21b 100755
--- a/scripts/rpm2cpio.sh
+++ b/scripts/rpm2cpio.sh
@@ -43,7 +43,7 @@ calcsize() {
offset=$(($offset + $rsize))
}
-case "$(_dd 0 bs=8 count=1 | tr -d '\0')" in
+case "$(_dd 0 bs=4 count=1 | tr -d '\0')" in
"$(printf '\355\253\356\333')"*) ;; # '\xed\xab\xee\xdb'
*) fatal "File doesn't look like rpm: $pkg" ;;
esac