sign : enable ntlmssp signing
seal : enable ntlmssp sealing
validate: enable the NDR validator
+ print: enable debugging of the packets
bigendian: use bigendian RPC
ncacn_np:myserver[samr]
ncacn_np:myserver[\pipe\samr]
ncacn_np:myserver[/pipe/samr]
- ncacn_np:myserver:[samr,sign]
+ ncacn_np:myserver:[samr,sign,print]
ncacn_np:myserver:[\pipe\samr,sign,seal,bigendian]
- ncacn_np:myserver:[/pipe/samr,seal]
+ ncacn_np:myserver:[/pipe/samr,seal,validate]
ncacn_ip_tcp:myserver
ncacn_ip_tcp:myserver:1024
{
struct ndr_print ndr;
- if (!DEBUGLVL(2)) {
- return;
- }
-
ndr.mem_ctx = talloc_init("ndr_print_function");
if (!ndr.mem_ctx) return;
ndr.print = ndr_print_debug_helper;
{"sign", DCERPC_SIGN},
{"seal", DCERPC_SEAL},
{"validate", DCERPC_DEBUG_VALIDATE_BOTH},
+ {"print", DCERPC_DEBUG_PRINT_BOTH},
{"bigendian", DCERPC_PUSH_BIGENDIAN}
};
NTSTATUS status;
struct dcesrv_remote_private *private;
const char *binding = lp_parm_string(-1, "dcerpc_remote", "binding");
- const char *print_debug = lp_parm_string(-1, "dcerpc_remote", "print_debug");
if (!binding) {
printf("You must specify a ncacn binding string\n");
lp_parm_string(-1, "dcerpc_remote", "username"),
lp_parm_string(-1, "dcerpc_remote", "password"));
- if (print_debug && strcasecmp("yes",print_debug) == 0) {
- private->c_pipe->flags |= DCERPC_DEBUG_PRINT_BOTH;
- }
-
dce_call->conn->private = private;
return NT_STATUS_OK;
struct dcesrv_remote_private *private = dce_call->conn->private;
NTSTATUS status;
uint16 opnum = dce_call->pkt.u.request.opnum;
+ const char *name = dce_call->conn->iface->ndr->calls[opnum].name;
ndr_push_flags_fn_t ndr_push_fn = dce_call->conn->iface->ndr->calls[opnum].ndr_push;
ndr_pull_flags_fn_t ndr_pull_fn = dce_call->conn->iface->ndr->calls[opnum].ndr_pull;
+ ndr_print_function_t ndr_print_fn = dce_call->conn->iface->ndr->calls[opnum].ndr_print;
size_t struct_size = dce_call->conn->iface->ndr->calls[opnum].struct_size;
+ if (private->c_pipe->flags & DCERPC_DEBUG_PRINT_IN) {
+ ndr_print_function_debug(ndr_print_fn, name, NDR_IN | NDR_SET_VALUES, r);
+ }
+
status = dcerpc_ndr_request(private->c_pipe, opnum, mem_ctx,
(ndr_push_flags_fn_t) ndr_push_fn,
(ndr_pull_flags_fn_t) ndr_pull_fn,
r, struct_size);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0,("dcesrv_remote: call[%s] failed with: %s!\n",name, nt_errstr(status)));
+ return status;
+ }
+
+ if (NT_STATUS_IS_OK(status) && (private->c_pipe->flags & DCERPC_DEBUG_PRINT_OUT)) {
+ ndr_print_function_debug(ndr_print_fn, name, NDR_OUT, r);
+ }
+
return status;
}
if (!NT_STATUS_IS_OK(status)) {
return False;
}
-
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
if (!test_JobEnum(p, mem_ctx)) {
return False;
return False;
}
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
-
if (!test_Exist(p, mem_ctx)) {
ret = False;
}
}
#endif
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
-
if (!test_testcall(p, mem_ctx)) {
ret = False;
}
if (!NT_STATUS_IS_OK(status)) {
return False;
}
-
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
if (!test_Lookup(p, mem_ctx)) {
ret = False;
if (!NT_STATUS_IS_OK(status)) {
return False;
}
-
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
if (!test_OpenEventLog(p, mem_ctx)) {
return False;
if (!NT_STATUS_IS_OK(status)) {
return False;
}
-
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
if (!test_OpenPolicy(p, mem_ctx)) {
ret = False;
if (!NT_STATUS_IS_OK(status)) {
return False;
}
-
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
if (!test_LogonUasLogon(p, mem_ctx)) {
ret = False;
if (!NT_STATUS_IS_OK(status)) {
return False;
}
-
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
if (!test_Connect(p, mem_ctx, &handle)) {
ret = False;
return False;
}
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
-
if (!test_EnumPrinters(p, mem_ctx)) {
ret = False;
}
return False;
}
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
-
if (!test_NetConnEnum(p, mem_ctx)) {
ret = False;
}
if (!NT_STATUS_IS_OK(status)) {
return False;
}
-
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
for (i = 0; i < ARRAY_SIZE(open_fns); i++) {
if (!test_Open(p, mem_ctx, open_fns[i]))
return False;
}
- p->flags |= DCERPC_DEBUG_PRINT_BOTH;
-
if (!test_NetWkstaGetInfo(p, mem_ctx)) {
ret = False;
}