r26355: Eliminate global_loadparm in more places.
[ambi/samba-autobuild/.git] / source4 / lib / ldb / ldb_ildap / ldb_ildap.c
index f9d229b9f2f79f567b401c6c569372a6276f5d15..a834e912d44a2c4078d00315ba427934a9aaaafa 100644 (file)
@@ -19,8 +19,7 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
 */
 
 /*
@@ -50,6 +49,7 @@
 #include "libcli/ldap/ldap_client.h"
 #include "auth/auth.h"
 #include "auth/credentials/credentials.h"
+#include "param/param.h"
 
 struct ildb_private {
        struct ldap_connection *ldap;
@@ -647,7 +647,7 @@ static int ildb_rename(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_INVALID_DN_SYNTAX;
        }
 
-       msg->r.ModifyDNRequest.deleteolddn = True;
+       msg->r.ModifyDNRequest.deleteolddn = true;
 
        return ildb_request_send(ildb, msg, req);
 }
@@ -756,7 +756,8 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
        }
        module->private_data    = ildb;
        ildb->module            = module;
-       ildb->ldap = ldap4_new_connection(ildb, ldb_get_opaque(ldb, "EventContext"));
+       ildb->ldap = ldap4_new_connection(ildb, ldb_get_opaque(ldb, "loadparm"), 
+                                         ldb_get_opaque(ldb, "EventContext"));
        if (!ildb->ldap) {
                ldb_oom(ldb);
                goto failed;
@@ -793,7 +794,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
                                goto failed;
                        }
                } else {
-                       status = ldap_bind_sasl(ildb->ldap, creds);
+                       status = ldap_bind_sasl(ildb->ldap, creds, ldb_get_opaque(ldb, "loadparm"));
                        if (!NT_STATUS_IS_OK(status)) {
                                ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n",
                                          ldap_errstr(ildb->ldap, module, status));