|
@@ -1558,14 +1558,17 @@ pw_get_admin_users(passwdPolicy *pwp)
|
|
|
* Check if the DN exists and has "group" objectclasses
|
|
* Check if the DN exists and has "group" objectclasses
|
|
|
*/
|
|
*/
|
|
|
pb = slapi_pblock_new();
|
|
pb = slapi_pblock_new();
|
|
|
- slapi_search_internal_set_pb(pb, binddn, LDAP_SCOPE_BASE,"(|(objectclass=groupofuniquenames)(objectclass=groupofnames))",
|
|
|
|
|
- NULL, 0, NULL, NULL, (void *) plugin_get_default_component_id(), 0);
|
|
|
|
|
|
|
+ slapi_search_internal_set_pb(pb, binddn, LDAP_SCOPE_BASE,
|
|
|
|
|
+ "(|(objectclass=groupofuniquenames)(objectclass=groupofnames))",
|
|
|
|
|
+ NULL, 0, NULL, NULL, (void *) plugin_get_default_component_id(), 0);
|
|
|
slapi_search_internal_pb(pb);
|
|
slapi_search_internal_pb(pb);
|
|
|
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
|
|
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
|
|
|
if (res != LDAP_SUCCESS) {
|
|
if (res != LDAP_SUCCESS) {
|
|
|
|
|
+ slapi_free_search_results_internal(pb);
|
|
|
slapi_pblock_destroy(pb);
|
|
slapi_pblock_destroy(pb);
|
|
|
- LDAPDebug(LDAP_DEBUG_ANY, "pw_get_admin_users: search failed for %s: error %d - Password Policy Administrators can not be set\n",
|
|
|
|
|
- slapi_sdn_get_dn(sdn), res, 0);
|
|
|
|
|
|
|
+ LDAPDebug(LDAP_DEBUG_ANY, "pw_get_admin_users: search failed for %s: error %d - "
|
|
|
|
|
+ "Password Policy Administrators can not be set\n",
|
|
|
|
|
+ slapi_sdn_get_dn(sdn), res, 0);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
/*
|
|
/*
|
|
@@ -1581,7 +1584,8 @@ pw_get_admin_users(passwdPolicy *pwp)
|
|
|
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
|
|
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
|
|
|
uniquemember_vals = slapi_entry_attr_get_charray_ext(entries[0], "uniquemember", &uniquemember_count);
|
|
uniquemember_vals = slapi_entry_attr_get_charray_ext(entries[0], "uniquemember", &uniquemember_count);
|
|
|
member_vals = slapi_entry_attr_get_charray_ext(entries[0], "member", &member_count);
|
|
member_vals = slapi_entry_attr_get_charray_ext(entries[0], "member", &member_count);
|
|
|
- pwp->pw_admin_user = (Slapi_DN **)slapi_ch_calloc((uniquemember_count + member_count + 1), sizeof(Slapi_DN *));
|
|
|
|
|
|
|
+ pwp->pw_admin_user = (Slapi_DN **)slapi_ch_calloc((uniquemember_count + member_count + 1),
|
|
|
|
|
+ sizeof(Slapi_DN *));
|
|
|
if(uniquemember_count > 0){
|
|
if(uniquemember_count > 0){
|
|
|
for(i = 0; i < uniquemember_count; i++){
|
|
for(i = 0; i < uniquemember_count; i++){
|
|
|
pwp->pw_admin_user[count++] = slapi_sdn_new_dn_passin(uniquemember_vals[i]);
|
|
pwp->pw_admin_user[count++] = slapi_sdn_new_dn_passin(uniquemember_vals[i]);
|