]> arthur.barton.de Git - netatalk.git/commitdiff
Merge remote-tracking branch 'origin/branch-netatalk-3-0' into develop
authorRalph Boehme <sloowfranklin@gmail.com>
Tue, 22 Oct 2013 18:02:59 +0000 (20:02 +0200)
committerRalph Boehme <sloowfranklin@gmail.com>
Tue, 22 Oct 2013 18:02:59 +0000 (20:02 +0200)
Conflicts:
configure.ac
libatalk/Makefile.am

NEWS
configure.ac
etc/afpd/volume.c
include/atalk/tdb.h
libatalk/Makefile.am
libatalk/cnid/tdb/Makefile.am
macros/netatalk.m4
macros/summary.m4

diff --git a/NEWS b/NEWS
index 7b9fc6b682326abed1993bca7bd5d326a53c0285..2188fcf1a5aa165107955d3633b1943d84ac23e2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,9 @@ Changes in 3.0.6
        "follow symlinks" is enabled. Bug #532.
 * FIX: Disable Kerberos UAM if AFP service principal name can't be
        evaluated. Fixes bug #531.
+* FIX: Fix handling of large number of volumes. Bug #527.
+* NEW: Configure option --with-tbd which can be used to disable the
+       use of the bundled tdb and use a system installed version.
 
 Changes in 3.0.5
 ================
index 6eec7f4eeea3768d7bd0cc169c293d3822f7ee35..cbbc67719ab3bc34d7d3f7de0bcbd55bdbe15be9 100644 (file)
@@ -184,6 +184,9 @@ AC_NETATALK_SENDFILE
 dnl Check whether bundled libevent shall not be used
 AC_NETATALK_LIBEVENT
 
+dnl Check whether bundled tdb shall be used
+AC_NETATALK_TDB
+
 dnl Check for Tracker
 AC_NETATALK_SPOTLIGHT
 
index 5f0d8a3786b3c945b84b5d59372e8d34cace4495..4efa659f02ee02eccb4f4f4fe53216ca606e5852 100644 (file)
@@ -535,7 +535,7 @@ int afp_getsrvrparms(AFPObj *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf
     load_volumes(obj);
 
     data = rbuf + 5;
-    for ( vcnt = 0, volume = getvolumes(); volume; volume = volume->v_next ) {
+    for ( vcnt = 0, volume = getvolumes(); volume && vcnt < 255; volume = volume->v_next ) {
         if (!(volume->v_flags & AFPVOL_NOSTAT)) {
             struct maccess ma;
 
@@ -562,6 +562,14 @@ int afp_getsrvrparms(AFPObj *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf
         if (len == (size_t)-1)
             continue;
 
+        /*
+         * There seems to be an undocumented limit on how big our reply can get
+         * before the client chokes and closes the connection.
+         * Testing with 10.8.4 found the limit at ~4600 bytes. Go figure. 
+         */
+        if (((data + len + 3) - rbuf) > 4600)
+            break;
+
         /* set password bit if there's a volume password */
         *data = (volume->v_password) ? AFPSRVR_PASSWD : 0;
 
index 789649a1a6ded108932ddd9d90f52b0be10a4b14..b13ee350a2fe1c79071f658dc3d57c57d4865980 100644 (file)
@@ -1,5 +1,8 @@
-#ifndef __TDB_H__
-#define __TDB_H__
+#ifndef USE_BUILTIN_TDB
+#  include <tdb.h>
+#else
+#  ifndef __TDB_H__
+#    define __TDB_H__
 
 /* 
    Unix SMB/CIFS implementation.
@@ -174,4 +177,5 @@ extern TDB_DATA tdb_null;
 }
 #endif
 
-#endif /* tdb.h */
+#  endif /* tdb.h */
+#endif /* USE_BUILTIN_TDB */
index f7206d30017358d325026647e42f69a83d240275..d8733b35e92d66f5f67e5415e0b64503bcb4268a 100644 (file)
@@ -34,7 +34,7 @@ VERSION_INFO = 6:0:0
 #   3.0.4           5:0:0
 #   3.0.5           6:0:0
 
-SUBDIRS = acl adouble bstring compat cnid dsi iniparser talloc tdb util unicode vfs
+SUBDIRS = acl adouble bstring compat cnid dsi iniparser talloc util unicode vfs
 
 lib_LTLIBRARIES = libatalk.la
 
@@ -53,7 +53,6 @@ libatalk_la_LIBADD  = \
        dsi/libdsi.la           \
        iniparser/libiniparser.la \
        talloc/libtalloc.la       \
-       tdb/libtdb.la       \
        unicode/libunicode.la \
        util/libutil.la         \
        vfs/libvfs.la
@@ -67,13 +66,18 @@ libatalk_la_DEPENDENCIES = \
        dsi/libdsi.la           \
        talloc/libtalloc.la       \
        iniparser/libiniparser.la \
-       tdb/libtdb.la       \
        unicode/libunicode.la \
        util/libutil.la         \
        vfs/libvfs.la
 
 libatalk_la_LDFLAGS = -version-info $(VERSION_INFO)
 
+if USE_BUILTIN_TDB
+SUBDIRS += tdb
+libatalk_la_LIBADD += tdb/libtdb.la
+libatalk_la_DEPENDENCIES += tdb/libtdb.la
+endif
+
 if DEVELOPER
 all-local: .libs/libatalk.so
        @$(top_srcdir)/abigen.sh .libs/libatalk.so > libatalk.abi.tmp
index 58a4f7225215aa33208a19eeeeabd2d2b9172b72..93c289aa5faa53a633f09916f1d4807f592bd42c 100644 (file)
@@ -14,4 +14,7 @@ libcnid_tdb_la_SOURCES = cnid_tdb_add.c \
                         cnid_tdb_update.c \
                         cnid_tdb.h
 
+libcnid_tdb_la_CFLAGS = @TDB_CFLAGS@
+libcnid_tdb_la_LIBADD = @TDB_LIBS@
+
 EXTRA_DIST = README cnid_tdb_nextid.c
index 72daa01e68349e5597eb6b2d1c365bd433e9ccc4..86c4c711c16cb84f4784f395d0789dfff043d3d3 100644 (file)
@@ -217,6 +217,31 @@ AC_DEFUN([AC_NETATALK_LIBEVENT], [
     AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
 ])
 
+dnl Whether to disable bundled tdb
+AC_DEFUN([AC_NETATALK_TDB], [
+    AC_ARG_WITH(
+        tdb,
+        [AS_HELP_STRING([--with-tdb],[whether to use the bundled tdb (default: yes)])],
+        use_bundled_tdb=$withval,
+        use_bundled_tdb=yes
+    )
+    AC_MSG_CHECKING([whether to use bundled tdb])
+    AC_MSG_RESULT([$use_bundled_tdb])
+
+    if test x"$use_bundled_tdb" = x"yes" ; then
+        AC_DEFINE(USE_BUILTIN_TDB, 1, [Use internal tbd])
+    else
+        if test -z "$TDB_LIBS" ; then
+            PKG_CHECK_MODULES(TDB, tdb, , [AC_MSG_ERROR([couldn't find tdb with pkg-config])])
+        fi
+        use_bundled_tdb=no
+    fi        
+
+    AC_SUBST(TDB_CFLAGS)
+    AC_SUBST(TDB_LIBS)
+    AM_CONDITIONAL(USE_BUILTIN_TDB, test x"$use_bundled_tdb" = x"yes")
+])
+
 dnl Filesystem Hierarchy Standard (FHS) compatibility
 AC_DEFUN([AC_NETATALK_FHS], [
 AC_MSG_CHECKING([whether to use Filesystem Hierarchy Standard (FHS) compatibility])
index e72fb6a2310f32ba75c9ba9e53513339042b1a32..d3261192cc6694bada5ba14a23c9e23859c7906a 100644 (file)
@@ -148,4 +148,12 @@ AC_DEFUN([AC_NETATALK_LIBS_SUMMARY], [
                AC_MSG_RESULT([        LIBS   = $LIBEVENT_CFLAGS])
                AC_MSG_RESULT([        CFLAGS = $LIBEVENT_LDFLAGS])
     fi
+
+    AC_MSG_RESULT([    TDB:])
+    if test x"$use_bundled_tdb" = x"yes"; then
+               AC_MSG_RESULT([        bundled])
+    else
+               AC_MSG_RESULT([        LIBS   = $TDB_LIBS])
+               AC_MSG_RESULT([        CFLAGS = $TDB_CFLAGS])
+    fi
 ])