]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/modify.c
moved rdn parsing in a dedicated routine, ldap_str2rdn(), that can be used directly...
[openldap] / libraries / libldap / modify.c
index 71abe8aba1b40af10119037eb91a1d3fefe3d9e1..8ef0098c70b8b6d09bd892816e64a831cabc722c 100644 (file)
@@ -1,5 +1,6 @@
+/* $OpenLDAP$ */
 /*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*  Portions
@@ -72,12 +73,16 @@ ldap_modify_ext( LDAP *ld,
 
        Debug( LDAP_DEBUG_TRACE, "ldap_modify_ext\n", 0, 0, 0 );
 
+       /* check client controls */
+       rc = ldap_int_client_controls( ld, cctrls );
+       if( rc != LDAP_SUCCESS ) return rc;
+
        /* create a message to send */
-       if ( (ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
+       if ( (ber = ldap_alloc_ber_with_options( ld )) == NULL ) {
                return( LDAP_NO_MEMORY );
        }
 
-       if ( ber_printf( ber, "{it{s{", ++ld->ld_msgid, LDAP_REQ_MODIFY, dn )
+       if ( ber_printf( ber, "{it{s{" /*}}}*/, ++ld->ld_msgid, LDAP_REQ_MODIFY, dn )
            == -1 ) {
                ld->ld_errno = LDAP_ENCODING_ERROR;
                ber_free( ber, 1 );
@@ -87,11 +92,12 @@ ldap_modify_ext( LDAP *ld,
        /* for each modification to be performed... */
        for ( i = 0; mods[i] != NULL; i++ ) {
                if (( mods[i]->mod_op & LDAP_MOD_BVALUES) != 0 ) {
-                       rc = ber_printf( ber, "{e{s[V]}}",
-                           mods[i]->mod_op & ~LDAP_MOD_BVALUES,
+                       rc = ber_printf( ber, "{e{s[V]N}N}",
+                           (ber_int_t) ( mods[i]->mod_op & ~LDAP_MOD_BVALUES ),
                            mods[i]->mod_type, mods[i]->mod_bvalues );
                } else {
-                       rc = ber_printf( ber, "{e{s[v]}}", mods[i]->mod_op,
+                       rc = ber_printf( ber, "{e{s[v]N}N}",
+                               (ber_int_t) mods[i]->mod_op,
                            mods[i]->mod_type, mods[i]->mod_values );
                }
 
@@ -102,7 +108,7 @@ ldap_modify_ext( LDAP *ld,
                }
        }
 
-       if ( ber_printf( ber, "}}" ) == -1 ) {
+       if ( ber_printf( ber, /*{{*/ "N}N}" ) == -1 ) {
                ld->ld_errno = LDAP_ENCODING_ERROR;
                ber_free( ber, 1 );
                return( ld->ld_errno );
@@ -114,7 +120,7 @@ ldap_modify_ext( LDAP *ld,
                return ld->ld_errno;
        }
 
-       if ( ber_printf( ber, "}" ) == -1 ) {
+       if ( ber_printf( ber, /*{*/ "N}" ) == -1 ) {
                ld->ld_errno = LDAP_ENCODING_ERROR;
                ber_free( ber, 1 );
                return( ld->ld_errno );