[SCM] Samba Shared Repository - branch v3-4-test updated -
release-4-0-0alpha7-919-gc6bf4cb
Jeremy Allison
jra at samba.org
Fri May 8 18:41:46 GMT 2009
The branch, v3-4-test has been updated
via c6bf4cb7e611c4acd3df2e8a52ed535ec3210c24 (commit)
from 32eaef7d2f2e9be171f835b8f440b7c78ee22bd8 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test
- Log -----------------------------------------------------------------
commit c6bf4cb7e611c4acd3df2e8a52ed535ec3210c24
Author: Jeremy Allison <jra at samba.org>
Date: Fri May 8 11:31:34 2009 -0700
Fix bug #6330 - DFS doesn't work on AIX. Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source3/configure.in | 10 ++++++++++
source3/smbd/msdfs.c | 4 ++++
tests/readlink.c | 33 +++++++++++++++++++++++++++++++++
3 files changed, 47 insertions(+), 0 deletions(-)
create mode 100644 tests/readlink.c
Changeset truncated at 500 lines:
diff --git a/source3/configure.in b/source3/configure.in
index 68474b1..a869216 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -5700,6 +5700,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 7bd32e8..efbc05c 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;
diff --git a/tests/readlink.c b/tests/readlink.c
new file mode 100644
index 0000000..a07e62a
--- /dev/null
+++ b/tests/readlink.c
@@ -0,0 +1,33 @@
+/* test whether readlink returns a short buffer correctly. */
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define DATA "readlink.test"
+#define FNAME "rdlnk.file"
+
+main()
+{
+ int buf[7];
+ int ret;
+ ssize_t rl_ret;
+
+ unlink(FNAME);
+ ret = symlink(DATA, FNAME);
+ if (ret == -1) {
+ exit(1);
+ }
+
+ rl_ret = readlink(FNAME, buf, sizeof(buf));
+ if (rl_ret == -1) {
+ unlink(FNAME);
+ exit(1);
+ }
+ unlink(FNAME);
+ exit(0);
+}
--
Samba Shared Repository
More information about the samba-cvs
mailing list