]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/modify.c
fix ITS#3753
[openldap] / servers / slapd / modify.c
index f468efd38df95a4b1afd46da5a5788f0c8cad923..77b0d5013a2a630dd7fc6559227788b7b3ae77dd 100644 (file)
@@ -573,14 +573,27 @@ slap_mods_no_user_mod_check(
        size_t textlen )
 {
        for ( ; ml != NULL; ml = ml->sml_next ) {
-               if ( is_at_no_user_mod( ml->sml_desc->ad_type ) ) {
+               if ( !is_at_no_user_mod( ml->sml_desc->ad_type ) ) continue;
+
+               if( get_manageDIT( op )) {
+                       if ( ml->sml_desc->ad_type->sat_flags & SLAP_AT_MANAGEABLE ) {
+                               continue;
+                       }
+
+                       /* attribute not manageable */
+                       snprintf( textbuf, textlen,
+                               "%s: no-user-modification attribute not manageable",
+                               ml->sml_type.bv_val );
+
+               } else {
                        /* user modification disallowed */
                        snprintf( textbuf, textlen,
                                "%s: no user modification allowed",
                                ml->sml_type.bv_val );
-                       *text = textbuf;
-                       return LDAP_CONSTRAINT_VIOLATION;
                }
+
+               *text = textbuf;
+               return LDAP_CONSTRAINT_VIOLATION;
        }
 
        return LDAP_SUCCESS;