+ switch( deref ) {
+ case LDAP_DEREF_NEVER:
+ case LDAP_DEREF_FINDING:
+ case LDAP_DEREF_SEARCHING:
+ case LDAP_DEREF_ALWAYS:
+ break;
+ default:
+ send_ldap_result( conn, op, rc = LDAP_PROTOCOL_ERROR,
+ NULL, "invalid deref", NULL, NULL );
+ goto return_results;
+ }
+
+ rc = dnPrettyNormal( NULL, &base, &pbase, &nbase );
+ if( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ERR,
+ "do_search: conn %d invalid dn (%s)\n",
+ conn->c_connid, base.bv_val, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "do_search: invalid dn (%s)\n", base.bv_val, 0, 0 );
+#endif
+ send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
+ "invalid DN", NULL, NULL );
+ goto return_results;
+ }
+
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, ARGS, "SRCH \"%s\" %d %d",
+ base.bv_val, scope, deref );
+ LDAP_LOG( OPERATION, ARGS, " %d %d %d\n",
+ sizelimit, timelimit, attrsonly);
+#else
+ Debug( LDAP_DEBUG_ARGS, "SRCH \"%s\" %d %d",
+ base.bv_val, scope, deref );
+ Debug( LDAP_DEBUG_ARGS, " %d %d %d\n",
+ sizelimit, timelimit, attrsonly);
+#endif