Add fetch function for GPO which fetches all relevant files from the sysvol share.
[metze/samba/wip.git] / source4 / lib / policy / gp_ldap.c
index f8806e964300855162b2f011f78c02371464bc48..a7d5eb6158f03185c7ec63e880c49018ada133fe 100644 (file)
@@ -160,14 +160,16 @@ NTSTATUS gp_init(TALLOC_CTX *mem_ctx,
                return NT_STATUS_UNSUCCESSFUL;
        }
 
-       /* We don't need to keep the libnet context */
-       talloc_free(net_ctx);
 
        *gp_ctx = talloc_zero(mem_ctx, struct gp_context);
        (*gp_ctx)->lp_ctx = lp_ctx;
        (*gp_ctx)->credentials = credentials;
        (*gp_ctx)->ev_ctx = ev_ctx;
        (*gp_ctx)->ldb_ctx = ldb_ctx;
+       (*gp_ctx)->active_dc = io->out.dcs[0];
+
+       /* We don't need to keep the libnet context */
+       talloc_free(net_ctx);
        return NT_STATUS_OK;
 }