summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in10
-rw-r--r--source3/smbd/msdfs.c4
2 files changed, 14 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in
index b532372bfd..b6cdcc86ad 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -5703,6 +5703,16 @@ fi
AC_HAVE_DECL(splice, [#include <fcntl.h>])
+############################################
+# See if we have the a broken readlink syscall.
+
+AC_CACHE_CHECK([for a broken readlink syscall],samba_cv_HAVE_BROKEN_READLINK,[
+AC_TRY_RUN([#include "${srcdir-.}/../tests/readlink.c"],
+ samba_cv_HAVE_BROKEN_READLINK=no,samba_cv_HAVE_BROKEN_READLINK=yes,samba_cv_HAVE_BROKEN_READLINK=cross)
+])
+if test x"$samba_cv_HAVE_BROKEN_READLINK" = x"yes"; then
+ AC_DEFINE(HAVE_BROKEN_READLINK,1,[Whether the readlink syscall is broken])
+fi
#################################################
# Check whether winbind is supported on this platform. If so we need to
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 7bd32e8280..efbc05ceb0 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -413,7 +413,11 @@ static bool is_msdfs_link_internal(TALLOC_CTX *ctx,
{
SMB_STRUCT_STAT st;
int referral_len = 0;
+#if defined(HAVE_BROKEN_READLINK)
+ char link_target_buf[PATH_MAX];
+#else
char link_target_buf[7];
+#endif
size_t bufsize = 0;
char *link_target = NULL;