summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-06-14 16:08:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:06 -0500
commit345c9f043fa76aecfd9edf017fa77ea393e95d4f (patch)
treef1e557fe43ee0efa90e56dc43067ed9c9f5832af /source4
parent9482de397977fc6b7c18795f0398bcc3768fd189 (diff)
downloadsamba-345c9f043fa76aecfd9edf017fa77ea393e95d4f.tar.gz
samba-345c9f043fa76aecfd9edf017fa77ea393e95d4f.tar.bz2
samba-345c9f043fa76aecfd9edf017fa77ea393e95d4f.zip
r16226: Fixes for various segfault bugs found against a buggy Samba4. With
the current API we need to check both that the RPC didn't fault, and that the query succeeded. Also print the right things in debug messages. Andrew Bartlett (This used to be commit d18e515391f8f5038e9aaaba596099052011b53a)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet_join.c4
-rw-r--r--source4/libnet/libnet_rpc.c13
2 files changed, 15 insertions, 2 deletions
diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c
index fb28eaed2f..1d64257ca3 100644
--- a/source4/libnet/libnet_join.c
+++ b/source4/libnet/libnet_join.c
@@ -642,7 +642,7 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
if (!NT_STATUS_IS_OK(status)) {
r->out.error_string = talloc_asprintf(mem_ctx,
"samr_CreateUser2 (recreate) for [%s] failed: %s\n",
- r->in.domain_name, nt_errstr(status));
+ r->in.account_name, nt_errstr(status));
talloc_free(tmp_ctx);
return status;
}
@@ -650,7 +650,7 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
} else if (!NT_STATUS_IS_OK(status)) {
r->out.error_string = talloc_asprintf(mem_ctx,
"samr_CreateUser2 for [%s] failed: %s\n",
- r->in.domain_name, nt_errstr(status));
+ r->in.account_name, nt_errstr(status));
talloc_free(tmp_ctx);
return status;
}
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c
index d4d187368b..3574559d4f 100644
--- a/source4/libnet/libnet_rpc.c
+++ b/source4/libnet/libnet_rpc.c
@@ -474,6 +474,11 @@ static void continue_lsa_policy(struct rpc_request *req)
return;
}
+ if (!NT_STATUS_IS_OK(s->lsa_query_info2.out.result)) {
+ composite_error(c, s->lsa_query_info2.out.result);
+ return;
+ }
+
/* query lsa info for dns domain name and guid */
s->lsa_query_info2.in.handle = &s->lsa_handle;
s->lsa_query_info2.in.level = LSA_POLICY_INFO_DNS;
@@ -517,6 +522,14 @@ static void continue_lsa_query_info2(struct rpc_request *req)
return;
}
+ if (!NT_STATUS_IS_OK(s->lsa_query_info2.out.result)) {
+ s->r.out.error_string = talloc_asprintf(c,
+ "lsa_QueryInfoPolicy2 failed: %s",
+ nt_errstr(s->lsa_query_info2.out.result));
+ composite_error(c, s->lsa_query_info2.out.result);
+ return;
+ }
+
/* Copy the dns domain name and guid from the query result */
/* this should actually be a conversion from lsa_StringLarge */