From a7b2cc8497c693402b47dc5c868f32c35013b8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Mon, 26 Oct 2020 22:39:12 +0700 Subject: [PATCH] mlocate: fix crash on aarch64-musl Current code call canonicalize_file_name without prior declaration in system with musl libc. Thus the return value of canonicalize_file_name is truncated from char* to int. Use realpath instead. Fix #25531 --- srcpkgs/mlocate/patches/musl_paths-h.patch | 9 +++++++++ srcpkgs/mlocate/template | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/srcpkgs/mlocate/patches/musl_paths-h.patch b/srcpkgs/mlocate/patches/musl_paths-h.patch index 628e2ca6b39..92e82c4a1d3 100644 --- a/srcpkgs/mlocate/patches/musl_paths-h.patch +++ b/srcpkgs/mlocate/patches/musl_paths-h.patch @@ -8,3 +8,12 @@ #include #include "error.h" +@@ -388,7 +389,7 @@ + char *dir; + + #ifndef PROC_MOUNTS_PATH +- dir = canonicalize_file_name (me->mnt_dir); ++ dir = realpath (me->mnt_dir, NULL); + if (dir == NULL) + dir = me->mnt_dir; + #else diff --git a/srcpkgs/mlocate/template b/srcpkgs/mlocate/template index 93f4b2bd7d3..cb6c6b8b39b 100644 --- a/srcpkgs/mlocate/template +++ b/srcpkgs/mlocate/template @@ -1,7 +1,7 @@ # Template file for 'mlocate' pkgname=mlocate version=0.26 -revision=4 +revision=5 build_style=gnu-configure configure_args="--program-prefix=m --localstatedir=/var/lib" make_build_args="groupname=_mlocate"