*/
#include "includes.h"
-#include "libcli/ldap/ldap.h"
+#include "libcli/ldap/libcli_ldap.h"
#include "libcli/ldap/ldap_client.h"
msg->r.SearchRequest.attributesonly = attributesonly;
msg->r.SearchRequest.tree = tree;
msg->r.SearchRequest.num_attributes = n;
- msg->r.SearchRequest.attributes = discard_const(attrs);
+ msg->r.SearchRequest.attributes = attrs;
msg->controls = control_req;
req = ldap_request_send(conn, msg);
- talloc_steal(msg, req);
+ talloc_reparent(conn, msg, req);
for (i=n=0;true;i++) {
struct ldap_message *res;
struct ldb_control ***control_res,
struct ldap_message ***results)
{
- struct ldb_parse_tree *tree = ldb_parse_tree(conn, expression);
NTSTATUS status;
+ struct ldb_parse_tree *tree = ldb_parse_tree(conn, expression);
+
+ if (tree == NULL) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
status = ildap_search_bytree(conn, basedn, scope, tree, attrs,
attributesonly, control_req,
control_res, results);