#include "dns_server/dnsserver_common.h"
#include "dnsserver.h"
-#define DCESRV_INTERFACE_DNSSERVER_BIND(call, iface) \
- dcesrv_interface_dnsserver_bind(call, iface)
-static NTSTATUS dcesrv_interface_dnsserver_bind(struct dcesrv_call_state *dce_call,
+#define DCESRV_INTERFACE_DNSSERVER_BIND(context, iface) \
+ dcesrv_interface_dnsserver_bind(context, iface)
+static NTSTATUS dcesrv_interface_dnsserver_bind(struct dcesrv_connection_context *context,
const struct dcesrv_interface *iface)
{
- return dcesrv_interface_bind_require_integrity(dce_call, iface);
+ return dcesrv_interface_bind_require_integrity(context, iface);
}
+#define DNSSERVER_STATE_MAGIC 0xc9657ab4
struct dnsserver_state {
struct loadparm_context *lp_ctx;
struct ldb_context *samdb;
static struct dnsserver_state *dnsserver_connect(struct dcesrv_call_state *dce_call)
{
+ struct auth_session_info *session_info =
+ dcesrv_call_session_info(dce_call);
struct dnsserver_state *dsstate;
struct dnsserver_zone *zones, *z, *znext;
struct dnsserver_partition *partitions, *p;
+ NTSTATUS status;
- dsstate = talloc_get_type(dce_call->context->private_data, struct dnsserver_state);
+ dsstate = dcesrv_iface_state_find_conn(dce_call,
+ DNSSERVER_STATE_MAGIC,
+ struct dnsserver_state);
if (dsstate != NULL) {
return dsstate;
}
- dsstate = talloc_zero(dce_call->context, struct dnsserver_state);
+ dsstate = talloc_zero(dce_call, struct dnsserver_state);
if (dsstate == NULL) {
return NULL;
}
dsstate->samdb = samdb_connect(dsstate,
dce_call->event_ctx,
dsstate->lp_ctx,
- dce_call->conn->auth_state.session_info,
+ session_info,
dce_call->conn->remote_address,
0);
if (dsstate->samdb == NULL) {
}
}
- dce_call->context->private_data = dsstate;
+ status = dcesrv_iface_state_store_conn(dce_call,
+ DNSSERVER_STATE_MAGIC,
+ dsstate);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto failed;
+ }
return dsstate;