&range_start) == 1) {
*more_strings = False;
} else {
- DEBUG(1, ("ads_pull_strings_range: Cannot parse Range attriubte (%s)\n", range_attr));
+ DEBUG(1, ("ads_pull_strings_range: Cannot parse Range attriubte (%s)\n",
+ range_attr));
ldap_memfree(range_attr);
*more_strings = False;
return NULL;
}
if ((*num_strings) != range_start) {
- DEBUG(1, ("ads_pull_strings_range: Range attribute (%s) doesn't start at %u, but at %lu - aborting range retreival\n",
+ DEBUG(1, ("ads_pull_strings_range: Range attribute (%s) doesn't start at %u, but at %lu"
+ " - aborting range retreival\n",
range_attr, *num_strings + 1, range_start));
ldap_memfree(range_attr);
*more_strings = False;
new_strings = ads_pull_strings(ads, mem_ctx, msg, range_attr, &num_new_strings);
if (*more_strings && ((*num_strings + num_new_strings) != (range_end + 1))) {
- DEBUG(1, ("ads_pull_strings_range: Range attribute (%s) tells us we have %lu strings in this bunch, but we only got %lu - aborting range retreival\n",
- range_attr, (unsigned long int)range_end - range_start + 1, (unsigned long int)num_new_strings));
+ DEBUG(1, ("ads_pull_strings_range: Range attribute (%s) tells us we have %lu "
+ "strings in this bunch, but we only got %lu - aborting range retreival\n",
+ range_attr, (unsigned long int)range_end - range_start + 1,
+ (unsigned long int)num_new_strings));
ldap_memfree(range_attr);
*more_strings = False;
return NULL;
p = strchr(value, ':');
if (!p) {
talloc_destroy(ctx);
- DEBUG(1, ("ads_server_info: returned ldap server name did not contain a ':' so was deemed invalid\n"));
+ DEBUG(1, ("ads_server_info: returned ldap server name did not contain a ':' "
+ "so was deemed invalid\n"));
return ADS_ERROR(LDAP_DECODING_ERROR);
}
p = strchr(ads->config.ldap_server_name, '$');
if (!p || p[1] != '@') {
talloc_destroy(ctx);
- DEBUG(1, ("ads_server_info: returned ldap server name (%s) does not contain '$@' so was deemed invalid\n", ads->config.ldap_server_name));
+ DEBUG(1, ("ads_server_info: returned ldap server name (%s) does not contain '$@'"
+ " so was deemed invalid\n", ads->config.ldap_server_name));
SAFE_FREE(ads->config.ldap_server_name);
return ADS_ERROR(LDAP_DECODING_ERROR);
}
/* 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;
}
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;
}
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;
}
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;
}
}
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) {
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);