From 6a2dabe1a7faae47dce359b77d886a9489b66fcb Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 21 Oct 2008 01:20:53 +0200 Subject: s4-lsa: merge lsa_GetUserName from s3 lsa idl. Guenther --- source4/torture/rpc/samba3rpc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source4/torture/rpc/samba3rpc.c') diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 85714ace13..25cbb6727d 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -1583,7 +1583,8 @@ static struct dom_sid *whoami(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *lsa; struct lsa_GetUserName r; NTSTATUS status; - struct lsa_StringPointer authority_name_p; + struct lsa_String *authority_name_p = NULL; + struct lsa_String *account_name_p = NULL; struct dom_sid *result; status = pipe_bind_smb(mem_ctx, lp_ctx, tree, "\\pipe\\lsarpc", @@ -1595,12 +1596,14 @@ static struct dom_sid *whoami(TALLOC_CTX *mem_ctx, } r.in.system_name = "\\"; - r.in.account_name = NULL; - authority_name_p.string = NULL; + r.in.account_name = &account_name_p; r.in.authority_name = &authority_name_p; + r.out.account_name = &account_name_p; status = dcerpc_lsa_GetUserName(lsa, mem_ctx, &r); + authority_name_p = *r.out.authority_name; + if (!NT_STATUS_IS_OK(status)) { printf("(%s) GetUserName failed - %s\n", __location__, nt_errstr(status)); @@ -1608,8 +1611,8 @@ static struct dom_sid *whoami(TALLOC_CTX *mem_ctx, return NULL; } - result = name2sid(mem_ctx, lsa, r.out.account_name->string, - r.out.authority_name->string->string); + result = name2sid(mem_ctx, lsa, account_name_p->string, + authority_name_p->string); talloc_free(lsa); return result; -- cgit