aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-09-26 07:10:15 +0000
committerTimo Teräs <timo.teras@iki.fi>2017-09-26 07:12:54 +0000
commit1697a0c40bf4b94de03afba1d558ac2095c6dbcc (patch)
treee77eeab6b861fb2e2853011a5d2c089323578889
parent7626b4937b8a1abb3f4923c79d044bb4000291a7 (diff)
main/pax-utils: fix printing osabi, modernize
-rw-r--r--main/pax-utils/APKBUILD12
-rw-r--r--main/pax-utils/fix-eitype.patch28
2 files changed, 35 insertions, 5 deletions
diff --git a/main/pax-utils/APKBUILD b/main/pax-utils/APKBUILD
index 628f954c0ea..1e9cb019fa0 100644
--- a/main/pax-utils/APKBUILD
+++ b/main/pax-utils/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pax-utils
pkgver=1.2.2
-pkgrel=0
+pkgrel=1
pkgdesc="ELF related utils for ELF 32/64 binaries"
url="https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities"
arch="all"
@@ -11,18 +11,19 @@ depends="scanelf"
makedepends_build=""
makedepends_host="linux-headers libcap-dev"
makedepends="$makedepends_build $makedepends_host"
-source="http://distfiles.gentoo.org/distfiles/${pkgname}-${pkgver}.tar.xz"
+source="http://distfiles.gentoo.org/distfiles/${pkgname}-${pkgver}.tar.xz
+ fix-eitype.patch"
subpackages="$pkgname-doc scanelf:_scanelf"
builddir="$srcdir"/$pkgname-$pkgver
build() {
cd "$builddir"
- make USE_CAP=yes || return 1
+ make USE_CAP=yes
}
package() {
cd "$builddir"
- make DESTDIR="$pkgdir/" install || return 1
+ make DESTDIR="$pkgdir/" install
# Don't conflict with main/lddtree
rm -f "$pkgdir"/usr/bin/lddtree
@@ -36,4 +37,5 @@ _scanelf() {
mv "$pkgdir"/usr/bin/scanelf "$subpkgdir"/usr/bin/
}
-sha512sums="6bafe93f3b84d4595b6adfa09b46a3dd249f309fe836d90115e9aa5fcc7da37b03f743e80719dfe6bcdb739ce6ec3843170a5513e196c348721f850e19d3e38c pax-utils-1.2.2.tar.xz"
+sha512sums="6bafe93f3b84d4595b6adfa09b46a3dd249f309fe836d90115e9aa5fcc7da37b03f743e80719dfe6bcdb739ce6ec3843170a5513e196c348721f850e19d3e38c pax-utils-1.2.2.tar.xz
+7150f162a64d9095fab4f73c4a0c531550e2286d6e09a686c62b3a692353b9e33a770ad196f647b5f26b5acafcdef05187dc9d40b40b46d508900dc3e33324a6 fix-eitype.patch"
diff --git a/main/pax-utils/fix-eitype.patch b/main/pax-utils/fix-eitype.patch
new file mode 100644
index 00000000000..fe54ee88744
--- /dev/null
+++ b/main/pax-utils/fix-eitype.patch
@@ -0,0 +1,28 @@
+elf->data is 'signed char' and casting it to 'int' will sign extend.
+Most non-intrusive fix is to just have get_elfeitype() take type as
+'unsigned char' to make implicit cast.
+
+diff -ru pax-utils-1.2.2.orig/paxelf.c pax-utils-1.2.2/paxelf.c
+--- pax-utils-1.2.2.orig/paxelf.c 2017-01-24 20:24:53.000000000 +0000
++++ pax-utils-1.2.2/paxelf.c 2017-09-26 07:01:00.115498082 +0000
+@@ -65,7 +65,7 @@
+ QUERY(ELFOSABI_STANDALONE),
+ { 0, 0 }
+ };
+-const char *get_elfeitype(int ei_type, int type)
++const char *get_elfeitype(int ei_type, unsigned char type)
+ {
+ switch (ei_type) {
+ case EI_CLASS: return find_pairtype(elf_ei_class, type);
+diff -ru pax-utils-1.2.2.orig/paxelf.h pax-utils-1.2.2/paxelf.h
+--- pax-utils-1.2.2.orig/paxelf.h 2017-01-24 20:24:53.000000000 +0000
++++ pax-utils-1.2.2/paxelf.h 2017-09-26 07:00:44.941879820 +0000
+@@ -56,7 +56,7 @@
+ extern elfobj *_readelf(const char *filename, int read_only);
+ #define readelf(filename) _readelf(filename, 1)
+ extern void unreadelf(elfobj *elf);
+-extern const char *get_elfeitype(int ei_type, int type);
++extern const char *get_elfeitype(int ei_type, unsigned char type);
+ extern const char *get_elfetype(elfobj *elf);
+ extern const char *get_endian(elfobj *elf);
+ extern const char *get_elfosabi(elfobj *elf);