summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/winbindd_glue.c2
-rw-r--r--source3/nsswitch/winbindd_user.c2
-rw-r--r--source3/nsswitch/winbindd_util.c11
3 files changed, 9 insertions, 6 deletions
diff --git a/source3/nsswitch/winbindd_glue.c b/source3/nsswitch/winbindd_glue.c
index 6f55e564f4..ac48ae1013 100644
--- a/source3/nsswitch/winbindd_glue.c
+++ b/source3/nsswitch/winbindd_glue.c
@@ -306,7 +306,7 @@ BOOL wb_get_samr_query_userinfo(CLI_POLICY_HND *pol, uint32 info_level,
done:
if (got_user_pol) cli_samr_close(pol->cli, pol->mem_ctx, &user_pol);
- return (result != NT_STATUS_NOPROBLEMO);
+ return (result == NT_STATUS_NOPROBLEMO);
}
/****************************************************************************
diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c
index f23593db88..43227b9dc1 100644
--- a/source3/nsswitch/winbindd_user.c
+++ b/source3/nsswitch/winbindd_user.c
@@ -157,6 +157,8 @@ enum winbindd_result winbindd_getpwnam_from_user(struct winbindd_cli_state
/* The following costs 3 packets */
+ ZERO_STRUCT(user_info);
+
if (!winbindd_lookup_userinfo(domain, user_rid, &user_info)) {
DEBUG(1, ("pwnam_from_user(): error getting user info for "
"user '%s'\n", name_user));
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index 3d8fbd3da8..6026422c30 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -310,7 +310,7 @@ static BOOL get_any_dc_name(char *domain, fstring srv_name)
/* Lookup domain controller name */
- if (!get_dc_list(False, lp_workgroup(), &ip_list, &count))
+ if (!get_dc_list(False, domain, &ip_list, &count))
return False;
/* Firstly choose a PDC/BDC who has the same network address as any
@@ -327,7 +327,7 @@ static BOOL get_any_dc_name(char *domain, fstring srv_name)
dc_ip = ip_list[i];
free(ip_list);
- if (!lookup_pdc_name(global_myname, lp_workgroup(), &dc_ip, srv_name))
+ if (!lookup_pdc_name(global_myname, domain, &dc_ip, srv_name))
return False;
return True;
@@ -430,8 +430,9 @@ BOOL lookup_domain_sid(char *domain_name, struct winbindd_domain *domain)
return False;
}
- if (strequal(domain->controller, server_state.controller)) {
- /* Do a level 5 query info policy */
+ /* Do a level 5 query info policy if we are looking up our own SID */
+
+ if (strequal(domain_name, lp_workgroup())) {
return wb_lsa_query_info_pol(&server_state.lsa_handle, 0x05,
level5_dom, &domain->sid);
}
@@ -443,7 +444,7 @@ BOOL lookup_domain_sid(char *domain_name, struct winbindd_domain *domain)
/* Look for domain name */
- if (!res && domains && sids) {
+ if (res && domains && sids) {
int found = False;
int i;