[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed Jul 14 21:58:01 UTC 2021


The branch, master has been updated
       via  fdcae2872b6 selftest: use SAMBA_DEPRECATED_SUPPRESS=1 for all tests
       via  9d047192a6e s3:tests: use SAMBA_DEPRECATED_SUPPRESS=1 for backbox tests
       via  12bc55ff7aa ldb: version 2.4 will be used for Samba 4.15
       via  1ad5df9f744 tdb: version 1.4.4
       via  bc1ee7ca064 talloc: version 2.3.3
       via  17c86a2c5a5 s3:winbind: Get rid of the winbind dc-connect child
       via  9f632405032 s3:winbind: Remove trailing whitespaces in winbindd_dual.c
       via  ea5b7309fb1 s3:winbind: Remove trailing whitespaces in winbindd_cm.c
       via  5ecda3bc3fb s3:winbind: Remove trailing whitespaces in winbindd.c
      from  7938d94d12e s4-selftest: add net offlinejoin tests

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fdcae2872b684dbc834274e688e4a0071a028a58
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 9 14:12:39 2021 +0200

    selftest: use SAMBA_DEPRECATED_SUPPRESS=1 for all tests
    
    The deprecation warnings are filling the logs and make it hard to
    find/see real problems.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Wed Jul 14 21:57:11 UTC 2021 on sn-devel-184

commit 9d047192a6e9d96a6142bad902f37af6169e854e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 14 06:30:03 2021 +0200

    s3:tests: use SAMBA_DEPRECATED_SUPPRESS=1 for backbox tests
    
    These tests should not depend on the number of deprecation warnings
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 12bc55ff7aae653bb3894bc55fe4f1ba86902a2d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 14 22:50:19 2021 +0200

    ldb: version 2.4 will be used for Samba 4.15
    
    - Improve calculate_popt_array_length()
    - Use C99 initializers for builtin_popt_options[]
    - pyldb: Fix Message.items() for a message containing elements
    - pyldb: Add test for Message.items()
    - tests: Use ldbsearch '--scope instead of '-s'
    - pyldb: fix a typo
    - Change page size of guidindexpackv1.ldb
    - Use a 1MiB lmdb so the test also passes on aarch64 CentOS stream
    - attrib_handler casefold: simplify space dropping
    - fix ldb_comparison_fold off-by-one overrun
    - CVE-2020-27840: pytests: move Dn.validate test to ldb
    - CVE-2020-27840 ldb_dn: avoid head corruption in ldb_dn_explode
    - CVE-2021-20277 ldb/attrib_handlers casefold: stay in bounds
    - CVE-2021-20277 ldb tests: ldb_match tests with extra spaces
    - improve comments for ldb_module_connect_backend()
    - test/ldb_tdb: correct introductory comments
    - ldb.h: remove undefined async_ctx function signatures
    - correct comments in attrib_handers val_to_int64
    - dn tests use cmocka print functions
    - ldb_match: remove redundant check
    - add tests for ldb_wildcard_compare
    - ldb_match: trailing chunk must match end of string
    - pyldb: catch potential overflow error in py_timestring
    - ldb: remove some 'if PY3's in tests
    - Add missing break in switch statement
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 1ad5df9f74426c78ff128d963a785aad707e7ed1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 14 22:30:19 2021 +0200

    tdb: version 1.4.4
    
    - Fix a memory leak on error
    - python: remove all 'from __future__ import print_function'
    - Fix CID 1471761 String not null terminated
    - Use hex_byte() in parse_hex()
    - Use hex_byte() in read_data()
    - fix studio compiler build
    - Fix some signed/unsigned comparisons
    - also use __has_attribute macro to check for attribute support
    - Fix clang 9 missing-field-initializer warnings
    - pytdb tests: add test for storev()
    - pytdb: add python binding for storev()
    - tdbtorture: Use ARRAY_DEL_ELEMENT()
    - py3: Remove #define PyInt_FromLong PyLong_FromLong
    - py3: Remove #define PyInt_AsLong PyLong_AsLong
    - py3: Remove #define PyInt_Check PyLong_Check
    - tdb: Align integer types
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit bc1ee7ca0640f0136e5af7dcc4ca8ed0a5893053
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 14 22:28:19 2021 +0200

    talloc: version 2.3.3
    
    - python: Ensure reference counts are properly incremented
    - Bug 9931: change pytalloc source to LGPL
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 17c86a2c5a5a5e2b194362e5f36f0f99910222c5
Author: Isaac Boukris <iboukris at gmail.com>
Date:   Thu Sep 17 11:12:53 2020 +0200

    s3:winbind: Get rid of the winbind dc-connect child
    
    The new code uses PING_DC to tell the child to try to go online.
    
    Pair-Programmed-With: Andreas Schneider <asn at samba.org>
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Signed-off-by: Isaac Boukris <iboukris at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 9f632405032b2c6ebbe6ed205fd301a31c2910d5
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 13 14:39:38 2021 +0200

    s3:winbind: Remove trailing whitespaces in winbindd_dual.c
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit ea5b7309fb1a0f1ed7c1e4de00f98e9adc9f5dbf
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 13 14:37:17 2021 +0200

    s3:winbind: Remove trailing whitespaces in winbindd_cm.c
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 5ecda3bc3fbf899602a7e953d7c424f6435577d5
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Jul 13 14:38:56 2021 +0200

    s3:winbind: Remove trailing whitespaces in winbindd.c
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/ldb/wscript                                    |   1 +
 ...oc-util-2.3.0.sigs => pytalloc-util-2.3.3.sigs} |   0
 .../ABI/{talloc-2.1.10.sigs => talloc-2.3.3.sigs}  |   0
 lib/talloc/wscript                                 |   2 +-
 lib/tdb/ABI/{tdb-1.3.17.sigs => tdb-1.4.4.sigs}    |   0
 lib/tdb/wscript                                    |   2 +-
 librpc/idl/messaging.idl                           |   3 +-
 selftest/selftest.pl                               |   2 +
 source3/script/tests/test_aio_outstanding.sh       |   5 +-
 source3/script/tests/test_force_close_share.sh     |   5 +-
 source3/script/tests/test_netfileenum.sh           |   5 +-
 source3/script/tests/test_open_eintr.sh            |   5 +-
 source3/winbindd/winbindd.c                        |  16 +-
 source3/winbindd/winbindd.h                        |   7 +-
 source3/winbindd/winbindd_cm.c                     | 410 +++------------------
 source3/winbindd/winbindd_dual.c                   |  51 +--
 source3/winbindd/winbindd_ndr.c                    |   1 -
 source3/winbindd/winbindd_proto.h                  |   4 +
 source3/winbindd/winbindd_util.c                   | 116 ++++--
 19 files changed, 191 insertions(+), 444 deletions(-)
 copy lib/talloc/ABI/{pytalloc-util-2.3.0.sigs => pytalloc-util-2.3.3.sigs} (100%)
 copy lib/talloc/ABI/{talloc-2.1.10.sigs => talloc-2.3.3.sigs} (100%)
 copy lib/tdb/ABI/{tdb-1.3.17.sigs => tdb-1.4.4.sigs} (100%)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 5f98fb4f605..863dfde9339 100644
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'ldb'
+# For Samba 4.15.x
 VERSION = '2.4.0'
 
 import sys, os
diff --git a/lib/talloc/ABI/pytalloc-util-2.3.0.sigs b/lib/talloc/ABI/pytalloc-util-2.3.3.sigs
similarity index 100%
copy from lib/talloc/ABI/pytalloc-util-2.3.0.sigs
copy to lib/talloc/ABI/pytalloc-util-2.3.3.sigs
diff --git a/lib/talloc/ABI/talloc-2.1.10.sigs b/lib/talloc/ABI/talloc-2.3.3.sigs
similarity index 100%
copy from lib/talloc/ABI/talloc-2.1.10.sigs
copy to lib/talloc/ABI/talloc-2.3.3.sigs
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index a767477357f..ed38c78b0e9 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'talloc'
-VERSION = '2.3.2'
+VERSION = '2.3.3'
 
 import os
 import sys
diff --git a/lib/tdb/ABI/tdb-1.3.17.sigs b/lib/tdb/ABI/tdb-1.4.4.sigs
similarity index 100%
copy from lib/tdb/ABI/tdb-1.3.17.sigs
copy to lib/tdb/ABI/tdb-1.4.4.sigs
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index e56ddd0578a..cee0889bd4a 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'tdb'
-VERSION = '1.4.3'
+VERSION = '1.4.4'
 
 import sys, os
 
diff --git a/librpc/idl/messaging.idl b/librpc/idl/messaging.idl
index a2070e27b46..61566919446 100644
--- a/librpc/idl/messaging.idl
+++ b/librpc/idl/messaging.idl
@@ -122,8 +122,7 @@ interface messaging
 		MSG_WINBIND_ONLINE		= 0x0403,
 		MSG_WINBIND_OFFLINE		= 0x0404,
 		MSG_WINBIND_ONLINESTATUS	= 0x0405,
-		MSG_WINBIND_TRY_TO_GO_ONLINE	= 0x0406,
-		MSG_WINBIND_FAILED_TO_GO_ONLINE = 0x0407,
+
 		MSG_WINBIND_VALIDATE_CACHE	= 0x0408,
 		MSG_WINBIND_DUMP_DOMAIN_LIST	= 0x0409,
 		MSG_WINBIND_IP_DROPPED		= 0x040A,
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index d0c025af6b3..9d4462323f5 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -271,6 +271,8 @@ unless (defined($ENV{VALGRIND})) {
 # make all our python scripts unbuffered
 $ENV{PYTHONUNBUFFERED} = 1;
 
+$ENV{SAMBA_DEPRECATED_SUPPRESS} = 1;
+
 # do not depend on the users setup
 # see also bootstrap/config.py
 $ENV{TZ} = "UTC";
diff --git a/source3/script/tests/test_aio_outstanding.sh b/source3/script/tests/test_aio_outstanding.sh
index f4265277a1a..4f68d3bb620 100755
--- a/source3/script/tests/test_aio_outstanding.sh
+++ b/source3/script/tests/test_aio_outstanding.sh
@@ -18,6 +18,10 @@ SMBCLIENT=$2
 SERVER=$3
 SHARE=$4
 
+# Do not let deprecated option warnings muck this up
+SAMBA_DEPRECATED_SUPPRESS=1
+export SAMBA_DEPRECATED_SUPPRESS
+
 incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
 
@@ -50,7 +54,6 @@ exec 100>smbclient-stdin  101<smbclient-stdout 102<smbclient-stderr
 
 # consume the smbclient startup messages
 head -n 1 <&101
-head -n 1 <&102
 
 # Ensure we're putting a fresh file.
 echo "del aio_outstanding_testfile" >&100
diff --git a/source3/script/tests/test_force_close_share.sh b/source3/script/tests/test_force_close_share.sh
index 46db07edfbe..2d01b3162f1 100755
--- a/source3/script/tests/test_force_close_share.sh
+++ b/source3/script/tests/test_force_close_share.sh
@@ -22,6 +22,10 @@ SHARE=$5
 PREFIX=$6
 shift 6
 
+# Do not let deprecated option warnings muck this up
+SAMBA_DEPRECATED_SUPPRESS=1
+export SAMBA_DEPRECATED_SUPPRESS
+
 incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
 . $incdir/common_test_fns.inc
@@ -71,7 +75,6 @@ exec 100>$FIFO_STDIN  101<$FIFO_STDOUT 102<$FIFO_STDERR
 
 # consume the smbclient startup messages
 head -n 1 <&101
-head -n 1 <&102
 
 # Ensure we're putting a fresh file.
 echo "lcd $(dirname $TESTFILE)" >&100
diff --git a/source3/script/tests/test_netfileenum.sh b/source3/script/tests/test_netfileenum.sh
index e8c464307b8..ab0eb925dbb 100755
--- a/source3/script/tests/test_netfileenum.sh
+++ b/source3/script/tests/test_netfileenum.sh
@@ -16,6 +16,10 @@ NET="$1"; shift 1
 SERVER="$1"; shift 1
 SHARE="$1"; shift 1
 
+# Do not let deprecated option warnings muck this up
+SAMBA_DEPRECATED_SUPPRESS=1
+export SAMBA_DEPRECATED_SUPPRESS
+
 incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
 
@@ -38,7 +42,6 @@ exec 100>smbclient-stdin 101<smbclient-stdout 102<smbclient-stderr
 
 # consume the smbclient startup messages
 head -n 1 <&101
-head -n 1 <&102
 
 FILE=x64
 
diff --git a/source3/script/tests/test_open_eintr.sh b/source3/script/tests/test_open_eintr.sh
index 3eabb2a4bc7..c7dec2c77da 100755
--- a/source3/script/tests/test_open_eintr.sh
+++ b/source3/script/tests/test_open_eintr.sh
@@ -16,6 +16,10 @@ SMBCONTROL=$1; shift 1
 SERVER=$1; shift 1
 SHARE=$1; shift 1
 
+# Do not let deprecated option warnings muck this up
+SAMBA_DEPRECATED_SUPPRESS=1
+export SAMBA_DEPRECATED_SUPPRESS
+
 error_inject_conf=$(dirname ${SERVERCONFFILE})/error_inject.conf
 > ${error_inject_conf}
 
@@ -41,7 +45,6 @@ exec 100>smbclient-stdin 101<smbclient-stdout 102<smbclient-stderr
 
 # consume the smbclient startup messages
 head -n 1 <&101
-head -n 1 <&102
 
 echo "error_inject:openat = EINTR" > ${error_inject_conf}
 ${SMBCONTROL} ${CONF} 0 reload-config
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 406aaaf4ecb..4f367d07ecb 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -159,7 +159,7 @@ static void winbindd_status(void)
 
 void winbindd_flush_caches(void)
 {
-	/* We need to invalidate cached user list entries on a SIGHUP 
+	/* We need to invalidate cached user list entries on a SIGHUP
            otherwise cached access denied errors due to restrict anonymous
            hang around until the sequence number changes. */
 
@@ -202,7 +202,7 @@ static void terminate(bool is_parent)
 		/* When parent goes away we should
 		 * remove the socket file. Not so
 		 * when children terminate.
-		 */ 
+		 */
 		char *path = NULL;
 
 		if (asprintf(&path, "%s/%s",
@@ -1383,6 +1383,8 @@ static void winbindd_register_handlers(struct messaging_context *msg_ctx,
 {
 	bool scan_trusts = true;
 	NTSTATUS status;
+	struct tevent_timer *te = NULL;
+
 	/* Setup signal handlers */
 
 	if (!winbindd_setup_sig_term_handler(true))
@@ -1486,6 +1488,16 @@ static void winbindd_register_handlers(struct messaging_context *msg_ctx,
 		}
 	}
 
+	te = tevent_add_timer(global_event_context(),
+			      NULL,
+			      timeval_zero(),
+			      winbindd_ping_offline_domains,
+			      NULL);
+	if (te == NULL) {
+		DBG_ERR("Failed to schedule winbindd_ping_offline_domains()\n");
+		exit(1);
+	}
+
 	status = wb_irpc_register();
 
 	if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index 0dbd832c209..a6b2238cec1 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -158,8 +158,8 @@ struct winbindd_domain {
 	void *private_data;
 
 	/* A working DC */
-	pid_t dc_probe_pid; /* Child we're using to detect the DC. */
 	char *dcname;
+	const char *ping_dcname;
 	struct sockaddr_storage dcaddr;
 
 	/* Sequence number stuff */
@@ -179,10 +179,7 @@ struct winbindd_domain {
 	struct tevent_queue *queue;
 	struct dcerpc_binding_handle *binding_handle;
 
-	/* Callback we use to try put us back online. */
-
-	uint32_t check_online_timeout;
-	struct tevent_timer *check_online_event;
+	struct tevent_req *check_online_event;
 
 	/* Linked list info */
 
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 9f0fd2b706c..fdb894d7ff6 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1,4 +1,4 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    Winbind daemon connection manager
@@ -87,6 +87,7 @@
 #include "lib/gencache.h"
 #include "lib/util/string_wrappers.h"
 #include "lib/global_contexts.h"
+#include "librpc/gen_ndr/ndr_winbind_c.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
@@ -106,256 +107,6 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
 		    struct dc_name_ip **dcs, int *num_dcs,
 		    uint32_t request_flags);
 
-/****************************************************************
- Child failed to find DC's. Reschedule check.
-****************************************************************/
-
-static void msg_failed_to_go_online(struct messaging_context *msg,
-				    void *private_data,
-				    uint32_t msg_type,
-				    struct server_id server_id,
-				    DATA_BLOB *data)
-{
-	struct winbindd_domain *domain;
-	const char *domainname = (const char *)data->data;
-
-	if (data->data == NULL || data->length == 0) {
-		return;
-	}
-
-	DEBUG(5,("msg_fail_to_go_online: received for domain %s.\n", domainname));
-
-	for (domain = domain_list(); domain; domain = domain->next) {
-		if (domain->internal) {
-			continue;
-		}
-
-		if (strequal(domain->name, domainname)) {
-			if (domain->online) {
-				/* We're already online, ignore. */
-				DEBUG(5,("msg_fail_to_go_online: domain %s "
-					"already online.\n", domainname));
-				continue;
-			}
-
-			/* Reschedule the online check. */
-			set_domain_offline(domain);
-			break;
-		}
-	}
-}
-
-/****************************************************************
- Actually cause a reconnect from a message.
-****************************************************************/
-
-static void msg_try_to_go_online(struct messaging_context *msg,
-				 void *private_data,
-				 uint32_t msg_type,
-				 struct server_id server_id,
-				 DATA_BLOB *data)
-{
-	struct winbindd_domain *domain;
-	const char *domainname = (const char *)data->data;
-
-	if (data->data == NULL || data->length == 0) {
-		return;
-	}
-
-	DEBUG(5,("msg_try_to_go_online: received for domain %s.\n", domainname));
-
-	for (domain = domain_list(); domain; domain = domain->next) {
-		if (domain->internal) {
-			continue;
-		}
-
-		if (strequal(domain->name, domainname)) {
-
-			if (domain->online) {
-				/* We're already online, ignore. */
-				DEBUG(5,("msg_try_to_go_online: domain %s "
-					"already online.\n", domainname));
-				continue;
-			}
-
-			/* This call takes care of setting the online
-			   flag to true if we connected, or re-adding
-			   the offline handler if false. Bypasses online
-			   check so always does network calls. */
-
-			init_dc_connection_network(domain, true);
-			break;
-		}
-	}
-}
-
-/****************************************************************
- Fork a child to try and contact a DC. Do this as contacting a
- DC requires blocking lookups and we don't want to block our
- parent.
-****************************************************************/
-
-static bool fork_child_dc_connect(struct winbindd_domain *domain)
-{
-	struct dc_name_ip *dcs = NULL;
-	int num_dcs = 0;
-	TALLOC_CTX *mem_ctx = NULL;
-	pid_t parent_pid = getpid();
-	char *lfile = NULL;
-	NTSTATUS status;
-	bool ok;
-
-	if (domain->dc_probe_pid != (pid_t)-1) {
-		/*
-		 * We might already have a DC probe
-		 * child working, check.
-		 */
-		if (process_exists_by_pid(domain->dc_probe_pid)) {
-			DEBUG(10,("fork_child_dc_connect: pid %u already "
-				"checking for DC's.\n",
-				(unsigned int)domain->dc_probe_pid));
-			return true;
-		}
-		domain->dc_probe_pid = (pid_t)-1;
-	}
-
-	domain->dc_probe_pid = fork();
-
-	if (domain->dc_probe_pid == (pid_t)-1) {
-		DEBUG(0, ("fork_child_dc_connect: Could not fork: %s\n", strerror(errno)));
-		return False;
-	}
-
-	if (domain->dc_probe_pid != (pid_t)0) {
-		/* Parent */
-		messaging_register(global_messaging_context(), NULL,
-				   MSG_WINBIND_TRY_TO_GO_ONLINE,
-				   msg_try_to_go_online);
-		messaging_register(global_messaging_context(), NULL,
-				   MSG_WINBIND_FAILED_TO_GO_ONLINE,
-				   msg_failed_to_go_online);
-		return True;
-	}
-
-	/* Child. */
-
-	/* Leave messages blocked - we will never process one. */
-
-	if (!override_logfile) {
-		if (asprintf(&lfile, "%s/log.winbindd-dc-connect", get_dyn_LOGFILEBASE()) == -1) {
-			DBG_ERR("fork_child_dc_connect: "
-				"out of memory in asprintf().\n");
-			_exit(1);
-		}
-	}
-
-	status = winbindd_reinit_after_fork(NULL, lfile);
-	if (!NT_STATUS_IS_OK(status)) {
-		DEBUG(1, ("winbindd_reinit_after_fork failed: %s\n",
-			  nt_errstr(status)));
-		messaging_send_buf(global_messaging_context(),
-				   pid_to_procid(parent_pid),
-				   MSG_WINBIND_FAILED_TO_GO_ONLINE,
-				   (const uint8_t *)domain->name,
-				   strlen(domain->name)+1);
-		_exit(1);
-	}
-	SAFE_FREE(lfile);
-
-	setproctitle("dc-connect child");
-
-	mem_ctx = talloc_init("fork_child_dc_connect");
-	if (!mem_ctx) {
-		DEBUG(0,("talloc_init failed.\n"));
-		messaging_send_buf(global_messaging_context(),
-				   pid_to_procid(parent_pid),
-				   MSG_WINBIND_FAILED_TO_GO_ONLINE,
-				   (const uint8_t *)domain->name,
-				   strlen(domain->name)+1);
-		_exit(1);
-	}
-
-	ok = get_dcs(mem_ctx, domain, &dcs, &num_dcs, 0);
-	TALLOC_FREE(mem_ctx);
-	if (!ok || (num_dcs == 0)) {
-		/* Still offline ? Can't find DC's. */
-		messaging_send_buf(global_messaging_context(),
-				   pid_to_procid(parent_pid),
-				   MSG_WINBIND_FAILED_TO_GO_ONLINE,
-				   (const uint8_t *)domain->name,
-				   strlen(domain->name)+1);
-		_exit(0);
-	}
-
-	/* We got a DC. Send a message to our parent to get it to
-	   try and do the same. */
-
-	messaging_send_buf(global_messaging_context(),
-			   pid_to_procid(parent_pid),
-			   MSG_WINBIND_TRY_TO_GO_ONLINE,
-			   (const uint8_t *)domain->name,
-			   strlen(domain->name)+1);
-	_exit(0);
-}
-
-/****************************************************************
- Handler triggered if we're offline to try and detect a DC.
-****************************************************************/
-
-static void check_domain_online_handler(struct tevent_context *ctx,
-					struct tevent_timer *te,
-					struct timeval now,
-					void *private_data)
-{
-        struct winbindd_domain *domain =
-                (struct winbindd_domain *)private_data;
-
-	DEBUG(10,("check_domain_online_handler: called for domain "
-		  "%s (online = %s)\n", domain->name, 
-		  domain->online ? "True" : "False" ));
-
-	TALLOC_FREE(domain->check_online_event);
-
-	/* Are we still in "startup" mode ? */
-
-	if (domain->startup && (time_mono(NULL) > domain->startup_time + 30)) {
-		/* No longer in "startup" mode. */
-		DEBUG(10,("check_domain_online_handler: domain %s no longer in 'startup' mode.\n",
-			domain->name ));
-		domain->startup = False;
-	}
-
-	/* We've been told to stay offline, so stay
-	   that way. */
-
-	if (get_global_winbindd_state_offline()) {
-		DEBUG(10,("check_domain_online_handler: domain %s remaining globally offline\n",
-			domain->name ));
-		return;
-	}
-
-	/* Fork a child to test if it can contact a DC. 
-	   If it can then send ourselves a message to
-	   cause a reconnect. */
-
-	fork_child_dc_connect(domain);
-}
-


-- 
Samba Shared Repository



More information about the samba-cvs mailing list