summaryrefslogtreecommitdiff
path: root/app-misc/pax-utils
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-misc/pax-utils
reinit the tree, so we can have metadata
Diffstat (limited to 'app-misc/pax-utils')
-rw-r--r--app-misc/pax-utils/Manifest16
-rw-r--r--app-misc/pax-utils/files/0001-lddtree.py-work-around-pyelftools-API-change.patch29
-rw-r--r--app-misc/pax-utils/files/pax-utils-1.2.2-linux-2.6.32.patch65
-rw-r--r--app-misc/pax-utils/files/pax-utils-1.2.2-scanelf-fix-out-of-bounds-access-in-ia64.patch72
-rw-r--r--app-misc/pax-utils/files/pax-utils-1.2.2-solaris.patch181
-rw-r--r--app-misc/pax-utils/metadata.xml12
-rw-r--r--app-misc/pax-utils/pax-utils-1.1.6-r1.ebuild61
-rw-r--r--app-misc/pax-utils/pax-utils-1.1.6.ebuild57
-rw-r--r--app-misc/pax-utils/pax-utils-1.1.7.ebuild56
-rw-r--r--app-misc/pax-utils/pax-utils-1.2.2-r1.ebuild58
-rw-r--r--app-misc/pax-utils/pax-utils-1.2.2-r2.ebuild62
-rw-r--r--app-misc/pax-utils/pax-utils-1.2.2.ebuild56
12 files changed, 725 insertions, 0 deletions
diff --git a/app-misc/pax-utils/Manifest b/app-misc/pax-utils/Manifest
new file mode 100644
index 000000000000..9a9e1473bc70
--- /dev/null
+++ b/app-misc/pax-utils/Manifest
@@ -0,0 +1,16 @@
+AUX 0001-lddtree.py-work-around-pyelftools-API-change.patch 698 SHA256 027611780c24fb0211b6e95a6e00b33d21587d593b6d1ba5a76395d90bfdd398 SHA512 0de6faafa5fb7f6d45c42f84cf5f5aec728130507b4231f7bc2b6499481d2caca49151f9eb72bdf82856f771d91972e930871079e6434179492f7cae9463f890 WHIRLPOOL 7b38ee232b7d7a624139a13010b89648b935b3d7316f6064589b437e9565bffc472b8c1452cfffebb8259e619f7c1f18017b22cf81b052020d444037e0a35c06
+AUX pax-utils-1.2.2-linux-2.6.32.patch 2152 SHA256 3980f8f0b0125a033163af1499ad2c4eddb5eabdcb47eaae7397ed3788e6f0a9 SHA512 3a39e08e327e5389fb4a249dc27049a716695bd310197eafc54b62458e167eba53848e9fa3b0aa05e224a8f468fc130b979d0d314ca1dc8cbb0c5c494d67b352 WHIRLPOOL d520b4174667f68fdaa8220983a433ee255875d2fe672dec1d566d8b67e9a99803c821c2da804f1b60eee10428893bd82214e11b7e58318ecc8c0dd44a079e07
+AUX pax-utils-1.2.2-scanelf-fix-out-of-bounds-access-in-ia64.patch 2032 SHA256 aeda213844489fc4c08f114f057a3eda7825f3498cdc90b77f72bd4dfd7f1bbb SHA512 b0e0679c726acc56686b23b6d4720cd5b7e4dff3f007e0443e3ec37a434ffb2def2c351c81ef960bf8e1008769662851017ef9aaedc9b52890578db4d313a54e WHIRLPOOL 51b66b55530dbbf9320e352dd3a6b1731f785ce57d9c12237006bbf18e7da19b2dbd52f22744676c2ae1d66ba83197e4d9787f05827b6099a425707ebe8409a3
+AUX pax-utils-1.2.2-solaris.patch 5673 SHA256 dabf253d2399c3b31ebf2ca042a50e650c77ca170f64e170515cbab13e4453ba SHA512 df5cecdafe796fa7616767b93def2cd51d82a8911f7b195ca25048fb93a067a819cd362d3f5b4b02308ce67a688938a40aa2ecb04570d7bf3db83cb9847f62f1 WHIRLPOOL b14193d1871b6272f159e88c032a22808f47c6cb248c67b0f7ce6eb90409d53162b15c7df3778757c0c86af54ac8be1e19477f46d93a39fda5338d4289bf611d
+DIST pax-utils-1.1.6.tar.xz 647308 SHA256 f5436c517bea40f7035ec29a6f34034c739b943f2e3a080d76df5dfd7fd41b12 SHA512 c5bdb3ee076c5f4d026f811a59329014c539e3bb3ab45aec92564dcc4abcedaebc50bec55c37aeccfe9e31c554ec7789426fcb3d6f67a8d805843f32c5993f94 WHIRLPOOL 6addfc63dd821a3a0f1ebb2f0545bf81b933bed7aa4950efc51c4af3c8a9dd2263fe09c469bb371a5cb7ae239db646876548a2c21b08c1ed87dd974228eb2679
+DIST pax-utils-1.1.7.tar.xz 648376 SHA256 bb9bdbf0888de9444b53b78f7b8069af9832bac7cef0588030b8ce49e8ebad10 SHA512 cec176cf5863b15acc058cbd99639f5f456346136d0551ce5875cb66c28dd0f6e7f5077b0c06751a3a68984b5c4386c232d3db8b76aa4f4b326b0b692835fdeb WHIRLPOOL 07972470889ff3f4a85f1528bc6c49ae11c3161dfe0df4ab0c3ea83affdc36d0fce36f4db5a0811290958d51e477da99476a12bf35108c4a3b147004a0584541
+DIST pax-utils-1.2.2.tar.xz 655964 SHA256 7f4a7f8db6b4743adde7582fa48992ad01776796fcde030683732f56221337d9 SHA512 6bafe93f3b84d4595b6adfa09b46a3dd249f309fe836d90115e9aa5fcc7da37b03f743e80719dfe6bcdb739ce6ec3843170a5513e196c348721f850e19d3e38c WHIRLPOOL c95ce5dc26d7e913d9e0963d47b5cedbc71cb1faf52ca7bb04898b2bcaa9f6c521f2236e2475d41954c93061267f0fcca5053d4dae3cf12bb59fdc986612dfdb
+EBUILD pax-utils-1.1.6-r1.ebuild 1637 SHA256 fd24ff4711211fc878cb854eaca373be93c4d5c1a32325d78d1b0b6073e55e79 SHA512 bac13439a4dd3124333a1660a616510328d3bd458980ddc70b2fc72944f51dc0d429d5f0fac8d3093b8a20c9f3472be509ff18343988f1cb8b2ba44f476a5d6e WHIRLPOOL 48e6242b7341ea7effdb7b33af92b2a8a96a9abc3588dee5827546bd292bed8b2d4638737dc398143230c7ab68275cdd8de4ce0b3a6e3ba7b2b93d4c429e0331
+EBUILD pax-utils-1.1.6.ebuild 1416 SHA256 5b00c63c492a34e5bdab68d60c158af000a6b92d44614e04a26568fe9dd944c0 SHA512 74497bc240519378ec564f2374edfe39da3eb79d35666bae424c94b62c24ed65ebeb172bb0b6bf19c1786653b82da14eb354d9bc9126f505875c3c5644163925 WHIRLPOOL 27f8cfd029129c1ca165a6cb64f39b13fa5977f4e777b64547182a9a98015eab27f371c89d3526c593a754991bd3a5c5f83cfa5021b7fd99b9d51b985c6b8f81
+EBUILD pax-utils-1.1.7.ebuild 1484 SHA256 d528431e1d7cdc60394a14e8a5b1569a15363de6e20f6384930ec8d59686e860 SHA512 b4974eb1d8e2c1a7958cdbd8ebc33c5120fe84b6050094400bb86ec7ba8c883a2b06171c8aa8a7cc7f66bd5a18057cabfa6a3afc1662cb5b4c6bca95da39592b WHIRLPOOL 312bf2b3035d6f0053aa9b4ad4c017391ccadd43b615780803f0a758e82d78e8e3f20ac3cf439377eae3cd013209d155a6a2bca961ad9ab7e6dd85d3c221d34c
+EBUILD pax-utils-1.2.2-r1.ebuild 1572 SHA256 27f6bd1bbb4e8b4c4065276a30d8484b45d12f7907388aafb9449b940b20647a SHA512 72474cd91e454c095154b8841410b922cf120370b4b2cb1a5451bcb71a6c94a880d5373b6fc50157e2e4e5a7e32a0eb3df250a71d64af533c7989e5ad585650a WHIRLPOOL 053ccbde01d72a483c989cc14128f8dd46291c0bec2beb5a88d21f7d7cbc8b28a3c03b8a2ffec8acfa14a490991a95cf759109a60514daa53e66abe004c09a92
+EBUILD pax-utils-1.2.2-r2.ebuild 1648 SHA256 cef03988b5e7ce368e29092fdbeebc6f4df52a8acd8a2e7df1404f8ae0177bb1 SHA512 9da01fc5f44e983de46d7ec2003d05ba295e762a573a2db9c4fc722fe4e7dac5ff4fd4e9d86a00ce604e19fa01e63e8735735c02caa7d7a64622fd39a561adc9 WHIRLPOOL bbb41d56026220995dec846ed8bd05321a101a1aedc5be1832c904dd3b164fd1e7866aa4315c4b059a51dcba855abce8eb397cfca1bef03e6bcda84c5ebf4927
+EBUILD pax-utils-1.2.2.ebuild 1497 SHA256 bb8e2231396049833d5dae9e08017cab527ddae7e43dd0190d0d613dec14148a SHA512 1e8c25973b57212ac6ccea812e20e444fa45488acf5def5bc661aa4b23a8cf50e48815f9470febab3a825bb06582824f009aa7abf2a18b0c5d02de4eea8b30fd WHIRLPOOL 09809b7d38dfbd323b7ed792a76d61a2f43bbbb962ac191f3402a5572513544a78eeb25bfbbbeb819184f34de17cea815c21c5fe7d84ea72b9d1e41ed4ec6dca
+MISC ChangeLog 8224 SHA256 dcc36a07e9e840078e14cc5a0f35e924ae0c62e392395c2cd5d1482ad3063ede SHA512 1e52eb773a4bd8aee862e47278c7d5a73aeca0adaefb59f014553e32186252e7b0372f0510ce7c63f3f949183caad7f3a01d4e22858b3f48ec0e684d0cf5409f WHIRLPOOL 08d75f7e3e2b9b01e62c83231251d0cd30d99a8d4bbbb1488684aec53601abfee0000cf8c45d850b70ac439f5b07135b053abd0d196c36b6074ae52e49703820
+MISC ChangeLog-2015 25321 SHA256 d9fc5939318d48eb09554845e49ffdd2bd81d7700ea1a2eb3a245eac23de0523 SHA512 00829c624168f920c69bd64fcc4923d10df556d86484137c6f381d81a0f166e3f2b58559bf5a53d19a5fd608498b2b827b72d3bb31254e5e4b625dcbc6b88d05 WHIRLPOOL 2a6014ed7565ce08f011c6306592185831fa2a4c191eb9650c87927ba5715504cf958b6438ec28c7bfda9c3349fec8db3b39039abd97fb8a0b9ff3717bfff6a4
+MISC metadata.xml 584 SHA256 5aa079a277468814cecc8dd01365e017de646a3786b561c001a7398e7747f047 SHA512 d8458090413d52aaa38b6867edf0a9f996e08b36f9750bfa2469c2aa7d6b0718157feace3dbbb3c63c2795e977ddd6a9c637223192dff90e8ca87facb730bdf4 WHIRLPOOL d745c0db8e85f85c968fea5408a05c6585d54774bc3f953b1debb0ec17b7ce5d942cd1e048026f1a790bc56aa20f3301f973c5e02dd5da24f47d725f6652f5be
diff --git a/app-misc/pax-utils/files/0001-lddtree.py-work-around-pyelftools-API-change.patch b/app-misc/pax-utils/files/0001-lddtree.py-work-around-pyelftools-API-change.patch
new file mode 100644
index 000000000000..7a8b74ea1e03
--- /dev/null
+++ b/app-misc/pax-utils/files/0001-lddtree.py-work-around-pyelftools-API-change.patch
@@ -0,0 +1,29 @@
+From 6557b1512ebfda508345e032e09ed85789c16c98 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 8 Nov 2016 15:37:27 -0500
+Subject: [PATCH] lddtree.py: work around pyelftools API change
+
+Section names now get returned as strings rather than bytes. See
+108eaea9 upstream.
+
+Bug: https://bugs.gentoo.org/599082
+---
+ lddtree.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/lddtree.py b/lddtree.py
+index 3971a9a..8480248 100755
+--- a/lddtree.py
++++ b/lddtree.py
+@@ -72,6 +72,8 @@ def dbg(debug, *args, **kwargs):
+
+ def bstr(buf):
+ """Decode the byte string into a string"""
++ if isinstance(buf, str):
++ return buf
+ return buf.decode('utf-8')
+
+
+--
+2.10.2
+
diff --git a/app-misc/pax-utils/files/pax-utils-1.2.2-linux-2.6.32.patch b/app-misc/pax-utils/files/pax-utils-1.2.2-linux-2.6.32.patch
new file mode 100644
index 000000000000..8139310b2e0b
--- /dev/null
+++ b/app-misc/pax-utils/files/pax-utils-1.2.2-linux-2.6.32.patch
@@ -0,0 +1,65 @@
+This is the diff for generated sources after applying:
+https://github.com/gentoo/pax-utils/pull/2
+
+diff -ru pax-utils-HEAD.orig/config.h.in pax-utils-HEAD/config.h.in
+--- pax-utils-HEAD.orig/config.h.in 2017-04-18 16:26:42.000000000 +0200
++++ pax-utils-HEAD/config.h.in 2017-04-18 16:28:05.000000000 +0200
+@@ -526,6 +526,9 @@
+ /* Define to 1 if you have the `link' function. */
+ #undef HAVE_LINK
+
++/* Define to 1 if you have the <linux/securebits.h> header file. */
++#undef HAVE_LINUX_SECUREBITS_H
++
+ /* Define to 1 if the system has the type 'long long int'. */
+ #undef HAVE_LONG_LONG_INT
+
+diff -ru pax-utils-HEAD.orig/configure pax-utils-HEAD/configure
+--- pax-utils-HEAD.orig/configure 2017-04-18 16:26:41.000000000 +0200
++++ pax-utils-HEAD/configure 2017-04-18 16:28:03.000000000 +0200
+@@ -34537,6 +34537,19 @@
+
+
+
++for ac_header in linux/securebits.h
++do :
++ ac_fn_c_check_header_mongrel "$LINENO" "linux/securebits.h" "ac_cv_header_linux_securebits_h" "$ac_includes_default"
++if test "x$ac_cv_header_linux_securebits_h" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LINUX_SECUREBITS_H 1
++_ACEOF
++
++fi
++
++done
++
++
+ ac_config_files="$ac_config_files Makefile autotools/gnulib/Makefile"
+
+ cat >confcache <<\_ACEOF
+diff -ru pax-utils-HEAD.orig/configure.ac pax-utils-HEAD/configure.ac
+--- pax-utils-HEAD.orig/configure.ac 2017-04-18 16:25:48.000000000 +0200
++++ pax-utils-HEAD/configure.ac 2017-04-18 16:27:11.000000000 +0200
+#@@ -62,6 +62,8 @@
+ AX_CHECK_COMPILE_FLAG(flag, AS_VAR_APPEND([CFLAGS], " flag"))
+ ])
+
++AC_CHECK_HEADERS([linux/securebits.h])
++
+ AC_CONFIG_FILES([
+ Makefile
+ autotools/gnulib/Makefile
+diff -ru pax-utils-HEAD.orig/porting.h pax-utils-HEAD/porting.h
+--- pax-utils-HEAD.orig/porting.h 2017-03-03 21:07:15.000000000 +0100
++++ pax-utils-HEAD/porting.h 2017-04-18 16:18:22.000000000 +0200
+@@ -46,7 +46,9 @@
+ #endif
+ #if defined(__linux__)
+ # include <sys/prctl.h>
+-# include <linux/securebits.h>
++# if !defined(HAVE_CONFIG_H) || defined(HAVE_LINUX_SECUREBITS_H)
++# include <linux/securebits.h>
++# endif
+ #endif
+ #if defined(__GLIBC__) || defined(__UCLIBC__) || defined(__ANDROID__)
+ # include <byteswap.h>
diff --git a/app-misc/pax-utils/files/pax-utils-1.2.2-scanelf-fix-out-of-bounds-access-in-ia64.patch b/app-misc/pax-utils/files/pax-utils-1.2.2-scanelf-fix-out-of-bounds-access-in-ia64.patch
new file mode 100644
index 000000000000..1fa5c3187e5a
--- /dev/null
+++ b/app-misc/pax-utils/files/pax-utils-1.2.2-scanelf-fix-out-of-bounds-access-in-ia64.patch
@@ -0,0 +1,72 @@
+From e95103c40d0541fbcdb4b84b000832d9b1b83b8d Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sat, 19 Aug 2017 10:34:41 +0100
+Subject: [PATCH] scanelf: fix out-of-bounds access in ia64
+
+commit 2eb852129394f97dae89c0ff1f9f48637edcb0e9
+slightly changed decoder and added unchecked
+read from elf header:
+
+```
+ switch (EGET(dpltrel->d_un.d_val)) { \
+ case DT_REL: \
+ rel = REL##B(elf->vdata + EGET(drel->d_un.d_val)); \
+```
+
+On ia64 'EGET(drel->d_un.d_val)' returns absolute address:
+
+```
+ $ dumpelf bug/luatex
+ ...
+ /* Dynamic tag #31 'DT_RELA' 0x97E310 */
+ {
+ .d_tag = 0x7 ,
+ .d_un = {
+ .d_val = 0x4000000000031C30 ,
+ .d_ptr = 0x4000000000031C30 ,
+ },
+ },
+```
+
+That causes 'scanelf' crash on binaries like 'luatex'.
+
+This change restores check and loudly skips such sections:
+ scanelf: bug/luatex: DT_RELA is out of file range
+
+Bug: https://bugs.gentoo.org/624356
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ scanelf.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/scanelf.c b/scanelf.c
+index 1ead891..a054408 100644
+--- a/scanelf.c
++++ b/scanelf.c
+@@ -607,11 +607,23 @@ static char *scanelf_file_textrels(elfobj *elf, char *found_textrels, char *foun
+ } \
+ switch (EGET(dpltrel->d_un.d_val)) { \
+ case DT_REL: \
++ if (EGET(drel->d_un.d_val) >= (uint64_t)elf->len - sizeof (drel->d_un.d_val)) { \
++ rel = NULL; \
++ rela = NULL; \
++ warn("%s: DT_REL is out of file range", elf->filename); \
++ break; \
++ } \
+ rel = REL##B(elf->vdata + EGET(drel->d_un.d_val)); \
+ rela = NULL; \
+ pltrel = DT_REL; \
+ break; \
+ case DT_RELA: \
++ if (EGET(drel->d_un.d_val) >= (uint64_t)elf->len - sizeof (drel->d_un.d_val)) { \
++ rel = NULL; \
++ rela = NULL; \
++ warn("%s: DT_RELA is out of file range", elf->filename); \
++ break; \
++ } \
+ rel = NULL; \
+ rela = RELA##B(elf->vdata + EGET(drel->d_un.d_val)); \
+ pltrel = DT_RELA; \
+--
+2.14.1
+
diff --git a/app-misc/pax-utils/files/pax-utils-1.2.2-solaris.patch b/app-misc/pax-utils/files/pax-utils-1.2.2-solaris.patch
new file mode 100644
index 000000000000..de1427f99bd7
--- /dev/null
+++ b/app-misc/pax-utils/files/pax-utils-1.2.2-solaris.patch
@@ -0,0 +1,181 @@
+This is the diff for generated sources after applying:
+https://github.com/gentoo/pax-utils/pull/1
+
+diff -ruN pax-utils-1.2.2.orig/autotools/gnulib/Makefile.in pax-utils-1.2.2/autotools/gnulib/Makefile.in
+--- pax-utils-1.2.2.orig/autotools/gnulib/Makefile.in 2017-01-24 21:30:06.000000000 +0100
++++ pax-utils-1.2.2/autotools/gnulib/Makefile.in 2017-03-15 10:59:05.616490166 +0100
+@@ -1483,7 +1484,7 @@
+ $(top_srcdir)/autotools/snippet/c++defs.h \
+ $(top_srcdir)/autotools/snippet/warn-on-use.h stat.c \
+ stat-time.h stdbool.in.h stddef.in.h stdint.in.h stdio.in.h \
+- stdlib.in.h strcasecmp.c strncasecmp.c str-two-way.h \
++ stdlib.in.h stpcpy.c strcasecmp.c strncasecmp.c str-two-way.h \
+ strcasestr.c strdup.c strerror.c strerror-override.c \
+ strerror-override.h string.in.h strings.in.h strncat.c \
+ symlink.c at-func.c symlinkat.c sys_stat.in.h sys_time.in.h \
+@@ -1546,7 +1547,7 @@
+ msvc-nothrow.c open.c openat.c opendir.c printf-frexp.c \
+ readlink.c at-func.c readlinkat.c realloc.c rename.c \
+ at-func2.c renameat.c rmdir.c signbitd.c signbitf.c signbitl.c \
+- stat.c strcasecmp.c strncasecmp.c strcasestr.c strdup.c \
++ stat.c stpcpy.c strcasecmp.c strncasecmp.c strcasestr.c strdup.c \
+ strerror.c strerror-override.c strncat.c symlink.c at-func.c \
+ symlinkat.c unlink.c at-func.c unlinkat.c at-func.c \
+ utimensat.c asnprintf.c printf-args.c printf-parse.c \
+@@ -1708,6 +1709,7 @@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-time.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statat.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stpcpy.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasestr.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@
+diff -ruN pax-utils-1.2.2.orig/autotools/gnulib/stpcpy.c pax-utils-1.2.2/autotools/gnulib/stpcpy.c
+--- pax-utils-1.2.2.orig/autotools/gnulib/stpcpy.c 1970-01-01 01:00:00.000000000 +0100
++++ pax-utils-1.2.2/autotools/gnulib/stpcpy.c 2017-03-15 10:59:24.159820259 +0100
+@@ -0,0 +1,49 @@
++/* stpcpy.c -- copy a string and return pointer to end of new string
++ Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2017 Free Software
++ Foundation, Inc.
++
++ NOTE: The canonical source of this file is maintained with the GNU C Library.
++ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
++
++ This program is free software: you can redistribute it and/or modify it
++ under the terms of the GNU General Public License as published by the
++ Free Software Foundation; either version 3 of the License, or any
++ later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
++
++#include <config.h>
++
++#include <string.h>
++
++#undef __stpcpy
++#ifdef _LIBC
++# undef stpcpy
++#endif
++
++#ifndef weak_alias
++# define __stpcpy stpcpy
++#endif
++
++/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
++char *
++__stpcpy (char *dest, const char *src)
++{
++ register char *d = dest;
++ register const char *s = src;
++
++ do
++ *d++ = *s;
++ while (*s++ != '\0');
++
++ return d - 1;
++}
++#ifdef weak_alias
++weak_alias (__stpcpy, stpcpy)
++#endif
+diff -ruN pax-utils-1.2.2.orig/config.h.in pax-utils-1.2.2/config.h.in
+--- pax-utils-1.2.2.orig/config.h.in 2017-01-24 21:30:04.000000000 +0100
++++ pax-utils-1.2.2/config.h.in 2017-03-15 11:01:30.156464381 +0100
+@@ -264,6 +264,9 @@
+ /* Define to 1 when the gnulib module stat should be tested. */
+ #undef GNULIB_TEST_STAT
+
++/* Define to 1 when the gnulib module stpcpy should be tested. */
++#undef GNULIB_TEST_STPCPY
++
+ /* Define to 1 when the gnulib module strcasestr should be tested. */
+ #undef GNULIB_TEST_STRCASESTR
+
+@@ -1415,6 +1418,9 @@
+ /* Define to 1 if you have the <stdlib.h> header file. */
+ #undef HAVE_STDLIB_H
+
++/* Define to 1 if you have the `stpcpy' function. */
++#undef HAVE_STPCPY
++
+ /* Define to 1 if you have the `strcasecmp' function. */
+ #undef HAVE_STRCASECMP
+
+diff -ruN pax-utils-1.2.2.orig/configure pax-utils-1.2.2/configure
+--- pax-utils-1.2.2.orig/configure 2017-01-24 21:30:03.000000000 +0100
++++ pax-utils-1.2.2/configure 2017-03-15 11:02:09.889790417 +0100
+@@ -31596,6 +31597,57 @@
+
+
+
++
++
++
++
++
++ for ac_func in stpcpy
++do :
++ ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy"
++if test "x$ac_cv_func_stpcpy" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_STPCPY 1
++_ACEOF
++
++fi
++done
++
++ if test $ac_cv_func_stpcpy = no; then
++ HAVE_STPCPY=0
++ fi
++
++ if test $HAVE_STPCPY = 0; then
++
++
++
++
++
++
++
++
++ gl_LIBOBJS="$gl_LIBOBJS stpcpy.$ac_objext"
++
++
++ :
++
++ fi
++
++
++
++
++
++ GNULIB_STPCPY=1
++
++
++
++
++
++$as_echo "#define GNULIB_TEST_STPCPY 1" >>confdefs.h
++
++
++
++
+
+
+ for ac_func in strcasecmp
+diff -ruN pax-utils-1.2.2.orig/Makefile.in pax-utils-1.2.2/Makefile.in
+--- pax-utils-1.2.2.orig/Makefile.in 2017-01-24 21:30:06.000000000 +0100
++++ pax-utils-1.2.2/Makefile.in 2017-03-15 11:03:01.856447406 +0100
+@@ -1522,7 +1523,7 @@
+ security.c \
+ xfuncs.c
+
+-LDADD = libpaxutils.la $(top_builddir)/autotools/gnulib/libgnu.a
++LDADD = libpaxutils.la $(top_builddir)/autotools/gnulib/libgnu.a $(LIB_EACCESS)
+ bin_SCRIPTS = lddtree symtree
+ CLEANFILES = $(bin_SCRIPTS)
+ TMAKE = \
diff --git a/app-misc/pax-utils/metadata.xml b/app-misc/pax-utils/metadata.xml
new file mode 100644
index 000000000000..73cd9cec1c9f
--- /dev/null
+++ b/app-misc/pax-utils/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>vapier@gentoo.org</email>
+ <description>Maintainer</description>
+ </maintainer>
+ <longdescription>A suite of ELF tools to aid auditing systems. Contains various ELF related utils for ELF32, ELF64 binaries useful for displaying PaX and security info on a large groups of binary files.</longdescription>
+ <use>
+ <flag name="python">Install a more powerful/faster version of lddtree</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-misc/pax-utils/pax-utils-1.1.6-r1.ebuild b/app-misc/pax-utils/pax-utils-1.1.6-r1.ebuild
new file mode 100644
index 000000000000..e5a993a7e987
--- /dev/null
+++ b/app-misc/pax-utils/pax-utils-1.1.6-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs unpacker
+
+DESCRIPTION="ELF utils that can check files for security relevant properties"
+HOMEPAGE="https://wiki.gentoo.org/index.php?title=Project:Hardened/PaX_Utilities"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~solar/pax/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="caps debug python seccomp"
+
+RDEPEND="caps? ( >=sys-libs/libcap-2.24 )
+ python? ( dev-python/pyelftools )
+ seccomp? ( sys-libs/libseccomp )"
+DEPEND="${RDEPEND}
+ caps? ( virtual/pkgconfig )
+ seccomp? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+_emake() {
+ emake \
+ USE_CAP=$(usex caps) \
+ USE_DEBUG=$(usex debug) \
+ USE_PYTHON=$(usex python) \
+ USE_SECCOMP=$(usex seccomp) \
+ "$@"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/0001-lddtree.py-work-around-pyelftools-API-change.patch"
+}
+
+src_configure() {
+ # Avoid slow configure+gnulib+make if on an up-to-date Linux system
+ if use prefix || ! use kernel_linux || \
+ has_version '<sys-libs/glibc-2.10'
+ then
+ econf $(use_with caps) $(use_with debug) $(use_with python) $(use_with seccomp)
+ else
+ tc-export CC PKG_CONFIG
+ fi
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ _emake DESTDIR="${D}" PKGDOCDIR='$(DOCDIR)'/${PF} install
+}
diff --git a/app-misc/pax-utils/pax-utils-1.1.6.ebuild b/app-misc/pax-utils/pax-utils-1.1.6.ebuild
new file mode 100644
index 000000000000..3696902fdd35
--- /dev/null
+++ b/app-misc/pax-utils/pax-utils-1.1.6.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs unpacker
+
+DESCRIPTION="ELF utils that can check files for security relevant properties"
+HOMEPAGE="https://wiki.gentoo.org/index.php?title=Project:Hardened/PaX_Utilities"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~solar/pax/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="caps debug python seccomp"
+
+RDEPEND="caps? ( >=sys-libs/libcap-2.24 )
+ python? ( dev-python/pyelftools )
+ seccomp? ( sys-libs/libseccomp )"
+DEPEND="${RDEPEND}
+ caps? ( virtual/pkgconfig )
+ seccomp? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+_emake() {
+ emake \
+ USE_CAP=$(usex caps) \
+ USE_DEBUG=$(usex debug) \
+ USE_PYTHON=$(usex python) \
+ USE_SECCOMP=$(usex seccomp) \
+ "$@"
+}
+
+src_configure() {
+ # Avoid slow configure+gnulib+make if on an up-to-date Linux system
+ if use prefix || ! use kernel_linux || \
+ has_version '<sys-libs/glibc-2.10'
+ then
+ econf $(use_with caps) $(use_with debug) $(use_with python) $(use_with seccomp)
+ else
+ tc-export CC PKG_CONFIG
+ fi
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ _emake DESTDIR="${D}" PKGDOCDIR='$(DOCDIR)'/${PF} install
+}
diff --git a/app-misc/pax-utils/pax-utils-1.1.7.ebuild b/app-misc/pax-utils/pax-utils-1.1.7.ebuild
new file mode 100644
index 000000000000..7c362e60f15f
--- /dev/null
+++ b/app-misc/pax-utils/pax-utils-1.1.7.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs unpacker
+
+DESCRIPTION="ELF utils that can check files for security relevant properties"
+HOMEPAGE="https://wiki.gentoo.org/index.php?title=Project:Hardened/PaX_Utilities"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="caps debug python seccomp"
+
+RDEPEND="caps? ( >=sys-libs/libcap-2.24 )
+ python? ( dev-python/pyelftools )
+ seccomp? ( sys-libs/libseccomp )"
+DEPEND="${RDEPEND}
+ caps? ( virtual/pkgconfig )
+ seccomp? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+_emake() {
+ emake \
+ USE_CAP=$(usex caps) \
+ USE_DEBUG=$(usex debug) \
+ USE_PYTHON=$(usex python) \
+ USE_SECCOMP=$(usex seccomp) \
+ "$@"
+}
+
+src_configure() {
+ # Avoid slow configure+gnulib+make if on an up-to-date Linux system
+ if use prefix || ! use kernel_linux || \
+ has_version '<sys-libs/glibc-2.10'
+ then
+ econf $(use_with caps) $(use_with debug) $(use_with python) $(use_with seccomp)
+ else
+ tc-export CC PKG_CONFIG
+ fi
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ _emake DESTDIR="${D}" PKGDOCDIR='$(DOCDIR)'/${PF} install
+}
diff --git a/app-misc/pax-utils/pax-utils-1.2.2-r1.ebuild b/app-misc/pax-utils/pax-utils-1.2.2-r1.ebuild
new file mode 100644
index 000000000000..ba368f7be676
--- /dev/null
+++ b/app-misc/pax-utils/pax-utils-1.2.2-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils toolchain-funcs unpacker
+
+DESCRIPTION="ELF utils that can check files for security relevant properties"
+HOMEPAGE="https://wiki.gentoo.org/index.php?title=Project:Hardened/PaX_Utilities"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="caps debug python seccomp"
+
+RDEPEND="caps? ( >=sys-libs/libcap-2.24 )
+ python? ( dev-python/pyelftools )
+ seccomp? ( sys-libs/libseccomp )"
+DEPEND="${RDEPEND}
+ caps? ( virtual/pkgconfig )
+ seccomp? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+PATCHES=("${FILESDIR}"/${P}-scanelf-fix-out-of-bounds-access-in-ia64.patch)
+
+_emake() {
+ emake \
+ USE_CAP=$(usex caps) \
+ USE_DEBUG=$(usex debug) \
+ USE_PYTHON=$(usex python) \
+ USE_SECCOMP=$(usex seccomp) \
+ "$@"
+}
+
+src_configure() {
+ # Avoid slow configure+gnulib+make if on an up-to-date Linux system
+ if use prefix || ! use kernel_linux || \
+ has_version '<sys-libs/glibc-2.10'
+ then
+ econf $(use_with caps) $(use_with debug) $(use_with python) $(use_with seccomp)
+ else
+ tc-export CC PKG_CONFIG
+ fi
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ _emake DESTDIR="${D}" PKGDOCDIR='$(DOCDIR)'/${PF} install
+}
diff --git a/app-misc/pax-utils/pax-utils-1.2.2-r2.ebuild b/app-misc/pax-utils/pax-utils-1.2.2-r2.ebuild
new file mode 100644
index 000000000000..26ac45008744
--- /dev/null
+++ b/app-misc/pax-utils/pax-utils-1.2.2-r2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils toolchain-funcs unpacker
+
+DESCRIPTION="ELF utils that can check files for security relevant properties"
+HOMEPAGE="https://wiki.gentoo.org/index.php?title=Project:Hardened/PaX_Utilities"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="caps debug python seccomp"
+
+RDEPEND="caps? ( >=sys-libs/libcap-2.24 )
+ python? ( dev-python/pyelftools )
+ seccomp? ( sys-libs/libseccomp )"
+DEPEND="${RDEPEND}
+ caps? ( virtual/pkgconfig )
+ seccomp? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-scanelf-fix-out-of-bounds-access-in-ia64.patch
+ "${FILESDIR}"/${P}-solaris.patch
+ "${FILESDIR}"/${P}-linux-2.6.32.patch
+)
+
+_emake() {
+ emake \
+ USE_CAP=$(usex caps) \
+ USE_DEBUG=$(usex debug) \
+ USE_PYTHON=$(usex python) \
+ USE_SECCOMP=$(usex seccomp) \
+ "$@"
+}
+
+src_configure() {
+ # Avoid slow configure+gnulib+make if on an up-to-date Linux system
+ if use prefix || ! use kernel_linux || \
+ has_version '<sys-libs/glibc-2.10'
+ then
+ econf $(use_with caps) $(use_with debug) $(use_with python) $(use_with seccomp)
+ else
+ tc-export CC PKG_CONFIG
+ fi
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ _emake DESTDIR="${D}" PKGDOCDIR='$(DOCDIR)'/${PF} install
+}
diff --git a/app-misc/pax-utils/pax-utils-1.2.2.ebuild b/app-misc/pax-utils/pax-utils-1.2.2.ebuild
new file mode 100644
index 000000000000..b40fc4f31b49
--- /dev/null
+++ b/app-misc/pax-utils/pax-utils-1.2.2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs unpacker
+
+DESCRIPTION="ELF utils that can check files for security relevant properties"
+HOMEPAGE="https://wiki.gentoo.org/index.php?title=Project:Hardened/PaX_Utilities"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="caps debug python seccomp"
+
+RDEPEND="caps? ( >=sys-libs/libcap-2.24 )
+ python? ( dev-python/pyelftools )
+ seccomp? ( sys-libs/libseccomp )"
+DEPEND="${RDEPEND}
+ caps? ( virtual/pkgconfig )
+ seccomp? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+_emake() {
+ emake \
+ USE_CAP=$(usex caps) \
+ USE_DEBUG=$(usex debug) \
+ USE_PYTHON=$(usex python) \
+ USE_SECCOMP=$(usex seccomp) \
+ "$@"
+}
+
+src_configure() {
+ # Avoid slow configure+gnulib+make if on an up-to-date Linux system
+ if use prefix || ! use kernel_linux || \
+ has_version '<sys-libs/glibc-2.10'
+ then
+ econf $(use_with caps) $(use_with debug) $(use_with python) $(use_with seccomp)
+ else
+ tc-export CC PKG_CONFIG
+ fi
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ _emake DESTDIR="${D}" PKGDOCDIR='$(DOCDIR)'/${PF} install
+}