ldb_set_opaque(proxy->upstream, "credentials", creds);
ret = ldb_connect(proxy->upstream, url, 0, NULL);
- if (ret != 0) {
+ if (ret != LDB_SUCCESS) {
ldb_debug(ldb, LDB_DEBUG_FATAL, "proxy failed to connect to %s\n", url);
goto failed;
}
#endif
newtree = proxy_convert_tree(ac, proxy, req->op.search.tree);
+ if (newtree == NULL) {
+ goto failed;
+ }
/* convert the basedn of this search */
base = ldb_dn_copy(ac, req->op.search.base);
}
}
-_PUBLIC_ const struct ldb_module_ops ldb_proxy_module_ops = {
+static const struct ldb_module_ops ldb_proxy_module_ops = {
.name = "proxy",
.request = proxy_request
};
+
+int ldb_proxy_module_init(const char *version)
+{
+ LDB_MODULE_CHECK_VERSION(version);
+ return ldb_register_module(&ldb_proxy_module_ops);
+}