commit: f543e69201441fdc901ccdda0d7a4d23cc5d829b Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> AuthorDate: Wed Aug 13 15:31:39 2014 +0000 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> CommitDate: Wed Aug 13 15:31:39 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=f543e692
sys-apps/util-linux: Don't cast at all, per Rich Felker Package-Manager: portage-2.2.8-r1 Manifest-Sign-Key: 0xF52D4BBA --- .../util-linux-2.25-missing__SWORD_TYPE.patch | 28 ---------------------- .../files/util-linux-2.25-remove__SWORD_TYPE.patch | 14 +++++++++++ sys-apps/util-linux/util-linux-2.25-r99.ebuild | 2 +- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch deleted file mode 100644 index e20a63a..0000000 --- a/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c ---- util-linux-2.25.orig/sys-utils/switch_root.c 2014-06-25 09:35:44.333812673 +0000 -+++ util-linux-2.25/sys-utils/switch_root.c 2014-08-12 14:54:40.752012106 +0000 -@@ -25,6 +25,7 @@ - #include <sys/stat.h> - #include <sys/statfs.h> - #include <sys/param.h> -+#include <sys/reg.h> - #include <fcntl.h> - #include <stdio.h> - #include <stdlib.h> -@@ -47,6 +48,16 @@ - #define MNT_DETACH 0x00000002 /* Just detach from the tree */ - #endif - -+#ifndef __SWORD_TYPE -+#if __WORDSIZE == 32 -+# define __SWORD_TYPE int -+#elif __WORDSIZE == 64 -+# define __SWORD_TYPE long int -+#else -+# error -+#endif -+#endif -+ - /* remove all files/directories below dirName -- don't cross mountpoints */ - static int recursiveRemove(int fd) - { diff --git a/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch new file mode 100644 index 0000000..86edab4 --- /dev/null +++ b/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch @@ -0,0 +1,14 @@ +diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c +--- util-linux-2.25.orig/sys-utils/switch_root.c 2014-08-13 15:08:15.632801343 +0000 ++++ util-linux-2.25/sys-utils/switch_root.c 2014-08-13 15:09:19.617801087 +0000 +@@ -181,8 +181,8 @@ + if (pid <= 0) { + struct statfs stfs; + if (fstatfs(cfd, &stfs) == 0 && +- (stfs.f_type == (__SWORD_TYPE)STATFS_RAMFS_MAGIC || +- stfs.f_type == (__SWORD_TYPE)STATFS_TMPFS_MAGIC)) ++ (stfs.f_type == STATFS_RAMFS_MAGIC || ++ stfs.f_type == STATFS_TMPFS_MAGIC)) + recursiveRemove(cfd); + else + warn(_("old root filesystem is not an initramfs")); diff --git a/sys-apps/util-linux/util-linux-2.25-r99.ebuild b/sys-apps/util-linux/util-linux-2.25-r99.ebuild index eb17752..6fc8054 100644 --- a/sys-apps/util-linux/util-linux-2.25-r99.ebuild +++ b/sys-apps/util-linux/util-linux-2.25-r99.ebuild @@ -66,7 +66,7 @@ src_prepare() { eautoreconf fi epatch "${FILESDIR}"/${P}-lscpu-pic.patch #518936 - epatch "${FILESDIR}"/${PN}-2.25-missing__SWORD_TYPE.patch + epatch "${FILESDIR}"/${PN}-2.25-remove__SWORD_TYPE.patch elibtoolize }