]> git.sur5r.net Git - openldap/commitdiff
ITS#6651
authorQuanah Gibson-Mount <quanah@openldap.org>
Tue, 4 Jan 2011 16:01:55 +0000 (16:01 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 4 Jan 2011 16:01:55 +0000 (16:01 +0000)
CHANGES
clients/tools/ldapsearch.c

diff --git a/CHANGES b/CHANGES
index e224f5b1a43743cf4744719c3749171a5c506eff..e37d06fdea3e797754355292766c6489acd4024a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -17,6 +17,7 @@ OpenLDAP 2.4.24 Engineering
        Fixed libldap url parsing with NULL host (ITS#6653)
        Fixed liblutil getpass prompts (ITS#6702)
        Fixed ldapsearch segfault with deref (ITS#6638)
        Fixed libldap url parsing with NULL host (ITS#6653)
        Fixed liblutil getpass prompts (ITS#6702)
        Fixed ldapsearch segfault with deref (ITS#6638)
+       Fixed ldapsearch multiple controls parsing (ITS#6651)
        Fixed slapd acl parsing overflow (ITS#6611)
        Fixed slapd support for BDB 5.0+ (ITS#6698)
        Fixed slapd config leak with olcDbDirectory (ITS#6634)
        Fixed slapd acl parsing overflow (ITS#6611)
        Fixed slapd support for BDB 5.0+ (ITS#6698)
        Fixed slapd config leak with olcDbDirectory (ITS#6634)
index eb64c37298f18281115a90341a971e17879c7d0c..e84a7741586c4fff2556510a408aa983aad5c76f 100644 (file)
@@ -139,7 +139,7 @@ usage( void )
 #ifdef LDAP_CONTROL_X_DEREF
        fprintf( stderr, _("             [!]deref=derefAttr:attr[,...][;derefAttr:attr[,...][;...]]\n"));
 #endif
 #ifdef LDAP_CONTROL_X_DEREF
        fprintf( stderr, _("             [!]deref=derefAttr:attr[,...][;derefAttr:attr[,...][;...]]\n"));
 #endif
-       fprintf( stderr, _("             [!]<oid>=:<value>           (generic control; no response handling)\n"));
+       fprintf( stderr, _("             [!]<oid>[=:<b64value>] (generic control; no response handling)\n"));
        fprintf( stderr, _("  -f file    read operations from `file'\n"));
        fprintf( stderr, _("  -F prefix  URL prefix for files (default: %s)\n"), def_urlpre);
        fprintf( stderr, _("  -l limit   time limit (in seconds, or \"none\" or \"max\") for search\n"));
        fprintf( stderr, _("  -f file    read operations from `file'\n"));
        fprintf( stderr, _("  -F prefix  URL prefix for files (default: %s)\n"), def_urlpre);
        fprintf( stderr, _("  -l limit   time limit (in seconds, or \"none\" or \"max\") for search\n"));
@@ -636,18 +636,20 @@ handle_private_option( int i )
                                c[ nctrls - 1 ].ldctl_value.bv_len = 0;
 
                        } else if ( cvalue[ 0 ] == ':' ) {
                                c[ nctrls - 1 ].ldctl_value.bv_len = 0;
 
                        } else if ( cvalue[ 0 ] == ':' ) {
-                               struct berval   type;
-                               struct berval   value;
-                               int             freeval;
+                               struct berval type;
+                               struct berval value;
+                               int freeval;
+                               char save_c;
 
                                cvalue++;
 
                                /* dummy type "x"
                                 * to use ldif_parse_line2() */
 
                                cvalue++;
 
                                /* dummy type "x"
                                 * to use ldif_parse_line2() */
+                               save_c = cvalue[ -2 ];
                                cvalue[ -2 ] = 'x';
                                ldif_parse_line2( &cvalue[ -2 ], &type,
                                        &value, &freeval );
                                cvalue[ -2 ] = 'x';
                                ldif_parse_line2( &cvalue[ -2 ], &type,
                                        &value, &freeval );
-                               cvalue[ -2 ] = '\0';
+                               cvalue[ -2 ] = save_c;
 
                                if ( freeval ) {
                                        c[ nctrls - 1 ].ldctl_value = value;
 
                                if ( freeval ) {
                                        c[ nctrls - 1 ].ldctl_value = value;
@@ -655,6 +657,11 @@ handle_private_option( int i )
                                } else {
                                        ber_dupbv( &c[ nctrls - 1 ].ldctl_value, &value );
                                }
                                } else {
                                        ber_dupbv( &c[ nctrls - 1 ].ldctl_value, &value );
                                }
+
+                       } else {
+                               fprintf( stderr, "unable to parse %s control value\n", control );
+                               exit( EXIT_FAILURE );
+                               
                        }
 
                        /* criticality */
                        }
 
                        /* criticality */