]> git.sur5r.net Git - openldap/commitdiff
honor relax by not applying constraints (ITS#5705)
authorPierangelo Masarati <ando@openldap.org>
Thu, 18 Sep 2008 21:12:13 +0000 (21:12 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 18 Sep 2008 21:12:13 +0000 (21:12 +0000)
doc/man/man5/slapo-constraint.5
servers/slapd/overlays/constraint.c

index 4df7d83c3ee074c5a4f429bcaea359136e78100f..af832ac4ce9bc26d43f00e25b8ead02279f7fe11 100644 (file)
@@ -20,6 +20,10 @@ like telephone numbers, post codes, FQDNs, etc.
 It constrains only LDAP \fIadd\fP, \fImodify\fP and \fIrename\fP commands
 and only seeks to control the \fIadd\fP and \fIreplace\fP values
 of \fImodify\fP and \fIrename\fP requests.
+.LP
+No constraints are applied for operations performed with the
+.I relax
+control set.
 .SH CONFIGURATION
 This
 .B slapd.conf
index 6a7506677c8dadf635200528ebd3503ed862ce4b..c514da31a7c583b84dcdb4ed65df621514e52bce 100644 (file)
@@ -757,6 +757,10 @@ constraint_add( Operation *op, SlapReply *rs )
        int rc;
        char *msg = NULL;
 
+       if (get_relax(op)) {
+               return SLAP_CB_CONTINUE;
+       }
+
        if ((a = op->ora_e->e_attrs) == NULL) {
                op->o_bd->bd_info = (BackendInfo *)(on->on_info);
                send_ldap_error(op, rs, LDAP_INVALID_SYNTAX,
@@ -833,6 +837,10 @@ constraint_update( Operation *op, SlapReply *rs )
        int rc;
        char *msg = NULL;
 
+       if (get_relax(op)) {
+               return SLAP_CB_CONTINUE;
+       }
+
        switch ( op->o_tag ) {
        case LDAP_REQ_MODIFY:
                modlist = op->orm_modlist;
@@ -846,7 +854,6 @@ constraint_update( Operation *op, SlapReply *rs )
                /* impossible! assert? */
                return LDAP_OTHER;
        }
-
        
        Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, "constraint_update()\n", 0,0,0);
        if ((m = modlist) == NULL) {