]> git.sur5r.net Git - openldap/blobdiff - clients/tools/ldapmodrdn.c
Parse server controls on each response, and print them.
[openldap] / clients / tools / ldapmodrdn.c
index 9b03471f4776c429d3fbb0a56a5ec99b53dce358..477b74e365d1478a12f9d55fb61a704255c3d8ee 100644 (file)
@@ -241,6 +241,7 @@ static int domodrdn(
 {
        int rc, code, id;
        char *matcheddn=NULL, *text=NULL, **refs=NULL;
+       LDAPControl **ctrls = NULL;
        LDAPMessage *res;
 
     if ( verbose ) {
@@ -284,7 +285,7 @@ static int domodrdn(
                }
        }
 
-       rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, NULL, 1 );
+       rc = ldap_parse_result( ld, res, &code, &matcheddn, &text, &refs, &ctrls, 1 );
 
        if( rc != LDAP_SUCCESS ) {
                fprintf( stderr, "%s: ldap_parse_result: %s (%d)\n",
@@ -314,6 +315,11 @@ static int domodrdn(
                }
        }
 
+       if (ctrls) {
+               tool_print_ctrls( ld, ctrls );
+               ldap_controls_free( ctrls );
+    }
+
        ber_memfree( text );
        ber_memfree( matcheddn );
        ber_memvfree( (void **) refs );