[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-448-g900a8d4

Stefan Metzmacher metze at samba.org
Fri Sep 18 12:46:48 MDT 2009


The branch, master has been updated
       via  900a8d435d1b15b3b0453441624727d532b74f55 (commit)
       via  cda0849ebc6c3bc2cc6c7666e4e4e16093b2683b (commit)
       via  f0704f5abcec0317afd0dae29c096498206b1136 (commit)
       via  d0e73ab534831a6c57f21a472ef90afffa575e3a (commit)
       via  825484ee6ddb803259477c3e2a44671c55d955b2 (commit)
       via  bb0644175a1342711b411d1e60a8fdc274e8c227 (commit)
       via  199072b95aa716cf6362ff28aa5a35ae649af711 (commit)
       via  c29364f4b0e20b22f9c3b6fb79a28fc2d063a874 (commit)
       via  3207188287ccb712c49e9678d04e0e41eecfc8f0 (commit)
       via  16f1ba2558b103c0edb394b11caaafa9893022aa (commit)
      from  77afcad8f09b50977f4b88b68d66ebd61b7ffa82 (commit)

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


- Log -----------------------------------------------------------------
commit 900a8d435d1b15b3b0453441624727d532b74f55
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Sep 18 11:32:46 2009 +0200

    s4:rpc_server: remove some now unused code
    
    metze

commit cda0849ebc6c3bc2cc6c7666e4e4e16093b2683b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 11 14:50:36 2009 +0200

    s4:ntvfs_ipc: add real named pipe support
    
    We now open a named via the named_pipe_auth
    code and process IO via the tstream interface.
    
    This means we support byte mode and message mode
    named pipes.
    
    We also correctly issue NT_STATUS_PIPE_BUSY
    when a smb_trans request comes in and a read or smb_trans
    is already pending.
    
    We also have support for async dcerpc over ncacn_np now,
    and we now can remove the ncacn_np specific hacks from the
    rpc_server/ code.
    
    metze

commit f0704f5abcec0317afd0dae29c096498206b1136
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri May 1 18:19:34 2009 +0200

    s4:torture: the spoolss notify test should listen on the ncacn_np endpoint
    
    metze

commit d0e73ab534831a6c57f21a472ef90afffa575e3a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri May 1 18:17:10 2009 +0200

    s4:rpc_server: export dcesrv_add_ep() so that torture tests can use it
    
    metze

commit 825484ee6ddb803259477c3e2a44671c55d955b2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 17 18:43:41 2009 +0200

    libcli/named_pipe_auth: pass gssapi delegated credentials through the named pipe
    
    metze

commit bb0644175a1342711b411d1e60a8fdc274e8c227
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 17 18:41:00 2009 +0200

    s4:service_named_pipe: accept delegated credentials
    
    metze

commit 199072b95aa716cf6362ff28aa5a35ae649af711
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 17 18:33:21 2009 +0200

    librpc: rerun 'make idl'
    
    metze

commit c29364f4b0e20b22f9c3b6fb79a28fc2d063a874
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 17 18:26:57 2009 +0200

    named_pipe_auth.idl: add infrastructure to pass delegated credentials
    
    metze

commit 3207188287ccb712c49e9678d04e0e41eecfc8f0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri May 1 18:20:53 2009 +0200

    s4:torture: don't use 'pipe' as variable name it's a system call
    
    metze

commit 16f1ba2558b103c0edb394b11caaafa9893022aa
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Sep 18 02:44:49 2009 +0200

    s4:heimdal/gssapi/krb5: set cred_handle in _gsskrb5_import_cred
    
    metze

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

Summary of changes:
 libcli/named_pipe_auth/npa_tstream.c    |   51 +-
 libcli/named_pipe_auth/npa_tstream.h    |    3 +-
 librpc/gen_ndr/named_pipe_auth.h        |   22 +
 librpc/gen_ndr/ndr_named_pipe_auth.c    |  329 ++++++++++++
 librpc/gen_ndr/ndr_named_pipe_auth.h    |    2 +
 librpc/idl/named_pipe_auth.idl          |   23 +
 source4/heimdal/lib/gssapi/krb5/creds.c |    1 +
 source4/ntvfs/config.mk                 |    4 +-
 source4/ntvfs/ipc/vfs_ipc.c             |  884 +++++++++++++++++++++++--------
 source4/rpc_server/config.mk            |    3 +
 source4/rpc_server/dcerpc_server.c      |  184 -------
 source4/rpc_server/dcerpc_server.h      |   15 -
 source4/rpc_server/service_rpc.c        |   11 +-
 source4/smbd/config.mk                  |    4 +-
 source4/smbd/service_named_pipe.c       |  100 ++++-
 source4/torture/rpc/spoolss_notify.c    |   26 +-
 16 files changed, 1194 insertions(+), 468 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/named_pipe_auth/npa_tstream.c b/libcli/named_pipe_auth/npa_tstream.c
index fdb55c7..1c9ab8f 100644
--- a/libcli/named_pipe_auth/npa_tstream.c
+++ b/libcli/named_pipe_auth/npa_tstream.c
@@ -66,8 +66,9 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx,
 					const char *client_name_in,
 					const struct tsocket_address *server,
 					const char *server_name,
-					const struct netr_SamInfo3 *info3,
-					DATA_BLOB session_key)
+					const struct netr_SamInfo3 *sam_info3,
+					DATA_BLOB session_key,
+					DATA_BLOB delegated_creds)
 {
 	struct tevent_req *req;
 	struct tstream_npa_connect_state *state;
@@ -109,45 +110,48 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx,
 
 	ZERO_STRUCT(state->auth_req);
 	if (client) {
-		struct named_pipe_auth_req_info2 *info2;
+		struct named_pipe_auth_req_info3 *info3;
 
 		if (!server) {
 			tevent_req_error(req, EINVAL);
 			goto post;
 		}
 
-		state->auth_req.level = 2;
-		info2 = &state->auth_req.info.info2;
+		state->auth_req.level = 3;
+		info3 = &state->auth_req.info.info3;
 
-		info2->client_name = client_name_in;
-		info2->client_addr = tsocket_address_inet_addr_string(client, state);
-		if (!info2->client_addr) {
+		info3->client_name = client_name_in;
+		info3->client_addr = tsocket_address_inet_addr_string(client, state);
+		if (!info3->client_addr) {
 			/* errno might be EINVAL */
 			tevent_req_error(req, errno);
 			goto post;
 		}
-		info2->client_port = tsocket_address_inet_port(client);
-		if (!info2->client_name) {
-			info2->client_name = info2->client_addr;
+		info3->client_port = tsocket_address_inet_port(client);
+		if (!info3->client_name) {
+			info3->client_name = info3->client_addr;
 		}
 
-		info2->server_addr = tsocket_address_inet_addr_string(server, state);
-		if (!info2->server_addr) {
+		info3->server_addr = tsocket_address_inet_addr_string(server, state);
+		if (!info3->server_addr) {
 			/* errno might be EINVAL */
 			tevent_req_error(req, errno);
 			goto post;
 		}
-		info2->server_port = tsocket_address_inet_port(server);
-		if (!info2->server_name) {
-			info2->server_name = info2->server_addr;
+		info3->server_port = tsocket_address_inet_port(server);
+		if (!info3->server_name) {
+			info3->server_name = info3->server_addr;
 		}
 
-		info2->sam_info3 = discard_const_p(struct netr_SamInfo3, info3);
-		info2->session_key_length = session_key.length;
-		info2->session_key = session_key.data;
-	} else if (info3) {
+		info3->sam_info3 = discard_const_p(struct netr_SamInfo3, sam_info3);
+		info3->session_key_length = session_key.length;
+		info3->session_key = session_key.data;
+		info3->gssapi_delegated_creds_length = delegated_creds.length;
+		info3->gssapi_delegated_creds = delegated_creds.data;
+
+	} else if (sam_info3) {
 		state->auth_req.level = 1;
-		state->auth_req.info.info1 = *info3;
+		state->auth_req.info.info1 = *sam_info3;
 	} else {
 		state->auth_req.level = 0;
 	}
@@ -429,6 +433,11 @@ int _tstream_npa_connect_recv(struct tevent_req *req,
 		device_state = state->auth_rep.info.info2.device_state;
 		allocation_size = state->auth_rep.info.info2.allocation_size;
 		break;
+	case 3:
+		npas->file_type = state->auth_rep.info.info3.file_type;
+		device_state = state->auth_rep.info.info3.device_state;
+		allocation_size = state->auth_rep.info.info3.allocation_size;
+		break;
 	}
 
 	*_stream = stream;
diff --git a/libcli/named_pipe_auth/npa_tstream.h b/libcli/named_pipe_auth/npa_tstream.h
index 34f2058..bff010f 100644
--- a/libcli/named_pipe_auth/npa_tstream.h
+++ b/libcli/named_pipe_auth/npa_tstream.h
@@ -34,7 +34,8 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx,
 					const struct tsocket_address *server,
 					const char *server_name,
 					const struct netr_SamInfo3 *info3,
-					DATA_BLOB session_key);
+					DATA_BLOB session_key,
+					DATA_BLOB delegated_creds);
 int _tstream_npa_connect_recv(struct tevent_req *req,
 			      int *perrno,
 			      TALLOC_CTX *mem_ctx,
diff --git a/librpc/gen_ndr/named_pipe_auth.h b/librpc/gen_ndr/named_pipe_auth.h
index e08aa47..d292dfe 100644
--- a/librpc/gen_ndr/named_pipe_auth.h
+++ b/librpc/gen_ndr/named_pipe_auth.h
@@ -21,9 +21,24 @@ struct named_pipe_auth_req_info2 {
 	uint8_t *session_key;/* [unique,size_is(session_key_length)] */
 };
 
+struct named_pipe_auth_req_info3 {
+	const char *client_name;/* [unique,charset(UTF8)] */
+	const char *client_addr;/* [unique,charset(DOS)] */
+	uint16_t client_port;
+	const char *server_name;/* [unique,charset(UTF8)] */
+	const char *server_addr;/* [unique,charset(DOS)] */
+	uint16_t server_port;
+	struct netr_SamInfo3 *sam_info3;/* [unique] */
+	uint32_t session_key_length;
+	uint8_t *session_key;/* [unique,size_is(session_key_length)] */
+	uint32_t gssapi_delegated_creds_length;
+	uint8_t *gssapi_delegated_creds;/* [unique,size_is(gssapi_delegated_creds_length)] */
+};
+
 union named_pipe_auth_req_info {
 	struct netr_SamInfo3 info1;/* [case] */
 	struct named_pipe_auth_req_info2 info2;/* [case(2)] */
+	struct named_pipe_auth_req_info3 info3;/* [case(3)] */
 }/* [switch_type(uint32)] */;
 
 struct named_pipe_auth_req {
@@ -39,8 +54,15 @@ struct named_pipe_auth_rep_info2 {
 	uint64_t allocation_size;
 };
 
+struct named_pipe_auth_rep_info3 {
+	uint16_t file_type;
+	uint16_t device_state;
+	uint64_t allocation_size;
+};
+
 union named_pipe_auth_rep_info {
 	struct named_pipe_auth_rep_info2 info2;/* [case(2)] */
+	struct named_pipe_auth_rep_info3 info3;/* [case(3)] */
 }/* [switch_type(uint32)] */;
 
 struct named_pipe_auth_rep {
diff --git a/librpc/gen_ndr/ndr_named_pipe_auth.c b/librpc/gen_ndr/ndr_named_pipe_auth.c
index 28bd85d..cdd8a3d 100644
--- a/librpc/gen_ndr/ndr_named_pipe_auth.c
+++ b/librpc/gen_ndr/ndr_named_pipe_auth.c
@@ -226,6 +226,261 @@ _PUBLIC_ void ndr_print_named_pipe_auth_req_info2(struct ndr_print *ndr, const c
 	ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_named_pipe_auth_req_info3(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req_info3 *r)
+{
+	if (ndr_flags & NDR_SCALARS) {
+		NDR_CHECK(ndr_push_align(ndr, 5));
+		NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_name));
+		NDR_CHECK(ndr_push_unique_ptr(ndr, r->client_addr));
+		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->client_port));
+		NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name));
+		NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_addr));
+		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->server_port));
+		NDR_CHECK(ndr_push_unique_ptr(ndr, r->sam_info3));
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_key_length));
+		NDR_CHECK(ndr_push_unique_ptr(ndr, r->session_key));
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->gssapi_delegated_creds_length));
+		NDR_CHECK(ndr_push_unique_ptr(ndr, r->gssapi_delegated_creds));
+	}
+	if (ndr_flags & NDR_BUFFERS) {
+		if (r->client_name) {
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_name, CH_UTF8)));
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_name, CH_UTF8)));
+			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_name, ndr_charset_length(r->client_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+		}
+		if (r->client_addr) {
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_addr, CH_DOS)));
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->client_addr, CH_DOS)));
+			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->client_addr, ndr_charset_length(r->client_addr, CH_DOS), sizeof(uint8_t), CH_DOS));
+		}
+		if (r->server_name) {
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF8)));
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF8)));
+			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+		}
+		if (r->server_addr) {
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_addr, CH_DOS)));
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->server_addr, CH_DOS)));
+			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_addr, ndr_charset_length(r->server_addr, CH_DOS), sizeof(uint8_t), CH_DOS));
+		}
+		if (r->sam_info3) {
+			NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam_info3));
+		}
+		if (r->session_key) {
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->session_key_length));
+			NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->session_key, r->session_key_length));
+		}
+		if (r->gssapi_delegated_creds) {
+			NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->gssapi_delegated_creds_length));
+			NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->gssapi_delegated_creds, r->gssapi_delegated_creds_length));
+		}
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_named_pipe_auth_req_info3(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req_info3 *r)
+{
+	uint32_t _ptr_client_name;
+	TALLOC_CTX *_mem_save_client_name_0;
+	uint32_t _ptr_client_addr;
+	TALLOC_CTX *_mem_save_client_addr_0;
+	uint32_t _ptr_server_name;
+	TALLOC_CTX *_mem_save_server_name_0;
+	uint32_t _ptr_server_addr;
+	TALLOC_CTX *_mem_save_server_addr_0;
+	uint32_t _ptr_sam_info3;
+	TALLOC_CTX *_mem_save_sam_info3_0;
+	uint32_t _ptr_session_key;
+	TALLOC_CTX *_mem_save_session_key_0;
+	uint32_t _ptr_gssapi_delegated_creds;
+	TALLOC_CTX *_mem_save_gssapi_delegated_creds_0;
+	if (ndr_flags & NDR_SCALARS) {
+		NDR_CHECK(ndr_pull_align(ndr, 5));
+		NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_name));
+		if (_ptr_client_name) {
+			NDR_PULL_ALLOC(ndr, r->client_name);
+		} else {
+			r->client_name = NULL;
+		}
+		NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_addr));
+		if (_ptr_client_addr) {
+			NDR_PULL_ALLOC(ndr, r->client_addr);
+		} else {
+			r->client_addr = NULL;
+		}
+		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->client_port));
+		NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name));
+		if (_ptr_server_name) {
+			NDR_PULL_ALLOC(ndr, r->server_name);
+		} else {
+			r->server_name = NULL;
+		}
+		NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_addr));
+		if (_ptr_server_addr) {
+			NDR_PULL_ALLOC(ndr, r->server_addr);
+		} else {
+			r->server_addr = NULL;
+		}
+		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->server_port));
+		NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sam_info3));
+		if (_ptr_sam_info3) {
+			NDR_PULL_ALLOC(ndr, r->sam_info3);
+		} else {
+			r->sam_info3 = NULL;
+		}
+		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_key_length));
+		NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_session_key));
+		if (_ptr_session_key) {
+			NDR_PULL_ALLOC(ndr, r->session_key);
+		} else {
+			r->session_key = NULL;
+		}
+		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->gssapi_delegated_creds_length));
+		NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_gssapi_delegated_creds));
+		if (_ptr_gssapi_delegated_creds) {
+			NDR_PULL_ALLOC(ndr, r->gssapi_delegated_creds);
+		} else {
+			r->gssapi_delegated_creds = NULL;
+		}
+	}
+	if (ndr_flags & NDR_BUFFERS) {
+		if (r->client_name) {
+			_mem_save_client_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+			NDR_PULL_SET_MEM_CTX(ndr, r->client_name, 0);
+			NDR_CHECK(ndr_pull_array_size(ndr, &r->client_name));
+			NDR_CHECK(ndr_pull_array_length(ndr, &r->client_name));
+			if (ndr_get_array_length(ndr, &r->client_name) > ndr_get_array_size(ndr, &r->client_name)) {
+				return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_name), ndr_get_array_length(ndr, &r->client_name));
+			}
+			NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_name), sizeof(uint8_t)));
+			NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_name, ndr_get_array_length(ndr, &r->client_name), sizeof(uint8_t), CH_UTF8));
+			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_name_0, 0);
+		}
+		if (r->client_addr) {
+			_mem_save_client_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
+			NDR_PULL_SET_MEM_CTX(ndr, r->client_addr, 0);
+			NDR_CHECK(ndr_pull_array_size(ndr, &r->client_addr));
+			NDR_CHECK(ndr_pull_array_length(ndr, &r->client_addr));
+			if (ndr_get_array_length(ndr, &r->client_addr) > ndr_get_array_size(ndr, &r->client_addr)) {
+				return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->client_addr), ndr_get_array_length(ndr, &r->client_addr));
+			}
+			NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->client_addr), sizeof(uint8_t)));
+			NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->client_addr, ndr_get_array_length(ndr, &r->client_addr), sizeof(uint8_t), CH_DOS));
+			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_addr_0, 0);
+		}
+		if (r->server_name) {
+			_mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+			NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0);
+			NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name));
+			NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name));
+			if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) {
+				return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name));
+			}
+			NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint8_t)));
+			NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint8_t), CH_UTF8));
+			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0);
+		}
+		if (r->server_addr) {
+			_mem_save_server_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
+			NDR_PULL_SET_MEM_CTX(ndr, r->server_addr, 0);
+			NDR_CHECK(ndr_pull_array_size(ndr, &r->server_addr));
+			NDR_CHECK(ndr_pull_array_length(ndr, &r->server_addr));
+			if (ndr_get_array_length(ndr, &r->server_addr) > ndr_get_array_size(ndr, &r->server_addr)) {
+				return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_addr), ndr_get_array_length(ndr, &r->server_addr));
+			}
+			NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_addr), sizeof(uint8_t)));
+			NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_addr, ndr_get_array_length(ndr, &r->server_addr), sizeof(uint8_t), CH_DOS));
+			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_addr_0, 0);
+		}
+		if (r->sam_info3) {
+			_mem_save_sam_info3_0 = NDR_PULL_GET_MEM_CTX(ndr);
+			NDR_PULL_SET_MEM_CTX(ndr, r->sam_info3, 0);
+			NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->sam_info3));
+			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sam_info3_0, 0);
+		}
+		if (r->session_key) {
+			_mem_save_session_key_0 = NDR_PULL_GET_MEM_CTX(ndr);
+			NDR_PULL_SET_MEM_CTX(ndr, r->session_key, 0);
+			NDR_CHECK(ndr_pull_array_size(ndr, &r->session_key));
+			NDR_PULL_ALLOC_N(ndr, r->session_key, ndr_get_array_size(ndr, &r->session_key));
+			NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->session_key, ndr_get_array_size(ndr, &r->session_key)));
+			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_session_key_0, 0);
+		}
+		if (r->gssapi_delegated_creds) {
+			_mem_save_gssapi_delegated_creds_0 = NDR_PULL_GET_MEM_CTX(ndr);
+			NDR_PULL_SET_MEM_CTX(ndr, r->gssapi_delegated_creds, 0);
+			NDR_CHECK(ndr_pull_array_size(ndr, &r->gssapi_delegated_creds));
+			NDR_PULL_ALLOC_N(ndr, r->gssapi_delegated_creds, ndr_get_array_size(ndr, &r->gssapi_delegated_creds));
+			NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->gssapi_delegated_creds, ndr_get_array_size(ndr, &r->gssapi_delegated_creds)));
+			NDR_PULL_SET_MEM_CTX(ndr, _mem_save_gssapi_delegated_creds_0, 0);
+		}
+		if (r->session_key) {
+			NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->session_key, r->session_key_length));
+		}
+		if (r->gssapi_delegated_creds) {
+			NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->gssapi_delegated_creds, r->gssapi_delegated_creds_length));
+		}
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_named_pipe_auth_req_info3(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req_info3 *r)
+{
+	ndr_print_struct(ndr, name, "named_pipe_auth_req_info3");
+	ndr->depth++;
+	ndr_print_ptr(ndr, "client_name", r->client_name);
+	ndr->depth++;
+	if (r->client_name) {
+		ndr_print_string(ndr, "client_name", r->client_name);
+	}
+	ndr->depth--;
+	ndr_print_ptr(ndr, "client_addr", r->client_addr);
+	ndr->depth++;
+	if (r->client_addr) {
+		ndr_print_string(ndr, "client_addr", r->client_addr);
+	}
+	ndr->depth--;
+	ndr_print_uint16(ndr, "client_port", r->client_port);
+	ndr_print_ptr(ndr, "server_name", r->server_name);
+	ndr->depth++;
+	if (r->server_name) {
+		ndr_print_string(ndr, "server_name", r->server_name);
+	}
+	ndr->depth--;
+	ndr_print_ptr(ndr, "server_addr", r->server_addr);
+	ndr->depth++;
+	if (r->server_addr) {
+		ndr_print_string(ndr, "server_addr", r->server_addr);
+	}
+	ndr->depth--;
+	ndr_print_uint16(ndr, "server_port", r->server_port);
+	ndr_print_ptr(ndr, "sam_info3", r->sam_info3);
+	ndr->depth++;
+	if (r->sam_info3) {
+		ndr_print_netr_SamInfo3(ndr, "sam_info3", r->sam_info3);
+	}
+	ndr->depth--;
+	ndr_print_uint32(ndr, "session_key_length", r->session_key_length);
+	ndr_print_ptr(ndr, "session_key", r->session_key);
+	ndr->depth++;
+	if (r->session_key) {
+		ndr_print_array_uint8(ndr, "session_key", r->session_key, r->session_key_length);
+	}
+	ndr->depth--;
+	ndr_print_uint32(ndr, "gssapi_delegated_creds_length", r->gssapi_delegated_creds_length);
+	ndr_print_ptr(ndr, "gssapi_delegated_creds", r->gssapi_delegated_creds);
+	ndr->depth++;
+	if (r->gssapi_delegated_creds) {
+		ndr_print_array_uint8(ndr, "gssapi_delegated_creds", r->gssapi_delegated_creds, r->gssapi_delegated_creds_length);
+	}
+	ndr->depth--;
+	ndr->depth--;
+}
+
 static enum ndr_err_code ndr_push_named_pipe_auth_req_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_req_info *r)
 {
 	if (ndr_flags & NDR_SCALARS) {
@@ -243,6 +498,10 @@ static enum ndr_err_code ndr_push_named_pipe_auth_req_info(struct ndr_push *ndr,
 				NDR_CHECK(ndr_push_named_pipe_auth_req_info2(ndr, NDR_SCALARS, &r->info2));
 			break; }
 
+			case 3: {
+				NDR_CHECK(ndr_push_named_pipe_auth_req_info3(ndr, NDR_SCALARS, &r->info3));
+			break; }
+
 			default:
 				return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
 		}
@@ -261,6 +520,10 @@ static enum ndr_err_code ndr_push_named_pipe_auth_req_info(struct ndr_push *ndr,
 				NDR_CHECK(ndr_push_named_pipe_auth_req_info2(ndr, NDR_BUFFERS, &r->info2));
 			break;
 
+			case 3:
+				NDR_CHECK(ndr_push_named_pipe_auth_req_info3(ndr, NDR_BUFFERS, &r->info3));
+			break;
+
 			default:
 				return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
 		}
@@ -290,6 +553,10 @@ static enum ndr_err_code ndr_pull_named_pipe_auth_req_info(struct ndr_pull *ndr,
 				NDR_CHECK(ndr_pull_named_pipe_auth_req_info2(ndr, NDR_SCALARS, &r->info2));
 			break; }
 
+			case 3: {
+				NDR_CHECK(ndr_pull_named_pipe_auth_req_info3(ndr, NDR_SCALARS, &r->info3));
+			break; }
+
 			default:
 				return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
 		}
@@ -307,6 +574,10 @@ static enum ndr_err_code ndr_pull_named_pipe_auth_req_info(struct ndr_pull *ndr,
 				NDR_CHECK(ndr_pull_named_pipe_auth_req_info2(ndr, NDR_BUFFERS, &r->info2));
 			break;
 
+			case 3:
+				NDR_CHECK(ndr_pull_named_pipe_auth_req_info3(ndr, NDR_BUFFERS, &r->info3));
+			break;
+
 			default:
 				return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__);
 		}
@@ -331,6 +602,10 @@ _PUBLIC_ void ndr_print_named_pipe_auth_req_info(struct ndr_print *ndr, const ch
 			ndr_print_named_pipe_auth_req_info2(ndr, "info2", &r->info2);
 		break;
 
+		case 3:
+			ndr_print_named_pipe_auth_req_info3(ndr, "info3", &r->info3);
+		break;
+
 		default:
 			ndr_print_bad_level(ndr, name, level);
 	}
@@ -431,6 +706,42 @@ _PUBLIC_ void ndr_print_named_pipe_auth_rep_info2(struct ndr_print *ndr, const c
 	ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_named_pipe_auth_rep_info3(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep_info3 *r)
+{
+	if (ndr_flags & NDR_SCALARS) {
+		NDR_CHECK(ndr_push_align(ndr, 8));
+		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->file_type));
+		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->device_state));
+		NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->allocation_size));
+	}
+	if (ndr_flags & NDR_BUFFERS) {
+	}
+	return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info3(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep_info3 *r)
+{
+	if (ndr_flags & NDR_SCALARS) {
+		NDR_CHECK(ndr_pull_align(ndr, 8));
+		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->file_type));
+		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->device_state));
+		NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->allocation_size));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list