Author: abartlet Date: 2006-06-14 16:08:43 +0000 (Wed, 14 Jun 2006) New Revision: 16226
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16226 Log: 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 Modified: branches/SAMBA_4_0/source/libnet/libnet_join.c branches/SAMBA_4_0/source/libnet/libnet_rpc.c Changeset: Modified: branches/SAMBA_4_0/source/libnet/libnet_join.c =================================================================== --- branches/SAMBA_4_0/source/libnet/libnet_join.c 2006-06-14 15:33:44 UTC (rev 16225) +++ branches/SAMBA_4_0/source/libnet/libnet_join.c 2006-06-14 16:08:43 UTC (rev 16226) @@ -642,7 +642,7 @@ 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 @@ } 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; } Modified: branches/SAMBA_4_0/source/libnet/libnet_rpc.c =================================================================== --- branches/SAMBA_4_0/source/libnet/libnet_rpc.c 2006-06-14 15:33:44 UTC (rev 16225) +++ branches/SAMBA_4_0/source/libnet/libnet_rpc.c 2006-06-14 16:08:43 UTC (rev 16226) @@ -474,6 +474,11 @@ 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 @@ 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 */