summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wbinfo.c2
-rw-r--r--source3/nsswitch/winbindd_ads.c21
-rw-r--r--source3/nsswitch/winbindd_pam.c12
3 files changed, 22 insertions, 13 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index bca1813167..55eeb9fa39 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -451,7 +451,7 @@ static BOOL wbinfo_lookupname(char *name)
/* Display response */
- d_printf("%s %d\n", response.data.sid.sid, response.data.sid.type);
+ d_printf("%s %s (%d)\n", response.data.sid.sid, sid_type_lookup(response.data.sid.type), response.data.sid.type);
return True;
}
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 889f63a42c..f8582aee99 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -598,18 +598,21 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
rc = ads_search_retry_dn(ads, (void**)&msg, user_dn, attrs);
if (!ADS_ERR_OK(rc)) {
status = ads_ntstatus(rc);
- DEBUG(1,("lookup_usergroups(sid=%s) ads_search tokenGroups: %s\n", sid_to_string(sid_string, sid), ads_errstr(rc)));
+ DEBUG(1,("lookup_usergroups(sid=%s) ads_search tokenGroups: %s\n",
+ sid_to_string(sid_string, sid), ads_errstr(rc)));
goto done;
}
if (!msg) {
- DEBUG(1,("lookup_usergroups(sid=%s) ads_search tokenGroups: NULL msg\n", sid_to_string(sid_string, sid)));
+ DEBUG(1,("lookup_usergroups(sid=%s) ads_search tokenGroups: NULL msg\n",
+ sid_to_string(sid_string, sid)));
status = NT_STATUS_UNSUCCESSFUL;
goto done;
}
if (!ads_pull_uint32(ads, msg, "primaryGroupID", &primary_group_rid)) {
- DEBUG(1,("%s: No primary group for sid=%s !?\n", domain->name, sid_to_string(sid_string, sid)));
+ DEBUG(1,("%s: No primary group for sid=%s !?\n",
+ domain->name, sid_to_string(sid_string, sid)));
goto done;
}
@@ -677,7 +680,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
uint32 current_usn;
int num_retries = 0;
- DEBUG(10,("ads: lookup_groupmem %s sid=%s\n", domain->name, sid_string_static(group_sid)));
+ DEBUG(10,("ads: lookup_groupmem %s sid=%s\n", domain->name,
+ sid_string_static(group_sid)));
*num_names = 0;
@@ -738,13 +742,15 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
}
if (first_usn != current_usn) {
- DEBUG(5, ("ads: lookup_groupmem USN on this record changed - restarting search\n"));
+ DEBUG(5, ("ads: lookup_groupmem USN on this record changed"
+ " - restarting search\n"));
if (num_retries < 5) {
num_retries++;
num_members = 0;
continue;
} else {
- DEBUG(5, ("ads: lookup_groupmem USN on this record changed - restarted search too many times, aborting!\n"));
+ DEBUG(5, ("ads: lookup_groupmem USN on this record changed"
+ " - restarted search too many times, aborting!\n"));
status = NT_STATUS_UNSUCCESSFUL;
goto done;
}
@@ -858,7 +864,8 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain,
}
if ( NT_STATUS_IS_OK(result) )
- result = cli_ds_enum_domain_trusts( cli, mem_ctx, cli->desthost, flags, &domains, (unsigned int *)&count );
+ result = cli_ds_enum_domain_trusts( cli, mem_ctx, cli->desthost,
+ flags, &domains, (unsigned int *)&count );
if ( NT_STATUS_IS_OK(result) && count) {
diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c
index 801f36df79..dba2fe8ba4 100644
--- a/source3/nsswitch/winbindd_pam.c
+++ b/source3/nsswitch/winbindd_pam.c
@@ -512,11 +512,13 @@ enum winbindd_result winbindd_pam_chauthtok(struct winbindd_cli_state *state)
goto done;
}
- if (!NT_STATUS_IS_OK(result = cli_samr_chgpasswd_user(hnd->cli, mem_ctx,
- user, newpass, oldpass))) {
- DEBUG(1, ("password change failed for user %s/%s\n", domain,
- user));
- }
+ if (!cli_oem_change_password(hnd->cli, user, newpass, oldpass)) {
+ DEBUG(1, ("password change failed for user %s/%s\n", domain,
+ user));
+ result = NT_STATUS_WRONG_PASSWORD;
+ } else {
+ result = NT_STATUS_OK;
+ }
done:
state->response.data.auth.nt_status = NT_STATUS_V(result);