Changeset 745 for trunk/server/source4/cldap_server/rootdse.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/cldap_server/rootdse.c
r414 r745 22 22 #include "includes.h" 23 23 #include <tevent.h> 24 #include "libcli/ldap/ldap.h" 25 #include "lib/ldb/include/ldb.h" 26 #include "lib/ldb/include/ldb_errors.h" 24 #include <ldb.h> 25 #include <ldb_errors.h> 27 26 #include "smbd/service_task.h" 28 27 #include "cldap_server/cldap_server.h" … … 38 37 { 39 38 struct ldap_SearchResEntry *ent = NULL; 40 struct ldb_dn *basedn;41 39 struct ldb_result *res = NULL; 42 40 struct ldb_request *lreq; 43 enum ldb_scope scope = LDB_SCOPE_DEFAULT;44 41 const char **attrs = NULL; 45 42 const char *errstr = NULL; 46 int ret = 0; 47 int ldb_ret = -1; 48 49 basedn = ldb_dn_new(mem_ctx, cldapd->samctx, NULL); 50 if (basedn == NULL) goto nomem; 51 scope = LDB_SCOPE_BASE; 43 int ret = LDAP_SUCCESS, ldb_ret; 52 44 53 45 if (search->num_attributes >= 1) { … … 67 59 68 60 ldb_ret = ldb_build_search_req_ex(&lreq, cldapd->samctx, mem_ctx, 69 basedn, scope,61 NULL, LDB_SCOPE_BASE, 70 62 search->tree, attrs, 71 63 NULL, … … 108 100 } 109 101 ent->num_attributes = res->msgs[0]->num_elements; 110 ent->attributes = talloc_array(ent, struct ldb_message_element, ent->num_attributes); 102 ent->attributes = talloc_array(ent, struct ldb_message_element, 103 ent->num_attributes); 111 104 if (ent->attributes == NULL) goto nomem; 112 105 for (j=0; j < ent->num_attributes; j++) { 113 ent->attributes[j].name = talloc_steal(ent->attributes, res->msgs[0]->elements[j].name); 106 ent->attributes[j].name = talloc_steal(ent->attributes, 107 res->msgs[0]->elements[j].name); 114 108 ent->attributes[j].num_values = 0; 115 109 ent->attributes[j].values = NULL; … … 124 118 125 119 reply: 126 if (ret ) {120 if (ret != LDAP_SUCCESS) { 127 121 /* nothing ... */ 128 122 } else if (ldb_ret == LDB_SUCCESS) { … … 165 159 reply.result = &result; 166 160 167 cldapd_rootdse_fill(cldapd, tmp_ctx, search, &reply.response, reply.result); 161 cldapd_rootdse_fill(cldapd, tmp_ctx, search, &reply.response, 162 reply.result); 168 163 169 164 status = cldap_reply_send(cldap, &reply);
Note:
See TracChangeset
for help on using the changeset viewer.