[SCM] Samba Shared Repository - branch master updated
Björn Jacke
bjacke at samba.org
Fri Aug 5 04:49:02 MDT 2011
The branch, master has been updated
via 601a2ad s3: make linking of pthreadpooltest work on more platforms
via fd06cf3 s3/ldap: delay the ldap search alarm termination a bit
from a7438cc s3-nmbd: fix talloc/malloc mismatch in create_listen_pollfds().
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 601a2ad588ff1bc548cd06bcbcbdd939d0ef9c91
Author: Björn Jacke <bj at sernet.de>
Date: Thu Aug 4 23:47:47 2011 +0200
s3: make linking of pthreadpooltest work on more platforms
Autobuild-User: Björn Jacke <bj at sernet.de>
Autobuild-Date: Fri Aug 5 12:48:55 CEST 2011 on sn-devel-104
commit fd06cf379ded801adf830499c24875a7c60280be
Author: Björn Jacke <bj at sernet.de>
Date: Thu Aug 4 16:42:37 2011 +0200
s3/ldap: delay the ldap search alarm termination a bit
do the alarm termination of the the ldap search a bit delayed so the LDAP
server has a chance to tell us that the time limit was reached and the
search was abandoned. If the search is terminated this way we also get
the correct LDAP return code in the logs. If alarm() stops the search the ldap
search routine will report that the LDAP server is down which would trigger us
to rebind to the server needlessly which we also want to avoid.
-----------------------------------------------------------------------
Summary of changes:
source3/Makefile.in | 2 +-
source3/lib/smbldap.c | 15 +++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 927cd0c..5fa848c 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1934,7 +1934,7 @@ bin/smbconftort at EXEEXT@: $(SMBCONFTORT_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB)
bin/pthreadpooltest at EXEEXT@: $(PTHREADPOOLTEST_OBJ)
@echo Linking $@
- @$(CC) -o $@ $(PTHREADPOOLTEST_OBJ) $(LDFLAGS) -lpthread
+ @$(CC) -o $@ $(PTHREADPOOLTEST_OBJ) $(LDFLAGS) $(LIBS) $(PTHREAD_LDFLAGS)
bin/masktest at EXEEXT@: $(BINARY_PREREQS) $(MASKTEST_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT)
@echo Linking $@
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 5c99e4b..dcb99c9 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -1432,6 +1432,7 @@ static int smbldap_search_ext(struct smbldap_state *ldap_state,
char *utf8_filter;
time_t endtime = time_mono(NULL)+lp_ldap_timeout();
struct timeval timeout;
+ int alarm_timer;
size_t converted_size;
SMB_ASSERT(ldap_state);
@@ -1477,11 +1478,21 @@ static int smbldap_search_ext(struct smbldap_state *ldap_state,
* covers the case where the server's operation takes too long. It
* does not cover the case where the request hangs on its way to the
* server. The server side timeout is not strictly necessary, it's
- * just a bit more kind to the server. VL. */
+ * just a bit more kind to the server. VL.
+ * We prefer to get the server termination though because otherwise we
+ * have to rebind to the LDAP server aѕ we get a LDAP_SERVER_DOWN in the
+ * alarm termination case. So let's call the alarm 2s later, which
+ * should be enough for the server to report the timelimit exceeded.
+ * in case the ldal timeout is 0 (no limit) we set the _no_ alarm
+ * accordingly. BJ. */
got_alarm = 0;
CatchSignal(SIGALRM, gotalarm_sig);
- alarm(lp_ldap_timeout());
+ alarm_timer = lp_ldap_timeout();
+ if (alarm_timer > 0) {
+ alarm_timer += 2;
+ }
+ alarm(alarm_timer);
/* End setup timeout. */
while (another_ldap_try(ldap_state, &rc, &attempts, endtime)) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list