s3-passdb: Connect to specified samdb if location is provided, otherwise use default
authorAmitay Isaacs <amitay@gmail.com>
Fri, 12 Aug 2011 05:45:43 +0000 (15:45 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 13 Aug 2011 02:30:50 +0000 (12:30 +1000)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source3/passdb/pdb_samba4.c

index ed27501b4d05f2f44aec95019bfc2f4f6e0e426e..ae38133e2026bb8f99bb4eeb17b7ccb32724dc78 100644 (file)
@@ -2213,10 +2213,18 @@ static NTSTATUS pdb_init_samba4(struct pdb_methods **pdb_method,
                goto nomem;
        }
 
-       state->ldb = samdb_connect(state,
+       if (location) {
+               state->ldb = samdb_connect_url(state,
+                                  state->ev,
+                                  state->lp_ctx,
+                                  system_session(state->lp_ctx),
+                                  0, location);
+       } else {
+               state->ldb = samdb_connect(state,
                                   state->ev,
                                   state->lp_ctx,
                                   system_session(state->lp_ctx), 0);
+       }
 
        if (!state->ldb) {
                DEBUG(0, ("samdb_connect failed\n"));