[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Thu Jun 7 00:36:02 MDT 2012


The branch, master has been updated
       via  0dd4363 build: Tidy up broken posix_fallocate tests
       via  06c90cb s4-libcli: Remove unused finddcs_nbt
       via  1e28aa1 build: Add missing deps and make MESSAGING a private library
      from  15cebf3 util: fix build on platforms without IPv6 support

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


- Log -----------------------------------------------------------------
commit 0dd4363bb2d7d6dd361f859c38c0611b4c98a71d
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 7 14:29:44 2012 +1000

    build: Tidy up broken posix_fallocate tests
    
    This makes the code and output for in waf and autoconf identical.
    
    Andrew Bartlett
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Jun  7 08:35:33 CEST 2012 on sn-devel-104

commit 06c90cb6f55701effa4cbafaf189a4de8471949b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 7 14:21:25 2012 +1000

    s4-libcli: Remove unused finddcs_nbt
    
    This would only do the NBT getdc lookup for a single DC (but would
    find multiple DCs at first stage), but more particular it of course
    uses Netbios rather than DNS names.
    
    In any case it was also unused, as we use CLDAP for reliable DC
    location these days.
    
    Found by callcatcher
    
    Andrew Bartlett

commit 1e28aa147f23439273d892c1223969091b3ca90a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 7 14:19:43 2012 +1000

    build: Add missing deps and make MESSAGING a private library
    
    To remove finddcs_nbt these missing deps need to be added.  These
    subsystems linked to to implicit dependencies provided by finddcs.
    Due to the new arrangmenet of subsystems, MESSAGING needs to be a
    private library to avoid being a source of duplicate symbols.
    
    Andrew Bartlett

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

Summary of changes:
 source3/configure.in                               |    4 +-
 source3/wscript                                    |    2 +-
 source4/auth/ntlm/wscript_build                    |    2 +-
 .../dsdb/samdb/ldb_modules/wscript_build_server    |    2 +-
 source4/lib/messaging/wscript_build                |    5 +-
 source4/libcli/finddcs_nbt.c                       |  311 --------------------
 source4/libcli/wscript_build                       |    6 +-
 source4/librpc/wscript_build                       |    2 +-
 source4/torture/wscript_build                      |    6 +-
 source4/wscript_build                              |    2 +-
 10 files changed, 16 insertions(+), 326 deletions(-)
 delete mode 100644 source4/libcli/finddcs_nbt.c


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index cf4e13e..f2885d2 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -2800,13 +2800,13 @@ AC_TRY_COMPILE([
   #define _XOPEN_SOURCE 600
   #include <stdlib.h>
   #if defined(__GLIBC__) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 4))
-    probably broken posix_fallocate
+  #error probably broken posix_fallocate
   #endif
 ], [
 ], 
 samba_cv_HAVE_BROKEN_POSIX_FALLOCATE=no,samba_cv_HAVE_BROKEN_POSIX_FALLOCATE=yes)])
 if test x"$samba_cv_HAVE_BROKEN_POSIX_FALLOCATE" = xyes; then
-	AC_DEFINE(HAVE_BROKEN_POSIX_FALLOCATE,, Whether we have a broken posix_fallocate)
+	AC_DEFINE(HAVE_BROKEN_POSIX_FALLOCATE, 1, Whether we have a broken posix_fallocate)
 fi
 
 
diff --git a/source3/wscript b/source3/wscript
index ccedb69..a9368b2 100755
--- a/source3/wscript
+++ b/source3/wscript
@@ -812,7 +812,7 @@ int i; i = PAM_RADIO_TYPE;
 #endif
 ''',
                            '_HAVE_UNBROKEN_POSIX_FALLOCATE',
-                           msg='for broken posix_fallocate'):
+                           msg='Checking for broken posix_fallocate'):
         conf.DEFINE('HAVE_BROKEN_POSIX_FALLOCATE', '1')
 
 
diff --git a/source4/auth/ntlm/wscript_build b/source4/auth/ntlm/wscript_build
index 2745094..f9e3900 100644
--- a/source4/auth/ntlm/wscript_build
+++ b/source4/auth/ntlm/wscript_build
@@ -4,7 +4,7 @@ bld.SAMBA_MODULE('auth4_sam_module',
 	source='auth_sam.c',
 	subsystem='auth4',
 	init_function='auth4_sam_init',
-	deps='samdb auth4_sam NTLMSSP_COMMON samba-hostconfig'
+	deps='samdb auth4_sam NTLMSSP_COMMON samba-hostconfig RPC_NDR_IRPC MESSAGING'
 	)
 
 
diff --git a/source4/dsdb/samdb/ldb_modules/wscript_build_server b/source4/dsdb/samdb/ldb_modules/wscript_build_server
index ae184dc..f6bb5e6 100755
--- a/source4/dsdb/samdb/ldb_modules/wscript_build_server
+++ b/source4/dsdb/samdb/ldb_modules/wscript_build_server
@@ -106,7 +106,7 @@ bld.SAMBA_MODULE('ldb_rootdse',
 	init_function='ldb_rootdse_module_init',
 	module_init_name='ldb_init_module',
 	internal_module=False,
-	deps='talloc samdb MESSAGING security DSDB_MODULE_HELPERS'
+	deps='talloc samdb MESSAGING security DSDB_MODULE_HELPERS RPC_NDR_IRPC'
 	)
 
 
diff --git a/source4/lib/messaging/wscript_build b/source4/lib/messaging/wscript_build
index 38f1fab..4f352a7 100644
--- a/source4/lib/messaging/wscript_build
+++ b/source4/lib/messaging/wscript_build
@@ -1,9 +1,10 @@
 #!/usr/bin/env python
 
 
-bld.SAMBA_SUBSYSTEM('MESSAGING',
+bld.SAMBA_LIBRARY('MESSAGING',
 	source='messaging.c',
-	public_deps='samba-util tdb-wrap NDR_IRPC UNIX_PRIVS util_tdb cluster ndr samba_socket dcerpc'
+	public_deps='samba-util tdb-wrap NDR_IRPC UNIX_PRIVS util_tdb cluster ndr samba_socket dcerpc',
+                  private_library=True
 	)
 
 
diff --git a/source4/libcli/finddcs_nbt.c b/source4/libcli/finddcs_nbt.c
deleted file mode 100644
index 6a5d1fd..0000000
--- a/source4/libcli/finddcs_nbt.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-
-   a composite API for finding a DC and its name
-
-   Copyright (C) Volker Lendecke 2005
-   Copyright (C) Andrew Bartlett <abartlet at samba.org> 2006
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "include/includes.h"
-#include <tevent.h>
-#include "lib/messaging/irpc.h"
-#include "librpc/gen_ndr/ndr_irpc_c.h"
-#include "libcli/composite/composite.h"
-#include "libcli/libcli.h"
-#include "libcli/resolve/resolve.h"
-#include "lib/util/tevent_ntstatus.h"
-#include "libcli/finddc.h"
-
-struct finddcs_nbt_state {
-	struct tevent_context *ev;
-	struct tevent_req *req;
-	struct imessaging_context *msg_ctx;
-
-	const char *my_netbios_name;
-	const char *domain_name;
-	struct dom_sid *domain_sid;
-
-	struct nbtd_getdcname r;
-	struct nbt_name_status node_status;
-
-	int num_dcs;
-	struct nbt_dc_name *dcs;
-	uint16_t nbt_port;
-};
-
-static void finddcs_nbt_name_resolved(struct composite_context *ctx);
-static void finddcs_nbt_getdc_replied(struct tevent_req *subreq);
-static void fallback_node_status(struct finddcs_nbt_state *state);
-static void fallback_node_status_replied(struct nbt_name_request *name_req);
-
-/*
- * Setup and send off the a normal name resolution for the target name.
- *
- * The domain_sid parameter is optional, and is used in the subsequent getdc request.
- *
- * This will try a GetDC request, but this may not work.  It will try
- * a node status as a fallback, then return no name (but still include
- * the IP)
- */
-
-struct tevent_req *finddcs_nbt_send(TALLOC_CTX *mem_ctx,
-				const char *my_netbios_name,
-				uint16_t nbt_port,
-				const char *domain_name,
-				int name_type,
-				struct dom_sid *domain_sid,
-				struct resolve_context *resolve_ctx,
-				struct tevent_context *event_ctx,
-				struct imessaging_context *msg_ctx)
-{
-	struct finddcs_nbt_state *state;
-	struct nbt_name name;
-	struct tevent_req *req;
-	struct composite_context *creq;
-
-	req = tevent_req_create(mem_ctx, &state, struct finddcs_nbt_state);
-	if (req == NULL) {
-		return NULL;
-	}
-
-	state->req = req;
-	state->ev = event_ctx;
-	state->nbt_port = nbt_port;
-	state->my_netbios_name = talloc_strdup(state, my_netbios_name);
-	if (tevent_req_nomem(state->my_netbios_name, req)) {
-		return tevent_req_post(req, event_ctx);
-	}
-	state->domain_name = talloc_strdup(state, domain_name);
-	if (tevent_req_nomem(state->domain_name, req)) {
-		return tevent_req_post(req, event_ctx);
-	}
-
-	if (domain_sid) {
-		state->domain_sid = talloc_reference(state, domain_sid);
-		if (tevent_req_nomem(state->domain_sid, req)) {
-			return tevent_req_post(req, event_ctx);
-		}
-	} else {
-		state->domain_sid = NULL;
-	}
-
-	state->msg_ctx = msg_ctx;
-
-	make_nbt_name(&name, state->domain_name, name_type);
-	creq = resolve_name_send(resolve_ctx, state, &name, event_ctx);
-	if (tevent_req_nomem(creq, req)) {
-		return tevent_req_post(req, event_ctx);
-	}
-	creq->async.fn = finddcs_nbt_name_resolved;
-	creq->async.private_data = state;
-
-	return req;
-}
-
-/* Having got an name query answer, fire off a GetDC request, so we
- * can find the target's all-important name.  (Kerberos and some
- * netlogon operations are quite picky about names)
- *
- * The name is a courtesy, if we don't find it, don't completely fail.
- *
- * However, if the nbt server is down, fall back to a node status
- * request
- */
-static void finddcs_nbt_name_resolved(struct composite_context *ctx)
-{
-	struct finddcs_nbt_state *state =
-		talloc_get_type(ctx->async.private_data, struct finddcs_nbt_state);
-	struct tevent_req *subreq;
-	struct dcerpc_binding_handle *irpc_handle;
-	const char *address;
-	NTSTATUS status;
-
-	status = resolve_name_recv(ctx, state, &address);
-	if (tevent_req_nterror(state->req, status)) {
-		return;
-	}
-
-	/* TODO: This should try and find all the DCs, and give the
-	 * caller them in the order they responded */
-
-	state->num_dcs = 1;
-	state->dcs = talloc_array(state, struct nbt_dc_name, state->num_dcs);
-	if (tevent_req_nomem(state->dcs, state->req)) {
-		return;
-	}
-
-	state->dcs[0].address = talloc_steal(state->dcs, address);
-
-	/* Try and find the nbt server.  Fallback to a node status
-	 * request if we can't make this happen The nbt server just
-	 * might not be running, or we may not have a messaging
-	 * context (not root etc) */
-	if (!state->msg_ctx) {
-		fallback_node_status(state);
-		return;
-	}
-
-	irpc_handle = irpc_binding_handle_by_name(state, state->msg_ctx,
-						  "nbt_server", &ndr_table_irpc);
-	if (irpc_handle == NULL) {
-		fallback_node_status(state);
-		return;
-	}
-
-	state->r.in.domainname = state->domain_name;
-	state->r.in.ip_address = state->dcs[0].address;
-	state->r.in.my_computername = state->my_netbios_name;
-	state->r.in.my_accountname = talloc_asprintf(state, "%s$", state->my_netbios_name);
-	if (tevent_req_nomem(state->r.in.my_accountname, state->req)) {
-		return;
-	}
-	state->r.in.account_control = ACB_WSTRUST;
-	state->r.in.domain_sid = state->domain_sid;
-	if (state->r.in.domain_sid == NULL) {
-		state->r.in.domain_sid = talloc_zero(state, struct dom_sid);
-	}
-
-	subreq = dcerpc_nbtd_getdcname_r_send(state, state->ev,
-					      irpc_handle, &state->r);
-	if (tevent_req_nomem(subreq, state->req)) {
-		return;
-	}
-	tevent_req_set_callback(subreq, finddcs_nbt_getdc_replied, state);
-}
-
-/* Called when the GetDC request returns */
-static void finddcs_nbt_getdc_replied(struct tevent_req *subreq)
-{
-	struct finddcs_nbt_state *state =
-		tevent_req_callback_data(subreq,
-		struct finddcs_nbt_state);
-	NTSTATUS status;
-
-	status = dcerpc_nbtd_getdcname_r_recv(subreq, state);
-	TALLOC_FREE(subreq);
-	if (!NT_STATUS_IS_OK(status)) {
-		fallback_node_status(state);
-		return;
-	}
-
-	state->dcs[0].name = talloc_steal(state->dcs, state->r.out.dcname);
-	tevent_req_done(state->req);
-}
-
-/* The GetDC request might not be available (such as occours when the
- * NBT server is down).  Fallback to a node status.  It is the best
- * hope we have... */
-static void fallback_node_status(struct finddcs_nbt_state *state)
-{
-	struct nbt_name_socket *nbtsock;
-	struct nbt_name_request *name_req;
-
-	state->node_status.in.name.name = "*";
-	state->node_status.in.name.type = NBT_NAME_CLIENT;
-	state->node_status.in.name.scope = NULL;
-	state->node_status.in.dest_addr = state->dcs[0].address;
-	state->node_status.in.dest_port = state->nbt_port;
-	state->node_status.in.timeout = 1;
-	state->node_status.in.retries = 2;
-
-	nbtsock = nbt_name_socket_init(state, state->ev);
-	if (tevent_req_nomem(nbtsock, state->req)) {
-		return;
-	}
-
-	name_req = nbt_name_status_send(nbtsock, &state->node_status);
-	if (tevent_req_nomem(name_req, state->req)) {
-		return;
-	}
-
-	name_req->async.fn = fallback_node_status_replied;
-	name_req->async.private_data = state;
-}
-
-/* We have a node status reply (or perhaps a timeout) */
-static void fallback_node_status_replied(struct nbt_name_request *name_req)
-{
-	int i;
-	struct finddcs_nbt_state *state = talloc_get_type(name_req->async.private_data, struct finddcs_nbt_state);
-	NTSTATUS status;
-
-	status = nbt_name_status_recv(name_req, state, &state->node_status);
-	if (tevent_req_nterror(state->req, status)) {
-		return;
-	}
-
-	for (i=0; i < state->node_status.out.status.num_names; i++) {
-		int j;
-		if (state->node_status.out.status.names[i].type == NBT_NAME_SERVER) {
-			char *name = talloc_strndup(state->dcs, state->node_status.out.status.names[0].name, 15);
-			/* Strip space padding */
-			if (name) {
-				j = MIN(strlen(name), 15);
-				for (; j > 0 && name[j - 1] == ' '; j--) {
-					name[j - 1] = '\0';
-				}
-			}
-			state->dcs[0].name = name;
-			tevent_req_done(state->req);
-			return;
-		}
-	}
-	tevent_req_nterror(state->req, NT_STATUS_NO_LOGON_SERVERS);
-}
-
-NTSTATUS finddcs_nbt_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
-		      int *num_dcs, struct nbt_dc_name **dcs)
-{
-	struct finddcs_nbt_state *state = tevent_req_data(req, struct finddcs_nbt_state);
-	bool ok;
-	NTSTATUS status;
-
-	ok = tevent_req_poll(req, state->ev);
-	if (!ok) {
-		talloc_free(req);
-		return NT_STATUS_INTERNAL_ERROR;
-	}
-	status = tevent_req_simple_recv_ntstatus(req);
-	if (NT_STATUS_IS_OK(status)) {
-		*num_dcs = state->num_dcs;
-		*dcs = talloc_steal(mem_ctx, state->dcs);
-	}
-	return status;
-}
-
-NTSTATUS finddcs_nbt(TALLOC_CTX *mem_ctx,
-		 const char *my_netbios_name,
-		 uint16_t nbt_port,
-		 const char *domain_name, int name_type,
-		 struct dom_sid *domain_sid,
-		 struct resolve_context *resolve_ctx,
-		 struct tevent_context *event_ctx,
-		 struct imessaging_context *msg_ctx,
-		 int *num_dcs, struct nbt_dc_name **dcs)
-{
-	NTSTATUS status;
-	struct tevent_req *req = finddcs_nbt_send(mem_ctx,
-					      my_netbios_name,
-					      nbt_port,
-					      domain_name, name_type,
-					      domain_sid,
-					      resolve_ctx,
-					      event_ctx, msg_ctx);
-	status = finddcs_nbt_recv(req, mem_ctx, num_dcs, dcs);
-	talloc_free(req);
-	return status;
-}
diff --git a/source4/libcli/wscript_build b/source4/libcli/wscript_build
index 97507ff..a2de9a8 100755
--- a/source4/libcli/wscript_build
+++ b/source4/libcli/wscript_build
@@ -12,7 +12,7 @@ bld.SAMBA_SUBSYSTEM('LIBSAMBA_TSOCKET',
 bld.SAMBA_SUBSYSTEM('LIBCLI_LSA',
 	source='util/clilsa.c',
 	autoproto='util/clilsa.h',
-	public_deps='RPC_NDR_LSA',
+	public_deps='RPC_NDR_LSA dcerpc',
 	deps='security'
 	)
 
@@ -67,9 +67,9 @@ bld.SAMBA_SUBSYSTEM('LP_RESOLVE',
 
 
 bld.SAMBA_SUBSYSTEM('LIBCLI_FINDDCS',
-	source='finddcs_nbt.c finddcs_cldap.c',
+	source='finddcs_cldap.c',
 	autoproto='finddcs_proto.h',
-	public_deps='cli-nbt MESSAGING RPC_NDR_IRPC cli_cldap'
+	public_deps='cli_cldap'
 	)
 
 
diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build
index bf36d1d..494ff12 100755
--- a/source4/librpc/wscript_build
+++ b/source4/librpc/wscript_build
@@ -158,7 +158,7 @@ bld.SAMBA_LIBRARY('dcerpc',
 
 bld.SAMBA_SUBSYSTEM('pyrpc_util',
 	source='rpc/pyrpc_util.c',
-	public_deps='pytalloc-util pyparam_util dcerpc',
+	public_deps='pytalloc-util pyparam_util dcerpc MESSAGING',
 	pyext=True,
 	)
 
diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build
index c0f003d..70829f5 100755
--- a/source4/torture/wscript_build
+++ b/source4/torture/wscript_build
@@ -165,14 +165,14 @@ bld.SAMBA_BINARY('smbtorture',
 bld.SAMBA_BINARY('gentest',
 	source='gentest.c',
 	manpages='man/gentest.1',
-	deps='samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB smbclient-raw'
+	deps='samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB smbclient-raw param_options'
 	)
 
 
 bld.SAMBA_BINARY('masktest',
 	source='masktest.c',
 	manpages='man/masktest.1',
-	deps='samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB'
+	deps='samba-hostconfig samba-util popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB param_options'
 	)
 
 
@@ -183,6 +183,6 @@ bld.SAMBA_BINARY('locktest',
 	#cflags='--coverage',
 	# GCOV='1',
 	manpages='man/locktest.1',
-	deps='popt POPT_SAMBA POPT_CREDENTIALS samba-util LIBCLI_SMB samba-hostconfig',
+	deps='popt POPT_SAMBA POPT_CREDENTIALS samba-util LIBCLI_SMB samba-hostconfig param_options',
 	)
 
diff --git a/source4/wscript_build b/source4/wscript_build
index 3996a12..af71e80 100644
--- a/source4/wscript_build
+++ b/source4/wscript_build
@@ -2,7 +2,7 @@
 
 bld.SAMBA_BINARY('client/smbclient'  + bld.env.suffix4,
 	source='client/client.c',
-	deps='samba-hostconfig SMBREADLINE samba-util LIBCLI_SMB RPC_NDR_SRVSVC LIBCLI_LSA popt POPT_SAMBA POPT_CREDENTIALS smbclient-raw param_options'
+	deps='samba-hostconfig SMBREADLINE samba-util LIBCLI_SMB RPC_NDR_SRVSVC LIBCLI_LSA popt POPT_SAMBA POPT_CREDENTIALS smbclient-raw param_options dcerpc'
 	)
 
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list