From 3ba48a752fd5d5085364e94a94916ac7f5272350 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 26 Dec 2014 09:52:39 +0100 Subject: [PATCH] kmod: update to 19. --- srcpkgs/kmod/patches/kmod.patch | 32 ----------------------------- srcpkgs/kmod/patches/strndupa.patch | 15 ++++++++++++++ srcpkgs/kmod/template | 14 ++++++------- 3 files changed, 22 insertions(+), 39 deletions(-) delete mode 100644 srcpkgs/kmod/patches/kmod.patch create mode 100644 srcpkgs/kmod/patches/strndupa.patch diff --git a/srcpkgs/kmod/patches/kmod.patch b/srcpkgs/kmod/patches/kmod.patch deleted file mode 100644 index 86ef61c2c45..00000000000 --- a/srcpkgs/kmod/patches/kmod.patch +++ /dev/null @@ -1,32 +0,0 @@ -remove non-portable usage of strndupa - -usage of strndupa is neither C99 nor POSIX, -it's a glibc invention, and a dangerous one since -alloca() is used behind the scenes which does not -give any guarantuees that it won't overflow the -stack. - ---- libkmod/libkmod-util.c 2013-08-26 16:03:22.239000003 +0000 -+++ libkmod/libkmod-util.c 2013-08-26 16:07:26.684000003 +0000 -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include - - #include "libkmod.h" -@@ -323,8 +324,11 @@ - int mkdir_p(const char *path, int len, mode_t mode) - { - char *start, *end; -- -- start = strndupa(path, len); -+ char buf[PATH_MAX+1]; -+ snprintf(buf, sizeof buf, "%s", path); -+ assert(len < sizeof(buf)); -+ buf[len] = 0; -+ start = buf; - end = start + len; - - /* diff --git a/srcpkgs/kmod/patches/strndupa.patch b/srcpkgs/kmod/patches/strndupa.patch new file mode 100644 index 00000000000..746d540a131 --- /dev/null +++ b/srcpkgs/kmod/patches/strndupa.patch @@ -0,0 +1,15 @@ +diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c +index df12433..142e767 100644 +--- shared/util.c ++++ shared/util.c +@@ -334,7 +334,9 @@ int mkdir_p(const char *path, int len, mode_t mode) + { + char *start, *end; + +- start = strndupa(path, len); ++ start = alloca(len+1); ++ strncpy(start, path, len); ++ start[len] = '\0'; + end = start + len; + + /* diff --git a/srcpkgs/kmod/template b/srcpkgs/kmod/template index 6bf10e9e41a..374255a2882 100644 --- a/srcpkgs/kmod/template +++ b/srcpkgs/kmod/template @@ -1,22 +1,22 @@ # Template file for 'kmod' pkgname=kmod -version=18 -revision=4 +version=19 +revision=1 build_style=gnu-configure configure_args="--with-zlib --with-xz" hostmakedepends="pkg-config" makedepends="zlib-devel liblzma-devel" make_dirs=" - /etc/depmod.d 0755 root root - /etc/modprobe.d 0755 root root - /usr/lib/depmod.d 0755 root root - /usr/lib/modprobe.d 0755 root root" + /etc/depmod.d 0755 root root + /etc/modprobe.d 0755 root root + /usr/lib/depmod.d 0755 root root + /usr/lib/modprobe.d 0755 root root" short_desc="Linux kernel module handling" maintainer="Juan RP " license="GPL-2" homepage="http://git.profusion.mobi/cgit.cgi/kmod.git" distfiles="${KERNEL_SITE}/utils/kernel/kmod/kmod-${version}.tar.xz" -checksum=e16e57272b54acb219c465b334715cfdddb5d97ff5d8948d4830ca1a372a868e +checksum=3e7fee6eeff5435848b2dcc852bc8959066478d687d232284d67300c071e7b14 post_install() { vinstall ${FILESDIR}/depmod-search.conf 644 usr/lib/depmod.d search.conf