diff options
author | Florian Festi <ffesti@redhat.com> | 2022-08-03 17:19:02 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2022-09-02 08:48:10 +0300 |
commit | b8bdbacecc68021244129568af7e7156b8b30e20 (patch) | |
tree | f8481e6c2ee8d1d41d6652eeb50810f329a0855a | |
parent | 4d8ac28bfe20cee2f29c6fbdb1e0e3f820521aed (diff) | |
download | rpm-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-x | scripts/rpm2cpio.sh | 2 |
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 |