]> git.sur5r.net Git - openldap/commitdiff
Allow replace with no values
authorKurt Zeilenga <kurt@openldap.org>
Fri, 10 Sep 1999 01:55:46 +0000 (01:55 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 10 Sep 1999 01:55:46 +0000 (01:55 +0000)
dn: cn=foo
changetype: modify
replace: bar
-

clients/tools/ldapmodify.c
servers/slapd/modify.c

index 62746cc5080d13879ec3fb65ec56ad7b4ee7f95e..043d3bbc3dafd888a528f3932e88298c0c25daae 100644 (file)
@@ -463,6 +463,7 @@ process_ldif_rec( char *rbuf, int count )
                goto end_line;
            } else if ( strcasecmp( type, T_MODOPREPLACESTR ) == 0 ) {
                modop = LDAP_MOD_REPLACE;
+               addmodifyop( &pmods, modop, value, NULL, 0 );
                goto end_line;
            } else if ( strcasecmp( type, T_MODOPDELETESTR ) == 0 ) {
                modop = LDAP_MOD_DELETE;
index c5556a33dc270ceafe5763c6ce1d80e4a5fb1d58..8e3521bfac690c7c0d7dcce6f9ee5393085af629 100644 (file)
@@ -124,6 +124,9 @@ do_modify(
                    (*modtail)->ml_op != LDAP_MOD_DELETE &&
                    (*modtail)->ml_op != LDAP_MOD_REPLACE )
                {
+                       Debug( LDAP_DEBUG_ANY,
+                               "do_modify: invalid modify operation (%ld)\n",
+                               (long) (*modtail)->ml_op, 0, 0 );
                        send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR,
                            NULL, "unrecognized modify operation", NULL, NULL );
                        free( ndn );
@@ -131,11 +134,16 @@ do_modify(
                        return LDAP_PROTOCOL_ERROR;
                }
 
-               if ( (*modtail)->ml_bvalues == NULL
-                       && (*modtail)->ml_op != LDAP_MOD_DELETE )
+               if ( (*modtail)->ml_bvalues == NULL && (
+                       (*modtail)->ml_op != LDAP_MOD_REPLACE &&
+                       (*modtail)->ml_op != LDAP_MOD_DELETE ) )
                {
+                       Debug( LDAP_DEBUG_ANY,
+                               "do_modify: invalid modify operation (%ld) without values\n",
+                               (long) (*modtail)->ml_op, 0, 0 );
                        send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR,
-                           NULL, "unrecognized modify operation", NULL, NULL );
+                           NULL, "unrecognized modify operation without values",
+                               NULL, NULL );
                        free( ndn );
                        modlist_free( modlist );
                        return LDAP_PROTOCOL_ERROR;