summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-12 18:13:30 +0100
committerGünther Deschner <gd@samba.org>2008-02-12 18:16:56 +0100
commit4c42f7999a876db0ec7e93f60354ef51290ad11e (patch)
treed7c58ec6e8443c1442a122e44c2243a832d22ca9 /source3/winbindd
parent8823c7453df635357bff14ca725c139a1d92f5ef (diff)
downloadsamba-4c42f7999a876db0ec7e93f60354ef51290ad11e.tar.gz
samba-4c42f7999a876db0ec7e93f60354ef51290ad11e.tar.bz2
samba-4c42f7999a876db0ec7e93f60354ef51290ad11e.zip
Use rpccli_samr_QueryUserInfo in net and winbindd.
Guenther (This used to be commit a9ff6760901a489ff8877717bdd5a2218154498f)
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_pam.c12
-rw-r--r--source3/winbindd/winbindd_rpc.c18
2 files changed, 16 insertions, 14 deletions
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 759adb366e..dd27ad62f3 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -1324,12 +1324,10 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
struct rpc_pipe_client *samr_pipe;
POLICY_HND samr_domain_handle, user_pol;
- SAM_USERINFO_CTR *user_ctr;
+ union samr_UserInfo *info = NULL;
NTSTATUS status_tmp;
uint32 acct_flags;
- ZERO_STRUCT(user_ctr);
-
status_tmp = cm_connect_sam(contact_domain, state->mem_ctx,
&samr_pipe, &samr_domain_handle);
@@ -1351,8 +1349,10 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
goto done;
}
- status_tmp = rpccli_samr_query_userinfo(samr_pipe, state->mem_ctx,
- &user_pol, 16, &user_ctr);
+ status_tmp = rpccli_samr_QueryUserInfo(samr_pipe, state->mem_ctx,
+ &user_pol,
+ 16,
+ &info);
if (!NT_STATUS_IS_OK(status_tmp)) {
DEBUG(3, ("could not query user info on SAMR pipe: %s\n",
@@ -1361,7 +1361,7 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
goto done;
}
- acct_flags = user_ctr->info.id16->acb_info;
+ acct_flags = info->info16.acct_flags;
if (acct_flags == 0) {
rpccli_samr_Close(samr_pipe, state->mem_ctx, &user_pol);
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index fa9c1bc58d..2703f2f64a 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -409,7 +409,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
POLICY_HND dom_pol, user_pol;
- SAM_USERINFO_CTR *ctr;
+ union samr_UserInfo *info = NULL;
uint32 user_rid;
NET_USER_INFO_3 *user;
struct rpc_pipe_client *cli;
@@ -480,8 +480,10 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
return result;
/* Get user info */
- result = rpccli_samr_query_userinfo(cli, mem_ctx, &user_pol,
- 0x15, &ctr);
+ result = rpccli_samr_QueryUserInfo(cli, mem_ctx,
+ &user_pol,
+ 0x15,
+ &info);
rpccli_samr_Close(cli, mem_ctx, &user_pol);
@@ -490,11 +492,11 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
sid_compose(&user_info->user_sid, &domain->sid, user_rid);
sid_compose(&user_info->group_sid, &domain->sid,
- ctr->info.id21->group_rid);
- user_info->acct_name = unistr2_to_ascii_talloc(mem_ctx,
- &ctr->info.id21->uni_user_name);
- user_info->full_name = unistr2_to_ascii_talloc(mem_ctx,
- &ctr->info.id21->uni_full_name);
+ info->info21.primary_gid);
+ user_info->acct_name = talloc_strdup(mem_ctx,
+ info->info21.account_name.string);
+ user_info->full_name = talloc_strdup(mem_ctx,
+ info->info21.full_name.string);
user_info->homedir = NULL;
user_info->shell = NULL;
user_info->primary_gid = (gid_t)-1;