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).
This commit is contained in:
Florian Festi 2022-08-03 17:19:02 +02:00
parent 951f25bc84
commit 8f922eb38a
1 changed files with 1 additions and 1 deletions

View File

@ -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