diff --git a/srcpkgs/mdadm/patches/time64.patch b/srcpkgs/mdadm/patches/time64.patch index c02ca8f759..1ee4b23f41 100644 --- a/srcpkgs/mdadm/patches/time64.patch +++ b/srcpkgs/mdadm/patches/time64.patch @@ -1,20 +1,16 @@ ---- monitor.c 2018-10-01 18:26:06.000000000 +0000 -+++ monitor.c 2020-01-22 19:51:39.575877908 +0000 -@@ -20,6 +20,7 @@ - - #include "mdadm.h" - #include "mdmon.h" -+#include - #include - #include - #include -@@ -447,7 +448,7 @@ +diff --git monitor.c monitor.c +index 81537ed..08027ac 100644 +--- monitor.c ++++ monitor.c +@@ -447,9 +447,9 @@ static int read_and_act(struct active_array *a, fd_set *fds) } gettimeofday(&tv, NULL); - dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n", -+ dprintf("(%d): %"PRId64".%06"PRId64" state:%s prev:%s action:%s prev: %s start:%llu\n", ++ dprintf("(%d): %lld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n", a->info.container_member, - tv.tv_sec, tv.tv_usec, +- tv.tv_sec, tv.tv_usec, ++ (long long)tv.tv_sec, (long)tv.tv_usec, array_states[a->curr_state], - + array_states[a->prev_state], + sync_actions[a->curr_action], diff --git a/srcpkgs/mdadm/patches/use-after-free.patch b/srcpkgs/mdadm/patches/use-after-free.patch new file mode 100644 index 0000000000..69b6ee4aea --- /dev/null +++ b/srcpkgs/mdadm/patches/use-after-free.patch @@ -0,0 +1,17 @@ +From Rich Felker, over IRC + +diff --git a/policy.c b/policy.c +index c0d18a7e..78ad34cd 100644 +--- policy.c ++++ policy.c +@@ -214,8 +214,9 @@ static char *disk_path(struct mdinfo *disk) + continue; + if (stb.st_rdev != makedev(disk->disk.major, disk->disk.minor)) + continue; ++ char *result = xstrdup(ent->d_name); + closedir(by_path); +- return xstrdup(ent->d_name); ++ return result; + } + closedir(by_path); + } diff --git a/srcpkgs/mdadm/template b/srcpkgs/mdadm/template index ac1bce5aed..f776b6dc9d 100644 --- a/srcpkgs/mdadm/template +++ b/srcpkgs/mdadm/template @@ -1,7 +1,7 @@ # Template file for 'mdadm' pkgname=mdadm version=4.1 -revision=2 +revision=3 hostmakedepends="pkg-config" makedepends="eudev-libudev-devel" short_desc="Tool for managing/monitoring Linux md device arrays"