[SCM] Samba Shared Repository - branch master updated - 04979bcfb4f9575afc5bec58a53e840479ee3012

Günther Deschner gd at samba.org
Wed Sep 24 01:39:45 GMT 2008


The branch, master has been updated
       via  04979bcfb4f9575afc5bec58a53e840479ee3012 (commit)
       via  3ee016be9cb6d8d13efcf24fae5d5f0f314379c8 (commit)
       via  f07431f5ba59f01975bcb8a012c94a70a0d1408b (commit)
       via  e867ff52d7a88e15a74edd0dbc775fb698268480 (commit)
       via  a877745dc770c93dcb14b08b5d29b9e96b63f5e3 (commit)
      from  1ea185a340993653650230c293ca5139ac225d30 (commit)

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


- Log -----------------------------------------------------------------
commit 04979bcfb4f9575afc5bec58a53e840479ee3012
Author: Günther Deschner <gd at samba.org>
Date:   Wed Sep 24 02:44:34 2008 +0200

    s3: fix idmap_adex.
    
    Guenther

commit 3ee016be9cb6d8d13efcf24fae5d5f0f314379c8
Author: Günther Deschner <gd at samba.org>
Date:   Wed Sep 24 01:16:10 2008 +0200

    libcli: add some basic debugging functions for netlogon helper.
    
    Guenther

commit f07431f5ba59f01975bcb8a012c94a70a0d1408b
Author: Günther Deschner <gd at samba.org>
Date:   Tue Sep 23 22:21:52 2008 +0200

    s3-nbt: use the new generated nbt.
    
    Guenther

commit e867ff52d7a88e15a74edd0dbc775fb698268480
Author: Günther Deschner <gd at samba.org>
Date:   Tue Sep 23 22:16:15 2008 +0200

    s3: re-run make samba3-idl.
    
    Guenther

commit a877745dc770c93dcb14b08b5d29b9e96b63f5e3
Author: Günther Deschner <gd at samba.org>
Date:   Tue Sep 23 22:15:38 2008 +0200

    s3-nbt: full merge of s4 nbt idl.
    
    Guenther

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

Summary of changes:
 libcli/netlogon.c                        |   11 +
 source3/Makefile.in                      |    2 +
 source3/include/includes.h               |    1 +
 source3/include/proto.h                  |  100 +--
 source3/libads/cldap.c                   |  117 +--
 source3/libads/ldap.c                    |    2 +-
 source3/librpc/gen_ndr/nbt.h             |  352 ++---
 source3/librpc/gen_ndr/ndr_nbt.c         | 2587 +++++++-----------------------
 source3/librpc/gen_ndr/ndr_nbt.h         |   61 +-
 source3/librpc/idl/nbt.idl               |  417 ++----
 source3/libsmb/clidgram.c                |   91 +-
 source3/libsmb/dsgetdcname.c             |  322 ++---
 source3/utils/net_ads.c                  |    8 +-
 source3/winbindd/idmap_adex/gc_util.c    |    2 +-
 source3/winbindd/idmap_adex/idmap_adex.c |    2 +-
 source3/winbindd/idmap_adex/idmap_adex.h |    2 +-
 16 files changed, 1024 insertions(+), 3053 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/netlogon.c b/libcli/netlogon.c
index 47d665c..ab5d9af 100644
--- a/libcli/netlogon.c
+++ b/libcli/netlogon.c
@@ -82,6 +82,10 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx,
 						   &response->nt4,
 						   (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_NT40);
 		response->ntver = NETLOGON_NT_VERSION_1;
+		if (NDR_ERR_CODE_IS_SUCCESS(ndr_err) && DEBUGLEVEL >= 10) {
+			NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_NT40, &response->nt4);
+		}
+
 	} else if (ntver & NETLOGON_NT_VERSION_5EX) {
 		struct ndr_pull *ndr;
 		ndr = ndr_pull_init_blob(data, mem_ctx, iconv_convenience);
@@ -95,6 +99,9 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx,
 						 ndr->offset, ndr->data_size);
 		}
 		response->ntver = NETLOGON_NT_VERSION_5EX;
+		if (NDR_ERR_CODE_IS_SUCCESS(ndr_err) && DEBUGLEVEL >= 10) {
+			NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_EX, &response->nt5_ex);
+		}
 
 	} else if (ntver & NETLOGON_NT_VERSION_5) {
 		ndr_err = ndr_pull_struct_blob_all(data, mem_ctx,
@@ -102,6 +109,9 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx,
 						   &response->nt5,
 						   (ndr_pull_flags_fn_t)ndr_pull_NETLOGON_SAM_LOGON_RESPONSE);
 		response->ntver = NETLOGON_NT_VERSION_5;
+		if (NDR_ERR_CODE_IS_SUCCESS(ndr_err) && DEBUGLEVEL >= 10) {
+			NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE, &response->nt5);
+		}
 	} else {
 		DEBUG(2,("failed to parse netlogon response of type 0x%02x - unknown response type\n",
 			 ntver));
@@ -115,6 +125,7 @@ NTSTATUS pull_netlogon_samlogon_response(DATA_BLOB *data, TALLOC_CTX *mem_ctx,
 		dump_data(10, data->data, data->length);
 		return ndr_map_error2ntstatus(ndr_err);
 	}
+
 	return NT_STATUS_OK;
 }
 
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 97095fc..333c5f3 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -377,6 +377,8 @@ LIBADS_SERVER_OBJ = libads/kerberos_verify.o libads/authdata.o \
 SECRETS_OBJ = passdb/secrets.o passdb/machine_sid.o
 
 LIBNBT_OBJ = ../libcli/nbt/nbtname.o \
+	     ../libcli/netlogon.o \
+	     ../libcli/ndr_netlogon.o \
 	     librpc/gen_ndr/ndr_nbt.o \
 	     librpc/gen_ndr/ndr_svcctl.o
 
diff --git a/source3/include/includes.h b/source3/include/includes.h
index ccdc6d3..fbf5ca6 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -703,6 +703,7 @@ typedef char fstring[FSTRING_LEN];
 #include "librpc/gen_ndr/notify.h"
 #include "librpc/gen_ndr/xattr.h"
 #include "librpc/gen_ndr/messaging.h"
+#include "librpc/gen_ndr/ndr_nbt.h"
 #include "librpc/rpc/dcerpc.h"
 #include "nt_printing.h"
 #include "idmap.h"
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 6eac9d1..4a51835 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1927,20 +1927,15 @@ NTSTATUS kerberos_return_info3_from_pac(TALLOC_CTX *mem_ctx,
 					struct netr_SamInfo3 **info3);
 
 /* The following definitions come from libads/cldap.c  */
-
 bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx,
 			const char *server,
 			const char *realm,
-			uint32_t *nt_version,
-			union nbt_cldap_netlogon **reply);
+			uint32_t nt_version,
+			struct netlogon_samlogon_response **reply);
 bool ads_cldap_netlogon_5(TALLOC_CTX *mem_ctx,
 			  const char *server,
 			  const char *realm,
-			  struct nbt_cldap_netlogon_5 *reply5);
-bool pull_mailslot_cldap_reply(TALLOC_CTX *mem_ctx,
-			       const DATA_BLOB *blob,
-			       union nbt_cldap_netlogon *r,
-			       uint32_t *nt_version);
+			  struct NETLOGON_SAM_LOGON_RESPONSE_EX *reply5);
 
 /* The following definitions come from libads/disp_sec.c  */
 
@@ -2854,93 +2849,6 @@ _PUBLIC_ enum ndr_err_code ndr_push_samr_RejectReason(struct ndr_push *ndr, int
 _PUBLIC_ enum ndr_err_code ndr_pull_samr_RejectReason(struct ndr_pull *ndr, int ndr_flags, enum samr_RejectReason *r);
 _PUBLIC_ void ndr_print_samr_RejectReason(struct ndr_print *ndr, const char *name, enum samr_RejectReason r);
 
-/* The following definitions come from librpc/gen_ndr/ndr_nbt.c  */
-
-_PUBLIC_ void ndr_print_nbt_operation(struct ndr_print *ndr, const char *name, uint16_t r);
-_PUBLIC_ void ndr_print_nbt_name_type(struct ndr_print *ndr, const char *name, enum nbt_name_type r);
-_PUBLIC_ void ndr_print_nbt_name(struct ndr_print *ndr, const char *name, const struct nbt_name *r);
-_PUBLIC_ void ndr_print_nbt_qclass(struct ndr_print *ndr, const char *name, enum nbt_qclass r);
-_PUBLIC_ void ndr_print_nbt_qtype(struct ndr_print *ndr, const char *name, enum nbt_qtype r);
-_PUBLIC_ void ndr_print_nbt_name_question(struct ndr_print *ndr, const char *name, const struct nbt_name_question *r);
-_PUBLIC_ void ndr_print_nb_flags(struct ndr_print *ndr, const char *name, uint16_t r);
-_PUBLIC_ void ndr_print_nbt_rdata_address(struct ndr_print *ndr, const char *name, const struct nbt_rdata_address *r);
-_PUBLIC_ void ndr_print_nbt_rdata_netbios(struct ndr_print *ndr, const char *name, const struct nbt_rdata_netbios *r);
-_PUBLIC_ void ndr_print_nbt_statistics(struct ndr_print *ndr, const char *name, const struct nbt_statistics *r);
-_PUBLIC_ void ndr_print_nbt_status_name(struct ndr_print *ndr, const char *name, const struct nbt_status_name *r);
-_PUBLIC_ void ndr_print_nbt_rdata_status(struct ndr_print *ndr, const char *name, const struct nbt_rdata_status *r);
-_PUBLIC_ void ndr_print_nbt_rdata_data(struct ndr_print *ndr, const char *name, const struct nbt_rdata_data *r);
-_PUBLIC_ void ndr_print_nbt_rdata(struct ndr_print *ndr, const char *name, const union nbt_rdata *r);
-_PUBLIC_ void ndr_print_nbt_res_rec(struct ndr_print *ndr, const char *name, const struct nbt_res_rec *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_name_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_name_packet *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_name_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_name_packet *r);
-_PUBLIC_ void ndr_print_nbt_name_packet(struct ndr_print *ndr, const char *name, const struct nbt_name_packet *r);
-_PUBLIC_ void ndr_print_dgram_msg_type(struct ndr_print *ndr, const char *name, enum dgram_msg_type r);
-_PUBLIC_ void ndr_print_dgram_flags(struct ndr_print *ndr, const char *name, uint8_t r);
-_PUBLIC_ void ndr_print_smb_command(struct ndr_print *ndr, const char *name, enum smb_command r);
-_PUBLIC_ void ndr_print_smb_trans_body(struct ndr_print *ndr, const char *name, const struct smb_trans_body *r);
-_PUBLIC_ void ndr_print_smb_body(struct ndr_print *ndr, const char *name, const union smb_body *r);
-_PUBLIC_ enum ndr_err_code ndr_push_dgram_smb_packet(struct ndr_push *ndr, int ndr_flags, const struct dgram_smb_packet *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_dgram_smb_packet(struct ndr_pull *ndr, int ndr_flags, struct dgram_smb_packet *r);
-_PUBLIC_ void ndr_print_dgram_smb_packet(struct ndr_print *ndr, const char *name, const struct dgram_smb_packet *r);
-_PUBLIC_ void ndr_print_dgram_message_body(struct ndr_print *ndr, const char *name, const union dgram_message_body *r);
-_PUBLIC_ void ndr_print_dgram_message(struct ndr_print *ndr, const char *name, const struct dgram_message *r);
-_PUBLIC_ void ndr_print_dgram_err_code(struct ndr_print *ndr, const char *name, enum dgram_err_code r);
-_PUBLIC_ void ndr_print_dgram_data(struct ndr_print *ndr, const char *name, const union dgram_data *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_dgram_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_dgram_packet *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_dgram_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_dgram_packet *r);
-_PUBLIC_ void ndr_print_nbt_dgram_packet(struct ndr_print *ndr, const char *name, const struct nbt_dgram_packet *r);
-_PUBLIC_ void ndr_print_nbt_netlogon_command(struct ndr_print *ndr, const char *name, enum nbt_netlogon_command r);
-_PUBLIC_ void ndr_print_nbt_netlogon_version(struct ndr_print *ndr, const char *name, uint32_t r);
-_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc *r);
-_PUBLIC_ void ndr_print_nbt_netlogon_query_for_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_query_for_pdc2 *r);
-_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc *r);
-_PUBLIC_ void ndr_print_nbt_server_type(struct ndr_print *ndr, const char *name, uint32_t r);
-_PUBLIC_ void ndr_print_nbt_dc_sock_addr(struct ndr_print *ndr, const char *name, const struct nbt_dc_sock_addr *r);
-_PUBLIC_ void ndr_print_nbt_netlogon_response_from_pdc2(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_response_from_pdc2 *r);
-_PUBLIC_ void ndr_print_nbt_db_change(struct ndr_print *ndr, const char *name, const struct nbt_db_change *r);
-_PUBLIC_ void ndr_print_nbt_netlogon_announce_uas(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_announce_uas *r);
-_PUBLIC_ void ndr_print_nbt_netlogon_request(struct ndr_print *ndr, const char *name, const union nbt_netlogon_request *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_netlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_netlogon_packet *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_netlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_netlogon_packet *r);
-_PUBLIC_ void ndr_print_nbt_netlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_netlogon_packet *r);
-_PUBLIC_ void ndr_print_nbt_cldap_netlogon_1(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_1 *r);
-_PUBLIC_ void ndr_print_nbt_cldap_netlogon_3(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_3 *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_5(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_5 *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_5(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_5 *r);
-_PUBLIC_ void ndr_print_nbt_cldap_netlogon_5(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_5 *r);
-_PUBLIC_ void ndr_print_nbt_cldap_netlogon_13(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_13 *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_15(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_15 *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_15(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_15 *r);
-_PUBLIC_ void ndr_print_nbt_cldap_netlogon_15(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_15 *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon_29(struct ndr_push *ndr, int ndr_flags, const struct nbt_cldap_netlogon_29 *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon_29(struct ndr_pull *ndr, int ndr_flags, struct nbt_cldap_netlogon_29 *r);
-_PUBLIC_ void ndr_print_nbt_cldap_netlogon_29(struct ndr_print *ndr, const char *name, const struct nbt_cldap_netlogon_29 *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_cldap_netlogon(struct ndr_push *ndr, int ndr_flags, const union nbt_cldap_netlogon *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_cldap_netlogon(struct ndr_pull *ndr, int ndr_flags, union nbt_cldap_netlogon *r);
-_PUBLIC_ void ndr_print_nbt_cldap_netlogon(struct ndr_print *ndr, const char *name, const union nbt_cldap_netlogon *r);
-_PUBLIC_ void ndr_print_nbt_ntlogon_command(struct ndr_print *ndr, const char *name, enum nbt_ntlogon_command r);
-_PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon *r);
-_PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon_reply(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_sam_logon_reply *r);
-_PUBLIC_ void ndr_print_nbt_ntlogon_request(struct ndr_print *ndr, const char *name, const union nbt_ntlogon_request *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_ntlogon_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_ntlogon_packet *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_ntlogon_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_ntlogon_packet *r);
-_PUBLIC_ void ndr_print_nbt_ntlogon_packet(struct ndr_print *ndr, const char *name, const struct nbt_ntlogon_packet *r);
-_PUBLIC_ void ndr_print_nbt_browse_opcode(struct ndr_print *ndr, const char *name, enum nbt_browse_opcode r);
-_PUBLIC_ void ndr_print_nbt_browse_host_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_host_announcement *r);
-_PUBLIC_ void ndr_print_nbt_browse_announcement_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_announcement_request *r);
-_PUBLIC_ void ndr_print_nbt_browse_election_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_election_request *r);
-_PUBLIC_ void ndr_print_nbt_browse_backup_list_request(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_request *r);
-_PUBLIC_ void ndr_print_nbt_browse_backup_list_response(struct ndr_print *ndr, const char *name, const struct nbt_browse_backup_list_response *r);
-_PUBLIC_ void ndr_print_nbt_browse_become_backup(struct ndr_print *ndr, const char *name, const struct nbt_browse_become_backup *r);
-_PUBLIC_ void ndr_print_nbt_browse_domain_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_domain_announcement *r);
-_PUBLIC_ void ndr_print_nbt_browse_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_master_announcement *r);
-_PUBLIC_ void ndr_print_nbt_browse_reset_state(struct ndr_print *ndr, const char *name, const struct nbt_browse_reset_state *r);
-_PUBLIC_ void ndr_print_nbt_browse_local_master_announcement(struct ndr_print *ndr, const char *name, const struct nbt_browse_local_master_announcement *r);
-_PUBLIC_ void ndr_print_nbt_browse_payload(struct ndr_print *ndr, const char *name, const union nbt_browse_payload *r);
-_PUBLIC_ enum ndr_err_code ndr_push_nbt_browse_packet(struct ndr_push *ndr, int ndr_flags, const struct nbt_browse_packet *r);
-_PUBLIC_ enum ndr_err_code ndr_pull_nbt_browse_packet(struct ndr_pull *ndr, int ndr_flags, struct nbt_browse_packet *r);
-_PUBLIC_ void ndr_print_nbt_browse_packet(struct ndr_print *ndr, const char *name, const struct nbt_browse_packet *r);
-
 /* The following definitions come from librpc/gen_ndr/ndr_netlogon.c  */
 
 _PUBLIC_ void ndr_print_netr_UasInfo(struct ndr_print *ndr, const char *name, const struct netr_UasInfo *r);
@@ -4295,7 +4203,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx,
 			    const char *domain_name,
 			    uint32_t *nt_version,
 			    const char **dc_name,
-			    union nbt_cldap_netlogon **reply);
+			    struct netlogon_samlogon_response **reply);
 
 /* The following definitions come from libsmb/clientgen.c  */
 
diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c
index b89d285..edabbed 100644
--- a/source3/libads/cldap.c
+++ b/source3/libads/cldap.c
@@ -119,8 +119,8 @@ static void gotalarm_sig(void)
 */
 static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx,
 			       int sock,
-			       uint32_t *nt_version,
-			       union nbt_cldap_netlogon **reply)
+			       uint32_t nt_version,
+			       struct netlogon_samlogon_response **reply)
 {
 	int ret;
 	ASN1_DATA data;
@@ -131,7 +131,8 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx,
 	int i1;
 	/* half the time of a regular ldap timeout, not less than 3 seconds. */
 	unsigned int al_secs = MAX(3,lp_ldap_timeout()/2);
-	union nbt_cldap_netlogon *r = NULL;
+	struct netlogon_samlogon_response *r = NULL;
+	NTSTATUS status;
 
 	blob = data_blob(NULL, 8192);
 	if (blob.data == NULL) {
@@ -185,7 +186,7 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx,
 		return -1;
 	}
 
-	r = TALLOC_ZERO_P(mem_ctx, union nbt_cldap_netlogon);
+	r = TALLOC_ZERO_P(mem_ctx, struct netlogon_samlogon_response);
 	if (!r) {
 		errno = ENOMEM;
 		data_blob_free(&os1);
@@ -195,7 +196,8 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx,
 		return -1;
 	}
 
-	if (!pull_mailslot_cldap_reply(mem_ctx, &os3, r, nt_version)) {
+	status = pull_netlogon_samlogon_response(&os3, mem_ctx, NULL, r);
+	if (!NT_STATUS_IS_OK(status)) {
 		data_blob_free(&os1);
 		data_blob_free(&os2);
 		data_blob_free(&os3);
@@ -204,6 +206,8 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx,
 		return -1;
 	}
 
+	map_netlogon_samlogon_response(r);
+
 	data_blob_free(&os1);
 	data_blob_free(&os2);
 	data_blob_free(&os3);
@@ -227,8 +231,8 @@ static int recv_cldap_netlogon(TALLOC_CTX *mem_ctx,
 bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx,
 			const char *server,
 			const char *realm,
-			uint32_t *nt_version,
-			union nbt_cldap_netlogon **reply)
+			uint32_t nt_version,
+			struct netlogon_samlogon_response **reply)
 {
 	int sock;
 	int ret;
@@ -240,7 +244,7 @@ bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx,
 		return False;
 	}
 
-	ret = send_cldap_netlogon(sock, realm, global_myname(), *nt_version);
+	ret = send_cldap_netlogon(sock, realm, global_myname(), nt_version);
 	if (ret != 0) {
 		close(sock);
 		return False;
@@ -262,107 +266,24 @@ bool ads_cldap_netlogon(TALLOC_CTX *mem_ctx,
 bool ads_cldap_netlogon_5(TALLOC_CTX *mem_ctx,
 			  const char *server,
 			  const char *realm,
-			  struct nbt_cldap_netlogon_5 *reply5)
+			  struct NETLOGON_SAM_LOGON_RESPONSE_EX *reply5)
 {
 	uint32_t nt_version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX;
-	union nbt_cldap_netlogon *reply = NULL;
+	struct netlogon_samlogon_response *reply = NULL;
 	bool ret;
 
-	ret = ads_cldap_netlogon(mem_ctx, server, realm, &nt_version, &reply);
+	ret = ads_cldap_netlogon(mem_ctx, server, realm, nt_version, &reply);
 	if (!ret) {
 		return false;
 	}
 
-	if (nt_version != (NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX)) {
+	if (reply->ntver != NETLOGON_NT_VERSION_5EX) {
+		DEBUG(0,("ads_cldap_netlogon_5: nt_version mismatch: 0x%08x\n",
+			reply->ntver));
 		return false;
 	}
 
-	*reply5 = reply->logon5;
-
-	return true;
-}
-
-/****************************************************************
-****************************************************************/
-
-bool pull_mailslot_cldap_reply(TALLOC_CTX *mem_ctx,
-			       const DATA_BLOB *blob,
-			       union nbt_cldap_netlogon *r,
-			       uint32_t *nt_version)
-{
-	enum ndr_err_code ndr_err;
-	uint32_t nt_version_query = ((*nt_version) & 0x0000001f);
-	uint16_t command = 0;
-
-	ndr_err = ndr_pull_struct_blob(blob, mem_ctx, NULL, &command,
-			(ndr_pull_flags_fn_t)ndr_pull_uint16);
-	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-		return false;
-	}
-
-	switch (command) {
-		case 0x13: /* 19 */
-		case 0x15: /* 21 */
-		case 0x17: /* 23 */
-		case 0x19: /* 25 */
-			 break;
-		default:
-			DEBUG(1,("got unexpected command: %d (0x%08x)\n",
-				command, command));
-			return false;
-	}
-
-	ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-		       (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-	if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-		goto done;
-	}
-
-	/* when the caller requested just those nt_version bits that the server
-	 * was able to reply to, we are fine and all done. otherwise we need to
-	 * assume downgraded replies which are painfully parsed here - gd */
-
-	if (nt_version_query & NETLOGON_NT_VERSION_WITH_CLOSEST_SITE) {
-		nt_version_query &= ~NETLOGON_NT_VERSION_WITH_CLOSEST_SITE;
-	}
-	ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-		       (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-	if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-		goto done;
-	}
-	if (nt_version_query & NETLOGON_NT_VERSION_5EX_WITH_IP) {
-		nt_version_query &= ~NETLOGON_NT_VERSION_5EX_WITH_IP;
-	}
-	ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-		       (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-	if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-		goto done;
-	}
-	if (nt_version_query & NETLOGON_NT_VERSION_5EX) {
-		nt_version_query &= ~NETLOGON_NT_VERSION_5EX;
-	}
-	ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-		       (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-	if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-		goto done;
-	}
-	if (nt_version_query & NETLOGON_NT_VERSION_5) {
-		nt_version_query &= ~NETLOGON_NT_VERSION_5;
-	}
-	ndr_err = ndr_pull_union_blob_all(blob, mem_ctx, r, nt_version_query,
-		       (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon);
-	if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-		goto done;
-	}
-
-	return false;
-
- done:
-	if (DEBUGLEVEL >= 10) {
-		NDR_PRINT_UNION_DEBUG(nbt_cldap_netlogon, nt_version_query, r);
-	}
-
-	*nt_version = nt_version_query;
+	*reply5 = reply->nt5_ex;
 
 	return true;
 }
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index eb45e3a..bfcfcf3 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -176,7 +176,7 @@ bool ads_closest_dc(ADS_STRUCT *ads)
 static bool ads_try_connect(ADS_STRUCT *ads, const char *server, bool gc)
 {
 	char *srv;
-	struct nbt_cldap_netlogon_5 cldap_reply;
+	struct NETLOGON_SAM_LOGON_RESPONSE_EX cldap_reply;
 	TALLOC_CTX *mem_ctx = NULL;
 	bool ret = false;
 
diff --git a/source3/librpc/gen_ndr/nbt.h b/source3/librpc/gen_ndr/nbt.h
index 847f63b..264b00b 100644
--- a/source3/librpc/gen_ndr/nbt.h
+++ b/source3/librpc/gen_ndr/nbt.h
@@ -228,8 +228,8 @@ struct nbt_res_rec {
 	enum nbt_qtype rr_type;
 	enum nbt_qclass rr_class;
 	uint32_t ttl;
-	union nbt_rdata rdata;/* [switch_is(((((rr_type)==NBT_QTYPE_NETBIOS)&&talloc_check_name(ndr,"struct ndr_push")&&((rdata).data.length==2))?0:rr_type))] */
-}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;
+	union nbt_rdata rdata;/* [switch_is(rr_type)] */
+}/* [nopush,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
 
 struct nbt_name_packet {
 	uint16_t name_trn_id;
@@ -390,28 +390,27 @@ struct nbt_dgram_packet {
 	union dgram_data data;/* [switch_is(msg_type)] */
 }/* [public,flag(LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX)] */;
 
-enum nbt_netlogon_command
-#ifndef USE_UINT_ENUMS
- {
-	NETLOGON_QUERY_FOR_PDC=0x7,
-	NETLOGON_ANNOUNCE_UAS=0xa,
-	NETLOGON_RESPONSE_FROM_PDC=0xc,
-	NETLOGON_QUERY_FOR_PDC2=0x12,
-	NETLOGON_RESPONSE_FROM_PDC2=0x17,
-	NETLOGON_RESPONSE_FROM_PDC_USER=0x19
-}
-#else
- { __donnot_use_enum_nbt_netlogon_command=0x7FFFFFFF}
-#define NETLOGON_QUERY_FOR_PDC ( 0x7 )
-#define NETLOGON_ANNOUNCE_UAS ( 0xa )
-#define NETLOGON_RESPONSE_FROM_PDC ( 0xc )
-#define NETLOGON_QUERY_FOR_PDC2 ( 0x12 )
-#define NETLOGON_RESPONSE_FROM_PDC2 ( 0x17 )
-#define NETLOGON_RESPONSE_FROM_PDC_USER ( 0x19 )
-#endif
-;
+struct nbt_sockaddr {
+	uint32_t sa_family;
+	const char * pdc_ip;/* [flag(LIBNDR_FLAG_BIGENDIAN)] */
+	DATA_BLOB remaining;/* [flag(LIBNDR_FLAG_REMAINING)] */
+}/* [gensize,public] */;
 
-/* bitmap nbt_netlogon_version */
+/* bitmap nbt_server_type */
+#define NBT_SERVER_PDC ( 0x00000001 )
+#define NBT_SERVER_GC ( 0x00000004 )
+#define NBT_SERVER_LDAP ( 0x00000008 )
+#define NBT_SERVER_DS ( 0x00000010 )
+#define NBT_SERVER_KDC ( 0x00000020 )
+#define NBT_SERVER_TIMESERV ( 0x00000040 )
+#define NBT_SERVER_CLOSEST ( 0x00000080 )
+#define NBT_SERVER_WRITABLE ( 0x00000100 )
+#define NBT_SERVER_GOOD_TIMESERV ( 0x00000200 )
+#define NBT_SERVER_NDNC ( 0x00000400 )
+#define NBT_SERVER_SELECT_SECRET_DOMAIN_6 ( 0x00000800 )
+#define NBT_SERVER_FULL_SECRET_DOMAIN_6 ( 0x00001000 )
+
+/* bitmap netlogon_nt_version_flags */
 #define NETLOGON_NT_VERSION_1 ( 0x00000001 )
 #define NETLOGON_NT_VERSION_5 ( 0x00000002 )
 #define NETLOGON_NT_VERSION_5EX ( 0x00000004 )
@@ -423,59 +422,79 @@ enum nbt_netlogon_command
 #define NETLOGON_NT_VERSION_LOCAL ( 0x40000000 )
 #define NETLOGON_NT_VERSION_GC ( 0x80000000 )
 
-struct nbt_netlogon_query_for_pdc {
-	const char * computer_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */
+enum netlogon_command
+#ifndef USE_UINT_ENUMS
+ {
+	LOGON_PRIMARY_QUERY=7,
+	NETLOGON_ANNOUNCE_UAS=10,
+	NETLOGON_RESPONSE_FROM_PDC=12,
+	LOGON_SAM_LOGON_REQUEST=18,
+	LOGON_SAM_LOGON_RESPONSE=19,
+	LOGON_SAM_LOGON_PAUSE_RESPONSE=20,
+	LOGON_SAM_LOGON_USER_UNKNOWN=21,
+	LOGON_SAM_LOGON_RESPONSE_EX=23,
+	LOGON_SAM_LOGON_PAUSE_RESPONSE_EX=24,
+	LOGON_SAM_LOGON_USER_UNKNOWN_EX=25
+}
+#else
+ { __donnot_use_enum_netlogon_command=0x7FFFFFFF}
+#define LOGON_PRIMARY_QUERY ( 7 )
+#define NETLOGON_ANNOUNCE_UAS ( 10 )
+#define NETLOGON_RESPONSE_FROM_PDC ( 12 )
+#define LOGON_SAM_LOGON_REQUEST ( 18 )
+#define LOGON_SAM_LOGON_RESPONSE ( 19 )
+#define LOGON_SAM_LOGON_PAUSE_RESPONSE ( 20 )
+#define LOGON_SAM_LOGON_USER_UNKNOWN ( 21 )
+#define LOGON_SAM_LOGON_RESPONSE_EX ( 23 )
+#define LOGON_SAM_LOGON_PAUSE_RESPONSE_EX ( 24 )
+#define LOGON_SAM_LOGON_USER_UNKNOWN_EX ( 25 )
+#endif
+;
+
+struct NETLOGON_SAM_LOGON_REQUEST {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list