summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-08 02:12:30 +0100
committerGünther Deschner <gd@samba.org>2008-02-08 10:26:20 +0100
commit7520439dcac47bc60a8d5526f4acb834f177fec9 (patch)
tree13330aa40fed0e9f1ae9a50c3094ac366a1bd032 /source3/winbindd
parentb13277ed4e59c64f1c3c15109c85a8967c6260fe (diff)
downloadsamba-7520439dcac47bc60a8d5526f4acb834f177fec9.tar.gz
samba-7520439dcac47bc60a8d5526f4acb834f177fec9.tar.bz2
samba-7520439dcac47bc60a8d5526f4acb834f177fec9.zip
Use rpccli_lsa_QueryInfoPolicy() all over the place.
Guenther (This used to be commit ce22abcea3446e4ad42e8e04654b9855b173c5a1)
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_cm.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index ea48dbde72..dbdab65f70 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1837,9 +1837,6 @@ static void set_dc_type_and_flags_connect( struct winbindd_domain *domain )
struct rpc_pipe_client *cli;
POLICY_HND pol;
union dssetup_DsRoleInfo info;
-
- const char *domain_name = NULL;
- DOM_SID *dom_sid = NULL;
union lsa_PolicyInformation *lsa_info = NULL;
if (!connection_ok(domain)) {
@@ -1958,20 +1955,26 @@ no_dssetup:
result = rpccli_lsa_open_policy(cli, mem_ctx, True,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&pol);
-
- if (!NT_STATUS_IS_OK(result))
+
+ if (!NT_STATUS_IS_OK(result)) {
goto done;
-
- result = rpccli_lsa_query_info_policy(cli, mem_ctx,
- &pol, 5, &domain_name,
- &dom_sid);
-
+ }
+
+ result = rpccli_lsa_QueryInfoPolicy(cli, mem_ctx,
+ &pol,
+ LSA_POLICY_INFO_ACCOUNT_DOMAIN,
+ &lsa_info);
+
if (NT_STATUS_IS_OK(result)) {
- if (domain_name)
- fstrcpy(domain->name, domain_name);
- if (dom_sid)
- sid_copy(&domain->sid, dom_sid);
+ if (lsa_info->account_domain.name.string) {
+ fstrcpy(domain->name,
+ lsa_info->account_domain.name.string);
+ }
+
+ if (lsa_info->account_domain.sid) {
+ sid_copy(&domain->sid, lsa_info->account_domain.sid);
+ }
}
}
done: