[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Thu Nov 3 13:09:01 MDT 2011


The branch, master has been updated
       via  79ab7ac s4-smbtorture: add some ndr validation tests for netlogon_samlogon_response structs.
       via  663c2b4 torture: add torture_assert_guid_equal() macro.
       via  6e67073 waf: convert NDR_NBT into shared library.
       via  3978422 nbt: create standard ndr_pull/push interface for common netlogon samlogon replies.
       via  768b42f nbt: move netlogon_samlogon_response into librpc/ndr/ndr_nbt.h.
       via  185b94e nbt: trim down header dependencies of nbt.idl.
       via  2d39099 s4: add some missing header dependencies.
       via  0de2bf9 nbt: move nbt_string ndr functions to ndr/ndr_nbt.c helper.
       via  72879f4 nbt: merge in LIBCLI_NDR_NETLOGON helper into NDR_NBT.
       via  2417ea4 librpc: remove nbt dependency to svcctl.
       via  2ecd501 librpc: remove nbt dependency to samr.
       via  e426f37 librpc: only let NDR_NBT depend on NDR_NBT_BUF.
      from  05d3a6f s3:param: change default of "* signing" to "default"

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


- Log -----------------------------------------------------------------
commit 79ab7ac33b9c9f5831fdf85f9fec69ede8d45ad1
Author: Günther Deschner <gd at samba.org>
Date:   Thu Nov 3 09:34:04 2011 +0100

    s4-smbtorture: add some ndr validation tests for netlogon_samlogon_response structs.
    
    Guenther
    
    Autobuild-User: Günther Deschner <gd at samba.org>
    Autobuild-Date: Thu Nov  3 20:08:20 CET 2011 on sn-devel-104

commit 663c2b4f162330871f10e5310af09b5df3b62832
Author: Günther Deschner <gd at samba.org>
Date:   Thu Nov 3 11:33:16 2011 +0100

    torture: add torture_assert_guid_equal() macro.
    
    Guenther

commit 6e670739003fc522b02327d033dc03fec13d3c29
Author: Günther Deschner <gd at samba.org>
Date:   Wed Nov 2 18:05:59 2011 +0100

    waf: convert NDR_NBT into shared library.
    
    Guenther

commit 3978422fe1cb2ac1736d7b991bf57418a4837cd1
Author: Günther Deschner <gd at samba.org>
Date:   Wed Oct 12 14:58:46 2011 +0200

    nbt: create standard ndr_pull/push interface for common netlogon samlogon replies.
    
    Guenther

commit 768b42f334fc2504ff9e1e7ec77e4d366220aef8
Author: Günther Deschner <gd at samba.org>
Date:   Thu Nov 3 10:30:37 2011 +0100

    nbt: move netlogon_samlogon_response into librpc/ndr/ndr_nbt.h.
    
    Guenther

commit 185b94eefa009e852f93d9a00e4e8c15c64a0869
Author: Günther Deschner <gd at samba.org>
Date:   Thu Nov 3 14:40:46 2011 +0100

    nbt: trim down header dependencies of nbt.idl.
    
    Guenther

commit 2d390991bd4726a26fac7ee5d33435bdb88e8295
Author: Günther Deschner <gd at samba.org>
Date:   Thu Nov 3 14:07:09 2011 +0100

    s4: add some missing header dependencies.
    
    Guenther

commit 0de2bf97ff4e6d90b54a5a2bf319b0810fd24120
Author: Günther Deschner <gd at samba.org>
Date:   Thu Nov 3 14:39:50 2011 +0100

    nbt: move nbt_string ndr functions to ndr/ndr_nbt.c helper.
    
    Guenther

commit 72879f491f0ef83da874fc6fe4a6f74fdc2b1d39
Author: Günther Deschner <gd at samba.org>
Date:   Wed Nov 2 18:31:40 2011 +0100

    nbt: merge in LIBCLI_NDR_NETLOGON helper into NDR_NBT.
    
    Guenther

commit 2417ea4923e058c802d0fdaa7961d502568553ae
Author: Günther Deschner <gd at samba.org>
Date:   Wed Nov 2 20:08:25 2011 +0100

    librpc: remove nbt dependency to svcctl.
    
    Guenther

commit 2ecd50116c22536f9a77131bc14a64915a2fc12e
Author: Günther Deschner <gd at samba.org>
Date:   Wed Nov 2 20:07:42 2011 +0100

    librpc: remove nbt dependency to samr.
    
    Guenther

commit e426f37b64ea76e0dda19ec06b6da69f0822d599
Author: Günther Deschner <gd at samba.org>
Date:   Wed Nov 2 18:14:07 2011 +0100

    librpc: only let NDR_NBT depend on NDR_NBT_BUF.
    
    Guenther

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

Summary of changes:
 lib/torture/torture.h                       |   10 +
 libcli/nbt/libnbt.h                         |    1 -
 libcli/nbt/nbtname.c                        |  179 -----------
 libcli/nbt/wscript_build                    |    2 +-
 libcli/netlogon/ndr_netlogon.c              |  210 -------------
 libcli/netlogon/ndr_netlogon_proto.h        |   24 --
 libcli/netlogon/netlogon.h                  |   14 -
 libcli/netlogon/wscript_build               |    7 +-
 librpc/idl/misc.idl                         |   40 +++
 librpc/idl/nbt.idl                          |   11 +-
 librpc/idl/samr.idl                         |    7 -
 librpc/idl/schannel.idl                     |    4 +-
 librpc/idl/svcctl.idl                       |   33 --
 librpc/ndr/ndr_nbt.c                        |  447 +++++++++++++++++++++++++++
 librpc/ndr/ndr_nbt.h                        |   52 +++
 librpc/{ndr_krb5pac.pc.in => ndr_nbt.pc.in} |    6 +-
 librpc/wscript_build                        |   18 +-
 source3/Makefile.in                         |    2 +-
 source3/libsmb/clidgram.c                   |    1 +
 source3/libsmb/namequery.c                  |    1 +
 source3/wscript_build                       |    2 +-
 source4/client/client.c                     |    2 +
 source4/libcli/wscript_build                |    4 +-
 source4/librpc/idl/winsif.idl               |    1 +
 source4/librpc/idl/winsrepl.idl             |    3 +-
 source4/librpc/wscript_build                |    8 +-
 source4/smb_server/smb/reply.c              |    1 +
 source4/torture/nbt/winsreplication.c       |    1 +
 source4/torture/ndr/nbt.c                   |   58 ++++-
 29 files changed, 644 insertions(+), 505 deletions(-)
 delete mode 100644 libcli/netlogon/ndr_netlogon.c
 delete mode 100644 libcli/netlogon/ndr_netlogon_proto.h
 create mode 100644 librpc/ndr/ndr_nbt.c
 create mode 100644 librpc/ndr/ndr_nbt.h
 copy librpc/{ndr_krb5pac.pc.in => ndr_nbt.pc.in} (61%)


Changeset truncated at 500 lines:

diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index 00de5e8..96cefcf 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -450,6 +450,16 @@ void torture_result(struct torture_context *test,
 	} \
 	} while(0)
 
+#define torture_assert_guid_equal(torture_ctx,got,expected,cmt)\
+	do { struct GUID __got = (got), __expected = (expected); \
+	if (!GUID_equal(&__got, &__expected)) { \
+		torture_result(torture_ctx, TORTURE_FAIL, \
+			__location__": "#got" was %s, expected %s: %s", \
+			GUID_string(torture_ctx, &__got), GUID_string(torture_ctx, &__expected), cmt); \
+		return false; \
+	} \
+	} while(0)
+
 #define torture_assert_nttime_equal(torture_ctx,got,expected,cmt) \
 	do { NTTIME __got = got, __expected = expected; \
 	if (!nt_time_equal(&__got, &__expected)) { \
diff --git a/libcli/nbt/libnbt.h b/libcli/nbt/libnbt.h
index 21fd859..dcab112 100644
--- a/libcli/nbt/libnbt.h
+++ b/libcli/nbt/libnbt.h
@@ -335,7 +335,6 @@ NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock,
 
 
 NDR_SCALAR_PROTO(wrepl_nbt_name, const struct nbt_name *)
-NDR_SCALAR_PROTO(nbt_string, const char *)
 NDR_BUFFER_PROTO(nbt_name, struct nbt_name)
 NTSTATUS nbt_rcode_to_ntstatus(uint8_t rcode);
 
diff --git a/libcli/nbt/nbtname.c b/libcli/nbt/nbtname.c
index fec8e8e..fd49334 100644
--- a/libcli/nbt/nbtname.c
+++ b/libcli/nbt/nbtname.c
@@ -29,185 +29,6 @@
 #include "system/locale.h"
 #include "lib/util/util_net.h"
 
-/* don't allow an unlimited number of name components */
-#define MAX_COMPONENTS 10
-
-/**
-  print a nbt string
-*/
-_PUBLIC_ void ndr_print_nbt_string(struct ndr_print *ndr, const char *name, const char *s)
-{
-	ndr_print_string(ndr, name, s);
-}
-
-/*
-  pull one component of a nbt_string
-*/
-static enum ndr_err_code ndr_pull_component(struct ndr_pull *ndr,
-					    uint8_t **component,
-					    uint32_t *offset,
-					    uint32_t *max_offset)
-{
-	uint8_t len;
-	unsigned int loops = 0;
-	while (loops < 5) {
-		if (*offset >= ndr->data_size) {
-			return ndr_pull_error(ndr, NDR_ERR_STRING,
-					      "BAD NBT NAME component");
-		}
-		len = ndr->data[*offset];
-		if (len == 0) {
-			*offset += 1;
-			*max_offset = MAX(*max_offset, *offset);
-			*component = NULL;
-			return NDR_ERR_SUCCESS;
-		}
-		if ((len & 0xC0) == 0xC0) {
-			/* its a label pointer */
-			if (1 + *offset >= ndr->data_size) {
-				return ndr_pull_error(ndr, NDR_ERR_STRING,
-						      "BAD NBT NAME component");
-			}
-			*max_offset = MAX(*max_offset, *offset + 2);
-			*offset = ((len&0x3F)<<8) | ndr->data[1 + *offset];
-			*max_offset = MAX(*max_offset, *offset);
-			loops++;
-			continue;
-		}
-		if ((len & 0xC0) != 0) {
-			/* its a reserved length field */
-			return ndr_pull_error(ndr, NDR_ERR_STRING,
-					      "BAD NBT NAME component");
-		}
-		if (*offset + len + 2 > ndr->data_size) {
-			return ndr_pull_error(ndr, NDR_ERR_STRING,
-					      "BAD NBT NAME component");
-		}
-		*component = (uint8_t*)talloc_strndup(
-			ndr->current_mem_ctx,
-			(const char *)&ndr->data[1 + *offset], len);
-		NDR_ERR_HAVE_NO_MEMORY(*component);
-		*offset += len + 1;
-		*max_offset = MAX(*max_offset, *offset);
-		return NDR_ERR_SUCCESS;
-	}
-
-	/* too many pointers */
-	return ndr_pull_error(ndr, NDR_ERR_STRING, "BAD NBT NAME component");
-}
-
-/**
-  pull a nbt_string from the wire
-*/
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_string(struct ndr_pull *ndr, int ndr_flags, const char **s)
-{
-	uint32_t offset = ndr->offset;
-	uint32_t max_offset = offset;
-	unsigned num_components;
-	char *name;
-
-	if (!(ndr_flags & NDR_SCALARS)) {
-		return NDR_ERR_SUCCESS;
-	}
-
-	name = NULL;
-
-	/* break up name into a list of components */
-	for (num_components=0;num_components<MAX_COMPONENTS;num_components++) {
-		uint8_t *component = NULL;
-		NDR_CHECK(ndr_pull_component(ndr, &component, &offset, &max_offset));
-		if (component == NULL) break;
-		if (name) {
-			name = talloc_asprintf_append_buffer(name, ".%s", component);
-			NDR_ERR_HAVE_NO_MEMORY(name);
-		} else {
-			name = (char *)component;
-		}
-	}
-	if (num_components == MAX_COMPONENTS) {
-		return ndr_pull_error(ndr, NDR_ERR_STRING,
-				      "BAD NBT NAME too many components");
-	}
-	if (num_components == 0) {
-		name = talloc_strdup(ndr->current_mem_ctx, "");
-		NDR_ERR_HAVE_NO_MEMORY(name);
-	}
-
-	(*s) = name;
-	ndr->offset = max_offset;
-
-	return NDR_ERR_SUCCESS;
-}
-
-/**
-  push a nbt string to the wire
-*/
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_string(struct ndr_push *ndr, int ndr_flags, const char *s)
-{
-	if (!(ndr_flags & NDR_SCALARS)) {
-		return NDR_ERR_SUCCESS;
-	}
-
-	while (s && *s) {
-		enum ndr_err_code ndr_err;
-		char *compname;
-		size_t complen;
-		uint32_t offset;
-
-		/* see if we have pushed the remaing string allready,
-		 * if so we use a label pointer to this string
-		 */
-		ndr_err = ndr_token_retrieve_cmp_fn(&ndr->nbt_string_list, s, &offset, (comparison_fn_t)strcmp, false);
-		if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-			uint8_t b[2];
-
-			if (offset > 0x3FFF) {
-				return ndr_push_error(ndr, NDR_ERR_STRING,
-						      "offset for nbt string label pointer %u[%08X] > 0x00003FFF",
-						      offset, offset);
-			}
-
-			b[0] = 0xC0 | (offset>>8);
-			b[1] = (offset & 0xFF);
-
-			return ndr_push_bytes(ndr, b, 2);
-		}
-
-		complen = strcspn(s, ".");
-
-		/* we need to make sure the length fits into 6 bytes */
-		if (complen > 0x3F) {
-			return ndr_push_error(ndr, NDR_ERR_STRING,
-					      "component length %u[%08X] > 0x0000003F",
-					      (unsigned)complen, (unsigned)complen);
-		}
-
-		compname = talloc_asprintf(ndr, "%c%*.*s",
-						(unsigned char)complen,
-						(unsigned char)complen,
-						(unsigned char)complen, s);
-		NDR_ERR_HAVE_NO_MEMORY(compname);
-
-		/* remember the current componemt + the rest of the string
-		 * so it can be reused later
-		 */
-		NDR_CHECK(ndr_token_store(ndr, &ndr->nbt_string_list, s, ndr->offset));
-
-		/* push just this component into the blob */
-		NDR_CHECK(ndr_push_bytes(ndr, (const uint8_t *)compname, complen+1));
-		talloc_free(compname);
-
-		s += complen;
-		if (*s == '.') s++;
-	}
-
-	/* if we reach the end of the string and have pushed the last component
-	 * without using a label pointer, we need to terminate the string
-	 */
-	return ndr_push_bytes(ndr, (const uint8_t *)"", 1);
-}
-
-
 /*
   decompress a 'compressed' name component
  */
diff --git a/libcli/nbt/wscript_build b/libcli/nbt/wscript_build
index b531dba..a70db08 100644
--- a/libcli/nbt/wscript_build
+++ b/libcli/nbt/wscript_build
@@ -13,7 +13,7 @@ bld.SAMBA_SUBSYSTEM('lmhosts',
 
 bld.SAMBA_LIBRARY('cli-nbt',
                   source='nbtsocket.c namequery.c nameregister.c namerefresh.c namerelease.c',
-                  public_deps='ndr NDR_NBT tevent tevent-util NDR_SECURITY samba_socket samba-util lmhosts',
+                  public_deps='ndr ndr_nbt tevent tevent-util NDR_SECURITY samba_socket samba-util lmhosts',
                   private_library=True
                   )
 
diff --git a/libcli/netlogon/ndr_netlogon.c b/libcli/netlogon/ndr_netlogon.c
deleted file mode 100644
index 7d6aa97..0000000
--- a/libcli/netlogon/ndr_netlogon.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-
-   CLDAP server structures
-
-   Copyright (C) Andrew Bartlett <abartlet at samba.org> 2008
-
-   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/>.
-*/
-
-/* parser auto-generated by pidl, then hand-modified by abartlet */
-
-#include "includes.h"
-#include "../libcli/netlogon/netlogon.h"
-
-/* Manually modified to handle the dom_sid being optional based on if it is present or all zero */
-enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r)
-{
-	if (ndr_flags & NDR_SCALARS) {
-		NDR_CHECK(ndr_push_align(ndr, 4));
-		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->request_count));
-		{
-			uint32_t _flags_save_string = ndr->flags;
-			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
-			NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name));
-			ndr->flags = _flags_save_string;
-		}
-		{
-			uint32_t _flags_save_string = ndr->flags;
-			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
-			NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name));
-			ndr->flags = _flags_save_string;
-		}
-		{
-			uint32_t _flags_save_string = ndr->flags;
-			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
-			NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mailslot_name));
-			ndr->flags = _flags_save_string;
-		}
-		NDR_CHECK(ndr_push_samr_AcctFlags(ndr, NDR_SCALARS, r->acct_control));
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags)));
-		if (ndr_size_dom_sid0(&r->sid, ndr->flags)) {
-			struct ndr_push *_ndr_sid;
-			uint32_t _flags_save_DATA_BLOB = ndr->flags;
-			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
-			NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
-			ndr->flags = _flags_save_DATA_BLOB;
-			NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
-			NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
-			NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
-		}
-		NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
-		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
-		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
-	}
-	if (ndr_flags & NDR_BUFFERS) {
-	}
-	return NDR_ERR_SUCCESS;
-}
-
-/* Manually modified to handle the dom_sid being optional based on if it is present (size is non-zero) or not */
-enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r)
-{
-	if (ndr_flags & NDR_SCALARS) {
-		NDR_CHECK(ndr_pull_align(ndr, 4));
-		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->request_count));
-		{
-			uint32_t _flags_save_string = ndr->flags;
-			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
-			NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name));
-			ndr->flags = _flags_save_string;
-		}
-		{
-			uint32_t _flags_save_string = ndr->flags;
-			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
-			NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name));
-			ndr->flags = _flags_save_string;
-		}
-		{
-			uint32_t _flags_save_string = ndr->flags;
-			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
-			NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mailslot_name));
-			ndr->flags = _flags_save_string;
-		}
-		NDR_CHECK(ndr_pull_samr_AcctFlags(ndr, NDR_SCALARS, &r->acct_control));
-		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size));
-		if (r->sid_size) {
-			uint32_t _flags_save_DATA_BLOB = ndr->flags;
-			struct ndr_pull *_ndr_sid;
-			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
-			NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
-			ndr->flags = _flags_save_DATA_BLOB;
-			NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size));
-			NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
-			NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size));
-		} else {
-			ZERO_STRUCT(r->sid);
-		}
-		NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
-		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
-		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
-	}
-	if (ndr_flags & NDR_BUFFERS) {
-	}
-	return NDR_ERR_SUCCESS;
-}
-
-/* Manually modified to only push some parts of the structure if certain flags are set */
-enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r)
-{
-	{
-		uint32_t _flags_save_STRUCT = ndr->flags;
-		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
-		if (ndr_flags & NDR_SCALARS) {
-			NDR_CHECK(ndr_push_align(ndr, 4));
-			NDR_CHECK(ndr_push_netlogon_command(ndr, NDR_SCALARS, r->command));
-			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->sbz));
-			NDR_CHECK(ndr_push_nbt_server_type(ndr, NDR_SCALARS, r->server_type));
-			NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
-			NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->forest));
-			NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->dns_domain));
-			NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_dns_name));
-			NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->domain_name));
-			NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->pdc_name));
-			NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->user_name));
-			NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->server_site));
-			NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->client_site));
-			if (r->nt_version & NETLOGON_NT_VERSION_5EX_WITH_IP) {
-				NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags)));
-				{
-					struct ndr_push *_ndr_sockaddr;
-					NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags)));
-					NDR_CHECK(ndr_push_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS|NDR_BUFFERS, &r->sockaddr));
-					NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sockaddr, 0, ndr_size_nbt_sockaddr(&r->sockaddr, ndr->flags)));
-				}
-			}
-			if (r->nt_version & NETLOGON_NT_VERSION_WITH_CLOSEST_SITE) {
-				NDR_CHECK(ndr_push_nbt_string(ndr, NDR_SCALARS, r->next_closest_site));
-			}
-			NDR_CHECK(ndr_push_netlogon_nt_version_flags(ndr, NDR_SCALARS, r->nt_version));
-			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
-			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
-		}
-		if (ndr_flags & NDR_BUFFERS) {
-			NDR_CHECK(ndr_push_GUID(ndr, NDR_BUFFERS, &r->domain_uuid));
-		}
-		ndr->flags = _flags_save_STRUCT;
-	}
-	return NDR_ERR_SUCCESS;
-}
-
-/* Manually modified to only pull some parts of the structure if certain flags provided */
-enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r,
-								     uint32_t nt_version_flags)
-{
-	{
-		uint32_t _flags_save_STRUCT = ndr->flags;
-		ZERO_STRUCTP(r);
-		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
-		if (ndr_flags & NDR_SCALARS) {
-			NDR_CHECK(ndr_pull_align(ndr, 4));
-			NDR_CHECK(ndr_pull_netlogon_command(ndr, NDR_SCALARS, &r->command));
-			NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->sbz));
-			NDR_CHECK(ndr_pull_nbt_server_type(ndr, NDR_SCALARS, &r->server_type));
-			NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->domain_uuid));
-			NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->forest));
-			NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->dns_domain));
-			NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_dns_name));
-			NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->domain_name));
-			NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->pdc_name));
-			NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->user_name));
-			NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->server_site));
-			NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->client_site));
-			if (nt_version_flags & NETLOGON_NT_VERSION_5EX_WITH_IP) {
-				NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->sockaddr_size));
-				{
-					struct ndr_pull *_ndr_sockaddr;
-					NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sockaddr, 0, r->sockaddr_size));
-					NDR_CHECK(ndr_pull_nbt_sockaddr(_ndr_sockaddr, NDR_SCALARS|NDR_BUFFERS, &r->sockaddr));
-					NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sockaddr, 0, r->sockaddr_size));
-				}
-			}
-			if (nt_version_flags & NETLOGON_NT_VERSION_WITH_CLOSEST_SITE) {
-				NDR_CHECK(ndr_pull_nbt_string(ndr, NDR_SCALARS, &r->next_closest_site));
-			}
-			NDR_CHECK(ndr_pull_netlogon_nt_version_flags(ndr, NDR_SCALARS, &r->nt_version));
-			if (r->nt_version != nt_version_flags) {
-				return NDR_ERR_VALIDATE;
-			}
-			NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
-			NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
-		}
-		if (ndr_flags & NDR_BUFFERS) {
-			NDR_CHECK(ndr_pull_GUID(ndr, NDR_BUFFERS, &r->domain_uuid));
-		}
-		ndr->flags = _flags_save_STRUCT;
-	}
-	return NDR_ERR_SUCCESS;
-}
diff --git a/libcli/netlogon/ndr_netlogon_proto.h b/libcli/netlogon/ndr_netlogon_proto.h
deleted file mode 100644
index ca61c16..0000000
--- a/libcli/netlogon/ndr_netlogon_proto.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _____LIBCLI_NDR_NETLOGON_PROTO_H__
-#define _____LIBCLI_NDR_NETLOGON_PROTO_H__
-
-#undef _PRINTF_ATTRIBUTE
-#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
-/* This file was automatically generated by mkproto.pl. DO NOT EDIT */
-
-/* this file contains prototypes for functions that are private 
- * to this subsystem or library. These functions should not be 
- * used outside this particular subsystem! */
-
-
-/* The following definitions come from ../libcli/ndr_netlogon.c  */
-
-enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r);
-enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r);
-enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r);
-enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r,
-								     uint32_t nt_version_flags);
-#undef _PRINTF_ATTRIBUTE
-#define _PRINTF_ATTRIBUTE(a1, a2)
-
-#endif /* _____LIBCLI_NDR_NETLOGON_PROTO_H__ */
-
diff --git a/libcli/netlogon/netlogon.h b/libcli/netlogon/netlogon.h
index 9bf346a..0bf2a4c 100644
--- a/libcli/netlogon/netlogon.h
+++ b/libcli/netlogon/netlogon.h
@@ -26,19 +26,6 @@
 
 #include "librpc/gen_ndr/ndr_misc.h"
 #include "librpc/gen_ndr/ndr_security.h"
-#include "librpc/gen_ndr/ndr_svcctl.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-
-struct netlogon_samlogon_response
-{
-	uint32_t ntver;
-	union {
-		struct NETLOGON_SAM_LOGON_RESPONSE_NT40 nt4;
-		struct NETLOGON_SAM_LOGON_RESPONSE nt5;
-		struct NETLOGON_SAM_LOGON_RESPONSE_EX nt5_ex;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list