Make rpm2cpio.sh more robust

Also reduce bytes read for checking the magic header to 4 as the zero
bytes read break on aarch64 for some reason.

Resolves: #1983015
This commit is contained in:
Florian Festi 2022-08-03 17:42:27 +02:00
parent 0a4ec89b01
commit e3ce4eba28
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ index 4531271cc..74aeed851 100755
}
-case "$(_dd 0 bs=8 count=1)" in
+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

View File

@ -32,7 +32,7 @@
%global rpmver 4.16.1.3
#global snapver rc1
%global rel 16
%global rel 17
%global sover 9
%global srcver %{rpmver}%{?snapver:-%{snapver}}
@ -614,7 +614,7 @@ fi
%doc doc/librpm/html/*
%changelog
* Fri Jul 22 2022 Florian Festi <ffesti@redhat.com> - 4.16.1.3-16
* Wed Aug 03 2022 Florian Festi <ffesti@redhat.com> - 4.16.1.3-17
- Make rpm2cpio.sh more robust (#1983015)
* Thu Jun 30 2022 Nick Clifton <nickc@redhat.com> - 4.16.1.3-15