void-packages/srcpkgs/mlocate/patches/musl_paths-h.patch
Đoàn Trần Công Danh a7b2cc8497 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
2020-10-26 22:42:45 +07:00

19 lines
471 B
Diff

--- ./src/updatedb.c.orig 2015-11-15 17:52:09.470706519 -0500
+++ ./src/updatedb.c 2015-11-15 17:52:31.754706775 -0500
@@ -35,6 +35,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
+#include <paths.h>
#include <mntent.h>
#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