]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/search.c
moved rdn parsing in a dedicated routine, ldap_str2rdn(), that can be used directly...
[openldap] / libraries / libldap / search.c
index 5adb5b8ed2d7aa976264eb91664b6c5df1d1f745..50f50067ff92dfe2d6d32fcd46f9226367758429 100644 (file)
@@ -297,11 +297,28 @@ ldap_build_search_req(
                }
        }
 
-       err = ber_printf( ber, "{it{seeiib", ++ld->ld_msgid,
+#ifdef LDAP_CONNECTIONLESS
+       if ( LDAP_IS_UDP(ld) ) {
+           err = ber_write( ber, ld->ld_options.ldo_peer,
+                   sizeof(struct sockaddr), 0);
+       }
+       if ( LDAP_IS_UDP(ld) && ld->ld_options.ldo_version == LDAP_VERSION2) {
+           char *dn = ld->ld_options.ldo_cldapdn;
+           if (!dn) dn = "";
+           err = ber_printf( ber, "{ist{seeiib", ++ld->ld_msgid, dn,
+               LDAP_REQ_SEARCH, base, (ber_int_t) scope, ld->ld_deref,
+               (sizelimit < 0) ? ld->ld_sizelimit : sizelimit,
+               (timelimit < 0) ? ld->ld_timelimit : timelimit,
+               attrsonly );
+       } else
+#endif
+       {
+           err = ber_printf( ber, "{it{seeiib", ++ld->ld_msgid,
                LDAP_REQ_SEARCH, base, (ber_int_t) scope, ld->ld_deref,
                (sizelimit < 0) ? ld->ld_sizelimit : sizelimit,
                (timelimit < 0) ? ld->ld_timelimit : timelimit,
                attrsonly );
+       }
 
        if ( err == -1 ) {
                ld->ld_errno = LDAP_ENCODING_ERROR;