]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/modify.c
Fix for ITS#1842 (applied blindly)
[openldap] / servers / slapd / modify.c
index e644a898b9c22ddb1cfc7041f6f7fd5ec3a8a3b6..6bb923671bd7f22db33136e0057eb5528ef87f91 100644 (file)
@@ -117,9 +117,11 @@ do_modify(
                }
 
                mod = (Modifications *) ch_malloc( sizeof(Modifications) );
+               mod->sml_op = mop;
                mod->sml_type = tmp.sml_type;
                mod->sml_bvalues = tmp.sml_bvalues;
                mod->sml_desc = NULL;
+               mod->sml_next =NULL;
                *modtail = mod;
 
                switch( mop ) {
@@ -166,7 +168,6 @@ do_modify(
                        }
                }
 
-               mod->sml_op = mop;
                modtail = &mod->sml_next;
        }
        *modtail = NULL;
@@ -277,7 +278,7 @@ do_modify(
        }
 #endif
 
-       Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d MOD dn=\"%s\"\n",
+       Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu MOD dn=\"%s\"\n",
            op->o_connid, op->o_opid, dn.bv_val, 0, 0 );
 
        manageDSAit = get_manageDSAit( op );
@@ -449,6 +450,15 @@ int slap_mods_check(
                        return LDAP_UNDEFINED_TYPE;
                }
 
+               if( slap_ad_is_lang_range( ad )) {
+                       /* attribute requires binary transfer */
+                       snprintf( textbuf, textlen,
+                               "%s: inappropriate use of language range option",
+                               ml->sml_type.bv_val );
+                       *text = textbuf;
+                       return LDAP_UNDEFINED_TYPE;
+               }
+
                if (!update && is_at_no_user_mod( ad->ad_type )) {
                        /* user modification disallowed */
                        snprintf( textbuf, textlen,