ldap/servers/plugins/acctpolicy/acct_plugin.c | 1 +
ldap/servers/slapd/pblock.c | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 3e60f7fc434cb8970680ce7ae262296da12d62ae
Author: Mark Reynolds <mareynol(a)redhat.com>
Date: Wed Feb 8 11:03:47 2012 -0500
Ticket #129 - Should only update modifyTimestamp/modifiersName on MODIFY ops
Bug Description: Some internal updates should not rewrite the modifersname and timestamp
Fix Description: Since the orginal bug was filed, we created a new pblock flag
to "skip modifier attrs" updates. But we did not have the option
of setting this flag from a plugin.
So, while this has already been fixed in regards to password
policy. I added a set pblock function, which allows plugins
to set this flag. I also used it in the acctpolicy plugin.
diff --git a/ldap/servers/plugins/acctpolicy/acct_plugin.c b/ldap/servers/plugins/acctpolicy/acct_plugin.c
index 975b7c7..c0420c2 100644
--- a/ldap/servers/plugins/acctpolicy/acct_plugin.c
+++ b/ldap/servers/plugins/acctpolicy/acct_plugin.c
@@ -126,6 +126,7 @@ acct_record_login( const char *dn, void *txn )
plugin_id, SLAPI_OP_FLAG_NO_ACCESS_CHECK |
SLAPI_OP_FLAG_BYPASS_REFERRALS );
slapi_pblock_set( modpb, SLAPI_TXN, txn );
+ slapi_pblock_set( modpb, SLAPI_SKIP_MODIFIED_ATTRS, 1);
slapi_modify_internal_pb( modpb );
slapi_pblock_get( modpb, SLAPI_PLUGIN_INTOP_RESULT, &ldrc );
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index 79d96f0..6b3de8e 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -2823,7 +2823,15 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value )
pblock->pb_operation_notes |= *((unsigned int *)value );
}
break;
-
+ case SLAPI_SKIP_MODIFIED_ATTRS:
+ if(pblock->pb_op == NULL)
+ break;
+ if(value == 0){
+ pblock->pb_op->o_flags &= ~OP_FLAG_SKIP_MODIFIED_ATTRS;
+ } else {
+ pblock->pb_op->o_flags |= OP_FLAG_SKIP_MODIFIED_ATTRS;
+ }
+ break;
/* controls we know about */
case SLAPI_MANAGEDSAIT:
pblock->pb_managedsait = *((int *) value);