diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-02-12 09:53:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:48:02 -0500 |
commit | 78eb31a8f075cac813cdd76f1f042462b0b47543 (patch) | |
tree | e13effa8a90debde38d64baf250ec51f4f2f2345 | |
parent | 10c928a94f6fafd79ae4c9e581c793bbf700a9b5 (diff) | |
download | samba-78eb31a8f075cac813cdd76f1f042462b0b47543.tar.gz samba-78eb31a8f075cac813cdd76f1f042462b0b47543.tar.bz2 samba-78eb31a8f075cac813cdd76f1f042462b0b47543.zip |
r21292: add become_dc:print = yes option to dump out the drsuapi traffic
metze
(This used to be commit 5065a9b5ffe4dc9a77f4e5955dc0d8d86feb8c5e)
-rw-r--r-- | source4/libnet/libnet_become_dc.c | 77 |
1 files changed, 74 insertions, 3 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 89c993eb77..aa4e2287bc 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -864,9 +864,13 @@ static void becomeDC_drsuapi_connect_send(struct libnet_BecomeDC_state *s, drsuapi->s = s; if (!drsuapi->binding) { - binding_str = talloc_asprintf(s, "ncacn_ip_tcp:%s[krb5,seal]", s->source_dsa.dns_name); - if (composite_nomem(binding_str, c)) return; - + if (lp_parm_bool(-1, "become_dc", "print", False)) { + binding_str = talloc_asprintf(s, "ncacn_ip_tcp:%s[krb5,print,seal]", s->source_dsa.dns_name); + if (composite_nomem(binding_str, c)) return; + } else { + binding_str = talloc_asprintf(s, "ncacn_ip_tcp:%s[krb5,seal]", s->source_dsa.dns_name); + if (composite_nomem(binding_str, c)) return; + } c->status = dcerpc_parse_binding(s, binding_str, &drsuapi->binding); talloc_free(binding_str); if (!composite_is_ok(c)) return; @@ -997,9 +1001,19 @@ static void becomeDC_drsuapi1_bind_recv(struct rpc_request *req) struct composite_context *c = s->creq; WERROR status; + bool print = false; + + if (req->p->conn->flags & DCERPC_DEBUG_PRINT_OUT) { + print = true; + } + c->status = dcerpc_ndr_request_recv(req); if (!composite_is_ok(c)) return; + if (print) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsBind, &s->drsuapi1.bind_r); + } + status = becomeDC_drsuapi_bind_recv(s, &s->drsuapi1); if (!W_ERROR_IS_OK(status)) { composite_error(c, werror_to_ntstatus(status)); @@ -1467,10 +1481,19 @@ static void becomeDC_drsuapi1_add_entry_recv(struct rpc_request *req) struct composite_context *c = s->creq; struct drsuapi_DsAddEntry *r = talloc_get_type(req->ndr.struct_ptr, struct drsuapi_DsAddEntry); + bool print = false; + + if (req->p->conn->flags & DCERPC_DEBUG_PRINT_OUT) { + print = true; + } c->status = dcerpc_ndr_request_recv(req); if (!composite_is_ok(c)) return; + if (print) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsAddEntry, r); + } + if (!W_ERROR_IS_OK(r->out.result)) { composite_error(c, werror_to_ntstatus(r->out.result)); return; @@ -1575,9 +1598,19 @@ static void becomeDC_drsuapi2_bind_recv(struct rpc_request *req) char *binding_str; WERROR status; + bool print = false; + + if (req->p->conn->flags & DCERPC_DEBUG_PRINT_OUT) { + print = true; + } + c->status = dcerpc_ndr_request_recv(req); if (!composite_is_ok(c)) return; + if (print) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsBind, &s->drsuapi2.bind_r); + } + status = becomeDC_drsuapi_bind_recv(s, &s->drsuapi2); if (!W_ERROR_IS_OK(status)) { composite_error(c, werror_to_ntstatus(status)); @@ -1772,9 +1805,19 @@ static void becomeDC_drsuapi3_pull_schema_recv(struct rpc_request *req) struct drsuapi_DsGetNCChanges); WERROR status; + bool print = false; + + if (req->p->conn->flags & DCERPC_DEBUG_PRINT_OUT) { + print = true; + } + c->status = dcerpc_ndr_request_recv(req); if (!composite_is_ok(c)) return; + if (print) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNCChanges, r); + } + status = becomeDC_drsuapi_pull_partition_recv(s, &s->schema_part, r); if (!W_ERROR_IS_OK(status)) { composite_error(c, werror_to_ntstatus(status)); @@ -1824,9 +1867,19 @@ static void becomeDC_drsuapi3_pull_config_recv(struct rpc_request *req) struct drsuapi_DsGetNCChanges); WERROR status; + bool print = false; + + if (req->p->conn->flags & DCERPC_DEBUG_PRINT_OUT) { + print = true; + } + c->status = dcerpc_ndr_request_recv(req); if (!composite_is_ok(c)) return; + if (print) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNCChanges, r); + } + status = becomeDC_drsuapi_pull_partition_recv(s, &s->config_part, r); if (!W_ERROR_IS_OK(status)) { composite_error(c, werror_to_ntstatus(status)); @@ -1881,10 +1934,19 @@ static void becomeDC_drsuapi3_pull_domain_recv(struct rpc_request *req) struct drsuapi_DsGetNCChanges *r = talloc_get_type(req->ndr.struct_ptr, struct drsuapi_DsGetNCChanges); WERROR status; + bool print = false; + + if (req->p->conn->flags & DCERPC_DEBUG_PRINT_OUT) { + print = true; + } c->status = dcerpc_ndr_request_recv(req); if (!composite_is_ok(c)) return; + if (print) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsGetNCChanges, r); + } + status = becomeDC_drsuapi_pull_partition_recv(s, &s->domain_part, r); if (!W_ERROR_IS_OK(status)) { composite_error(c, werror_to_ntstatus(status)); @@ -1947,10 +2009,19 @@ static void becomeDC_drsuapi2_update_refs_schema_recv(struct rpc_request *req) struct composite_context *c = s->creq; struct drsuapi_DsReplicaUpdateRefs *r = talloc_get_type(req->ndr.struct_ptr, struct drsuapi_DsReplicaUpdateRefs); + bool print = false; + + if (req->p->conn->flags & DCERPC_DEBUG_PRINT_OUT) { + print = true; + } c->status = dcerpc_ndr_request_recv(req); if (!composite_is_ok(c)) return; + if (print) { + NDR_PRINT_OUT_DEBUG(drsuapi_DsReplicaUpdateRefs, r); + } + if (!W_ERROR_IS_OK(r->out.result)) { composite_error(c, werror_to_ntstatus(r->out.result)); return; |