From c79f3527498974c328404ed6807f9aaa5608832e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Fri, 29 May 2015 03:11:59 +0100
Subject: linkat: avoid OS X 10.10 trailing slash with symlink bug
On Darwin 14.3.0 linkat(,"path1",,"dangling_symlink/",)
causes the symlink to be dereferenced, and if it points
to a non existent file, that file will be created as
a hard link to "path1".
This fixes a test failure in test-linkat.c.
* m4/linkat.m4 (gl_FUNC_LINKAT): Augment the test with
this case. The existing workaround in linkat.c for
trailing slash issues, suffices for this case.
* doc/posix-functions/linkat.texi: Add OS X 10.10 to
the list of platforms with trailing slash issues.
---
m4/linkat.m4 | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
(limited to 'm4')
diff --git a/m4/linkat.m4 b/m4/linkat.m4
index 567cb5dcaa..03cf23a2e4 100644
--- a/m4/linkat.m4
+++ b/m4/linkat.m4
@@ -52,7 +52,7 @@ AC_DEFUN([gl_FUNC_LINKAT],
AC_CACHE_CHECK([whether linkat handles trailing slash correctly],
[gl_cv_func_linkat_slash],
- [rm -rf conftest.a conftest.b conftest.c conftest.d
+ [rm -rf conftest.a conftest.b conftest.c conftest.d conftest.e conftest.s
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include