ldap/servers/slapd/modify.c | 46 ++++++++++++++++++++++++++------------------
1 file changed, 28 insertions(+), 18 deletions(-)
New commits:
commit a4c4daaa54d1ba94e342fcbf9af13a547886f0e3
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Mar 27 17:23:10 2013 -0400
Ticket 620 - Better logging of error messages for 389-ds-base
Bug Description: In a replication environment, if you have one master set with
passwordIsGlobalpolicy to on, and another master does not, then
the password policy updates are rejected. However, there is no
clear logging to tell you why the operatoin was rejected.
Fix Description: Write a clear message in the error log stating what was the cause
of the failure.
https://fedorahosted.org/389/ticket/620
Reviewed by: nhosoi & nkinder (Thanks!!)
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c
index d42ef2c..cc1621b 100644
--- a/ldap/servers/slapd/modify.c
+++ b/ldap/servers/slapd/modify.c
@@ -128,22 +128,22 @@ static struct attr_value_check {
void
do_modify( Slapi_PBlock *pb )
{
- Slapi_Operation *operation;
- BerElement *ber;
- char *last, *type = NULL;
- ber_tag_t tag;
- ber_len_t len;
- LDAPMod *mod;
- LDAPMod **mods;
- Slapi_Mods smods;
- int err;
- int pw_change = 0; /* 0= no password change */
- int ignored_some_mods = 0;
- int has_password_mod = 0; /* number of password mods */
- char *old_pw = NULL; /* remember the old password */
- char *rawdn = NULL;
- int minssf_exclude_rootdse = 0;
- LDAPMod **normalized_mods = NULL;
+ Slapi_Operation *operation;
+ Slapi_Mods smods;
+ BerElement *ber;
+ ber_tag_t tag;
+ ber_len_t len;
+ LDAPMod **normalized_mods = NULL;
+ LDAPMod *mod;
+ LDAPMod **mods;
+ char *last, *type = NULL;
+ char *old_pw = NULL; /* remember the old password */
+ char *rawdn = NULL;
+ int minssf_exclude_rootdse = 0;
+ int ignored_some_mods = 0;
+ int has_password_mod = 0; /* number of password mods */
+ int pw_change = 0; /* 0 = no password change */
+ int err;
LDAPDebug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 );
@@ -291,8 +291,10 @@ do_modify( Slapi_PBlock *pb )
/* check if user is allowed to modify the specified attribute */
if (!op_shared_is_allowed_attr (mod->mod_type, pb->pb_conn->c_isreplication_session))
{
- /* for now we just ignore attributes that client is not allowed
- to modify so not to break existing clients */
+ /*
+ * For now we just ignore attributes that client is not allowed
+ * to modify so not to break existing clients
+ */
++ignored_some_mods;
ber_bvecfree(mod->mod_bvalues);
slapi_ch_free((void **)&(mod->mod_type));
@@ -310,6 +312,14 @@ do_modify( Slapi_PBlock *pb )
}
if (ignored_some_mods && (0 == smods.num_elements)) {
+ if(pb->pb_conn->c_isreplication_session){
+ int connid, opid;
+ slapi_pblock_get(pb, SLAPI_CONN_ID, &connid);
+ slapi_pblock_get(pb, SLAPI_OPERATION_ID, &opid);
+ LDAPDebug( LDAP_DEBUG_ANY,"Rejecting replicated password policy operation(conn=%d op=%d) for "
+ "entry %s. To allow these changes to be accepted, set passwordIsGlobalPolicy to 'on' in "
+ "cn=config.\n", connid, opid, rawdn);
+ }
send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM, NULL, NULL, 0, NULL );
goto free_and_return;
}
ldap/servers/slapd/pw.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit ab46f87224706a7023596b4261cbcc66b5bc037b
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Mar 27 11:05:22 2013 -0400
Ticket 458 - Need to properly check if the password admin dn is set
Bug Description: We were previously checking if password admin sdn was NULL,
which it never is. So it would always search the database
looking for the password admins.
Fix Description: Call slapi_sdn_get_dn() to see if the DN was actually set.
https://fedorahosted.org/389/ticket/458
Reviewed by: richm(Thanks Rich!)
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
index b31c2a8..3bb87d7 100644
--- a/ldap/servers/slapd/pw.c
+++ b/ldap/servers/slapd/pw.c
@@ -1535,6 +1535,7 @@ pw_get_admin_users(passwdPolicy *pwp)
const Slapi_DN *sdn = pwp->pw_admin;
char **uniquemember_vals = NULL;
char **member_vals = NULL;
+ char *binddn = slapi_sdn_get_dn(sdn);
int uniquemember_count = 0;
int member_count = 0;
int nentries = 0;
@@ -1542,13 +1543,13 @@ pw_get_admin_users(passwdPolicy *pwp)
int res;
int i;
- if(sdn == NULL){
+ if(binddn == NULL){
return;
}
/*
* Check if the DN exists and has "group" objectclasses
*/
- slapi_search_internal_set_pb(pb, slapi_sdn_get_dn(sdn), LDAP_SCOPE_BASE,"(|(objectclass=groupofuniquenames)(objectclass=groupofnames))",
+ 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_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);