s4-libnet: added libnet_vampire_replicate_init()
authorAndrew Tridgell <tridge@samba.org>
Tue, 24 Aug 2010 05:40:42 +0000 (15:40 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 24 Aug 2010 22:40:04 +0000 (08:40 +1000)
this is used to setup for later calls to the replicate chunk functions

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/libnet/libnet_vampire.c

index 1847890f2f370df0c29f850e633fff4a36905c3a..955aa32318afe4832c24b85413461ceb0b8d2923 100644 (file)
@@ -92,6 +92,23 @@ struct libnet_vampire_cb_state {
        const char *server_dn_str;
 };
 
+/* initialise a state structure ready for replication of chunks */
+void *libnet_vampire_replicate_init(TALLOC_CTX *mem_ctx,
+                                   struct ldb_context *samdb,
+                                   struct loadparm_context *lp_ctx)
+{
+       struct libnet_vampire_cb_state *s = talloc_zero(mem_ctx, struct libnet_vampire_cb_state);
+       if (!s) {
+               return NULL;
+       }
+
+       s->ldb              = samdb;
+       s->lp_ctx           = lp_ctx;
+       s->provision_schema = dsdb_get_schema(s->ldb, s);
+
+       return s;
+}
+
 /* Caller is expected to keep supplied pointers around for the lifetime of the structure */
 void *libnet_vampire_cb_state_init(TALLOC_CTX *mem_ctx,
                                   struct loadparm_context *lp_ctx, struct tevent_context *event_ctx,