]> git.sur5r.net Git - openldap/commitdiff
ctrl oid fix from HEAD
authorHoward Chu <hyc@openldap.org>
Thu, 14 Jun 2007 14:51:36 +0000 (14:51 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 14 Jun 2007 14:51:36 +0000 (14:51 +0000)
servers/slapd/overlays/ppolicy.c

index dabab1df96d93c53747ba23d3ffa79190833b484..2c68c9d0afa5bfbb9a619fddcb47d66b8c54cc33 100644 (file)
@@ -356,6 +356,8 @@ account_locked( Operation *op, Entry *e,
 #define PPOLICY_EXPIRE 0x80L   /* primitive + 0 */
 #define PPOLICY_GRACE  0x81L   /* primitive + 1 */
 
+static const char ppolicy_ctrl_oid[] = LDAP_CONTROL_PASSWORDPOLICYRESPONSE;
+
 static LDAPControl *
 create_passcontrol( int exptime, int grace, LDAPPasswordPolicyError err )
 {
@@ -368,7 +370,7 @@ create_passcontrol( int exptime, int grace, LDAPPasswordPolicyError err )
        if ( c == NULL ) {
                return NULL;
        }
-       c->ldctl_oid = LDAP_CONTROL_PASSWORDPOLICYRESPONSE;
+       c->ldctl_oid = (char *)ppolicy_ctrl_oid;
        c->ldctl_iscritical = 0;
        BER_BVZERO( &c->ldctl_value );
 
@@ -848,7 +850,7 @@ ctrls_cleanup( Operation *op, SlapReply *rs, LDAPControl **oldctrls )
        assert( rs->sr_ctrls[0] != NULL );
 
        for ( n = 0; rs->sr_ctrls[n]; n++ ) {
-               if ( !strcmp( rs->sr_ctrls[n]->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) ) {
+               if ( rs->sr_ctrls[n]->ldctl_oid == ppolicy_ctrl_oid ) {
                        ch_free( rs->sr_ctrls[n]->ldctl_value.bv_val );
                        ch_free( rs->sr_ctrls[n] );
                        rs->sr_ctrls[n] = (LDAPControl *)(-1);