]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/search.c
Apply ITS#12 fix from devel.
[openldap] / servers / slapd / search.c
index fc96d2fd021727bd9f14c04445f3ace096defa32..013075fdb183462f87e04d2e54ac2e7ed9179343 100644 (file)
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include "slap.h"
-#include "ldapconfig.h"
 
-extern int     get_filter();
-extern Backend *select_backend();
+#include <ac/string.h>
+#include <ac/socket.h>
+
+#include "ldapconfig.h"
+#include "slap.h"
 
-extern char    *default_referral;
 
 void
-do_search( conn, op )
-    Connection *conn;  /* where to send results                       */
-    Operation  *op;    /* info about the op to which we're responding */
+do_search(
+    Connection *conn,  /* where to send results                       */
+    Operation  *op     /* info about the op to which we're responding */
+)
 {
        int             i, err;
        int             scope, deref, attrsonly;
@@ -161,6 +161,9 @@ do_search( conn, op )
                return;
        }
 
+        /* translate the base if it matches an aliased base part */
+        base = suffixAlias ( base, op, be );
+
        /* actually do the search and send the result(s) */
        if ( be->be_search != NULL ) {
                (*be->be_search)( be, conn, op, base, scope, deref, sizelimit,