]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/modify.c
Move backend_syncfreq code down into back-ldbm. Creates new configuration
[openldap] / servers / slapd / modify.c
index 979a97efe9547b325af4f6e69cdf54fe6485552e..ff08f54dee494cb050fc103508315b6b2f9ad0eb 100644 (file)
@@ -372,7 +372,8 @@ int slap_modlist2mods(
 
                if( rc != LDAP_SUCCESS ) {
                        slap_mods_free( mod );
-                       snprintf( textbuf, textlen, "%s: %s", ml->ml_type, text );
+                       snprintf( textbuf, textlen, "%s: %s",
+                               ml->ml_type, *text );
                        *text = textbuf;
                        return rc;
                }
@@ -414,6 +415,21 @@ int slap_modlist2mods(
                        return LDAP_CONSTRAINT_VIOLATION;
                }
 
+               if ( is_at_obsolete( ad->ad_type ) &&
+                       ( mod->sml_op == LDAP_MOD_ADD || ml->ml_bvalues != NULL ) )
+               {
+                       /*
+                        * attribute is obsolete,
+                        * only allow replace/delete with no values
+                        */
+                       slap_mods_free( mod );
+                       snprintf( textbuf, textlen,
+                               "%s: attribute is obsolete",
+                               ml->ml_type );
+                       *text = textbuf;
+                       return LDAP_CONSTRAINT_VIOLATION;
+               }
+
                /*
                 * check values
                 */
@@ -423,16 +439,6 @@ int slap_modlist2mods(
                                ad->ad_type->sat_syntax->ssyn_validate;
 
                        if( !validate ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                                       "modlist2mods: %s: no validator for syntax %s\n",
-                                       ml->ml_type, ad->ad_type->sat_syntax->ssyn_oid ));
-#else
-                               Debug( LDAP_DEBUG_TRACE,
-                                       "modlist2mods: %s: no validator for syntax %s\n",
-                                       ml->ml_type, ad->ad_type->sat_syntax->ssyn_oid, 0 );
-#endif
-
                                slap_mods_free( mod );
                                *text = "no validator for syntax";
                                snprintf( textbuf, textlen,