r1961: print out the dcerpc fault code, when we got NT_STATUS_NET_WRITE_FAULT
authorStefan Metzmacher <metze@samba.org>
Fri, 20 Aug 2004 15:00:22 +0000 (15:00 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:58:13 +0000 (12:58 -0500)
(this need to be done more generic for all dcerpc calls,
 but for now I just need it in this 2 places)

metze
(This used to be commit d965f84f69ada2a10e9159aa1743c0bee7790488)

source4/torture/rpc/drsuapi.c
source4/torture/rpc/testjoin.c

index 2938a1a7440eca8087bf6be9c3ca99f5e5d6d454..5a12ef37f402754acd9934993996e1631dc685b7 100644 (file)
@@ -195,7 +195,11 @@ static BOOL test_DRSBind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
 
        status = dcerpc_DRSUAPI_BIND(p, mem_ctx, &r);
        if (!NT_STATUS_IS_OK(status)) {
-               printf("DRSUAPI_BIND level failed - %s\n", nt_errstr(status));
+               const char *errstr = nt_errstr(status);
+               if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
+                       errstr = dcerpc_errstr(p->last_fault_code);
+               }
+               printf("DRSUAPI_BIND level failed - %s\n", errstr);
                ret = False;
        }
 
index aab08c3a5601fd0820ba0bd07e0834270e285bd4..9c9fd749fb86452d832c02e6cfab952f1022a1c4 100644 (file)
@@ -139,7 +139,11 @@ void *torture_join_domain(const char *machine_name,
 
        status = dcerpc_samr_Connect(join->p, mem_ctx, &c);
        if (!NT_STATUS_IS_OK(status)) {
-               printf("samr_Connect failed - %s\n", nt_errstr(status));
+               const char *errstr = nt_errstr(status);
+               if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
+                       errstr = dcerpc_errstr(join->p->last_fault_code);
+               }
+               printf("samr_Connect failed - %s\n", errstr);
                goto failed;
        }