summaryrefslogtreecommitdiff
path: root/sys-apps/file/files
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/file/files')
-rw-r--r--sys-apps/file/files/file-5.38-Revert-PR-93-iaeiaeiaeiae-Do-as-the-comment-says-and.patch40
-rw-r--r--sys-apps/file/files/file-5.38-The-executable-bit-is-only-set-when-DF_1_PIE-bit-is-.patch29
-rw-r--r--sys-apps/file/files/file-5.38-td-is-for-ptrdiff_t-not-for-off_t.patch27
3 files changed, 96 insertions, 0 deletions
diff --git a/sys-apps/file/files/file-5.38-Revert-PR-93-iaeiaeiaeiae-Do-as-the-comment-says-and.patch b/sys-apps/file/files/file-5.38-Revert-PR-93-iaeiaeiaeiae-Do-as-the-comment-says-and.patch
new file mode 100644
index 000000000000..240edc11f680
--- /dev/null
+++ b/sys-apps/file/files/file-5.38-Revert-PR-93-iaeiaeiaeiae-Do-as-the-comment-says-and.patch
@@ -0,0 +1,40 @@
+From c9d21a58bea2ecb2dc8876e09e471094d54a25e4 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi@gentoo.org>
+Date: Mon, 13 Apr 2020 01:08:12 +0200
+Subject: [PATCH 1/3] Revert "PR/93: iaeiaeiaeiae: Do as the comment says, and
+ count as dynamically linked"
+
+This reverts commit 24c9c086cd7c55b7b0a003a145b32466468e2608.
+
+Fixes misdetection of shared libraries as statically linked as
+reported in bug 717264.
+
+Bug: https://bugs.gentoo.org/717264
+Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
+---
+ src/readelf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/readelf.c b/src/readelf.c
+index 40bcfab1..afec31d1 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -1638,6 +1638,7 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
+ /* Things we can determine before we seek */
+ switch (xph_type) {
+ case PT_DYNAMIC:
++ linking_style = "dynamically";
+ doread = 1;
+ break;
+ case PT_NOTE:
+@@ -1653,7 +1654,6 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
+ }
+ /*FALLTHROUGH*/
+ case PT_INTERP:
+- linking_style = "dynamically";
+ doread = 1;
+ break;
+ default:
+--
+2.26.0
+
diff --git a/sys-apps/file/files/file-5.38-The-executable-bit-is-only-set-when-DF_1_PIE-bit-is-.patch b/sys-apps/file/files/file-5.38-The-executable-bit-is-only-set-when-DF_1_PIE-bit-is-.patch
new file mode 100644
index 000000000000..bb211f355f77
--- /dev/null
+++ b/sys-apps/file/files/file-5.38-The-executable-bit-is-only-set-when-DF_1_PIE-bit-is-.patch
@@ -0,0 +1,29 @@
+From ed971e5e3ae79bd28697d16c8b78b693052484e4 Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos@zoulas.com>
+Date: Wed, 12 Feb 2020 22:17:33 +0000
+Subject: [PATCH 3/3] The executable bit is only set when DF_1_PIE bit is set
+ so it is fine.
+
+---
+ magic/Magdir/elf | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/magic/Magdir/elf b/magic/Magdir/elf
+index b5a2e00b..f5e1af9a 100644
+--- a/magic/Magdir/elf
++++ b/magic/Magdir/elf
+@@ -50,8 +50,9 @@
+ !:mime application/x-object
+ >16 leshort 2 executable,
+ !:mime application/x-executable
+->16 leshort 3 shared object,
+-!:mime application/x-sharedlib
++>16 leshort 3 ${x?pie executable:shared object},
++
++!:mime application/x-${x?pie-executable:sharedlib}
+ >16 leshort 4 core file,
+ !:mime application/x-coredump
+ # OS-specific
+--
+2.26.0
+
diff --git a/sys-apps/file/files/file-5.38-td-is-for-ptrdiff_t-not-for-off_t.patch b/sys-apps/file/files/file-5.38-td-is-for-ptrdiff_t-not-for-off_t.patch
new file mode 100644
index 000000000000..09fcaef151ea
--- /dev/null
+++ b/sys-apps/file/files/file-5.38-td-is-for-ptrdiff_t-not-for-off_t.patch
@@ -0,0 +1,27 @@
+From c49dc91df427f89ebcf9cdec556b8fc88cdfc3c1 Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos@zoulas.com>
+Date: Tue, 17 Dec 2019 15:27:27 +0000
+Subject: [PATCH 2/3] %td is for ptrdiff_t not for off_t.
+
+---
+ src/readelf.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/readelf.c b/src/readelf.c
+index afec31d1..8ac3b7d6 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -1349,8 +1349,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
+ name_off = xsh_offset;
+
+ if (fsize != SIZE_UNKNOWN && fsize < name_off) {
+- if (file_printf(ms, ", too large section header offset %td",
+- name_off) == -1)
++ if (file_printf(ms, ", too large section header offset %jd",
++ (intmax_t)name_off) == -1)
+ return -1;
+ return 0;
+ }
+--
+2.26.0
+