diff options
Diffstat (limited to 'source4/nbt_server/wins')
-rw-r--r-- | source4/nbt_server/wins/wins_dns_proxy.c | 2 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsclient.c | 2 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsdb.c | 23 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsserver.c | 16 | ||||
-rw-r--r-- | source4/nbt_server/wins/winswack.c | 8 |
5 files changed, 21 insertions, 30 deletions
diff --git a/source4/nbt_server/wins/wins_dns_proxy.c b/source4/nbt_server/wins/wins_dns_proxy.c index 3322ad55fd..cd605907a8 100644 --- a/source4/nbt_server/wins/wins_dns_proxy.c +++ b/source4/nbt_server/wins/wins_dns_proxy.c @@ -68,7 +68,7 @@ void nbtd_wins_dns_proxy_query(struct nbt_name_socket *nbtsock, struct socket_address *src) { struct nbt_name *name = &packet->questions[0].name; - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_dns_proxy_state *s; struct composite_context *creq; diff --git a/source4/nbt_server/wins/winsclient.c b/source4/nbt_server/wins/winsclient.c index 1d07f4a60a..133592f1fd 100644 --- a/source4/nbt_server/wins/winsclient.c +++ b/source4/nbt_server/wins/winsclient.c @@ -140,7 +140,7 @@ static void nbtd_wins_refresh(struct event_context *ev, struct timed_event *te, /* setup a wins name refresh request */ io.in.name = iname->name; - io.in.wins_servers = str_list_make(tmp_ctx, iname->wins_server, NULL); + io.in.wins_servers = (const char **)str_list_make(tmp_ctx, iname->wins_server, NULL); io.in.wins_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx); io.in.addresses = nbtd_address_list(iface, tmp_ctx); io.in.nb_flags = iname->nb_flags; diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index c84b01f2b2..283cd1219a 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -45,10 +45,8 @@ uint64_t winsdb_get_maxVersion(struct winsdb_handle *h) if (!dn) goto failed; /* find the record in the WINS database */ - ret = ldb_search(ldb, dn, LDB_SCOPE_BASE, - NULL, NULL, &res); + ret = ldb_search(ldb, tmp_ctx, &res, dn, LDB_SCOPE_BASE, NULL, NULL); if (ret != LDB_SUCCESS) goto failed; - talloc_steal(tmp_ctx, res); if (res->count > 1) goto failed; if (res->count == 1) { @@ -82,14 +80,10 @@ uint64_t winsdb_set_maxVersion(struct winsdb_handle *h, uint64_t newMaxVersion) if (!dn) goto failed; /* find the record in the WINS database */ - ret = ldb_search(wins_db, dn, LDB_SCOPE_BASE, NULL, NULL, &res); - + ret = ldb_search(wins_db, tmp_ctx, &res, dn, LDB_SCOPE_BASE, NULL, NULL); if (ret != LDB_SUCCESS) goto failed; - talloc_steal(tmp_ctx, res); if (res->count > 1) goto failed; - talloc_steal(tmp_ctx, res); - if (res->count == 1) { oldMaxVersion = ldb_msg_find_attr_as_uint64(res->msgs[0], "maxVersion", 0); } @@ -143,10 +137,8 @@ uint64_t winsdb_get_seqnumber(struct winsdb_handle *h) if (!dn) goto failed; /* find the record in the WINS database */ - ret = ldb_search(ldb, dn, LDB_SCOPE_BASE, - NULL, NULL, &res); + ret = ldb_search(ldb, tmp_ctx, &res, dn, LDB_SCOPE_BASE, NULL, NULL); if (ret != LDB_SUCCESS) goto failed; - talloc_steal(tmp_ctx, res); if (res->count > 1) goto failed; if (res->count == 1) { @@ -589,10 +581,10 @@ NTSTATUS winsdb_lookup(struct winsdb_handle *h, time_t now = time(NULL); /* find the record in the WINS database */ - ret = ldb_search(wins_db, winsdb_dn(tmp_ctx, wins_db, name), LDB_SCOPE_BASE, - NULL, NULL, &res); + ret = ldb_search(wins_db, tmp_ctx, &res, + winsdb_dn(tmp_ctx, wins_db, name), + LDB_SCOPE_BASE, NULL, NULL); - talloc_steal(tmp_ctx, res); if (ret != LDB_SUCCESS || res->count > 1) { status = NT_STATUS_INTERNAL_DB_CORRUPTION; goto failed; @@ -964,9 +956,8 @@ static bool winsdb_check_or_add_module_list(struct event_context *ev_ctx, if (!dn) goto failed; /* find the record in the WINS database */ - ret = ldb_search(h->ldb, dn, LDB_SCOPE_BASE, NULL, NULL, &res); + ret = ldb_search(h->ldb, tmp_ctx, &res, dn, LDB_SCOPE_BASE, NULL, NULL); if (ret != LDB_SUCCESS) goto failed; - talloc_steal(tmp_ctx, res); if (res->count > 0) goto skip; diff --git a/source4/nbt_server/wins/winsserver.c b/source4/nbt_server/wins/winsserver.c index f8901ce09d..399530b4cf 100644 --- a/source4/nbt_server/wins/winsserver.c +++ b/source4/nbt_server/wins/winsserver.c @@ -68,7 +68,7 @@ static uint8_t wins_register_new(struct nbt_name_socket *nbtsock, const struct socket_address *src, enum wrepl_name_type type) { - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_server *winssrv = iface->nbtsrv->winssrv; struct nbt_name *name = &packet->questions[0].name; @@ -119,7 +119,7 @@ static uint8_t wins_update_ttl(struct nbt_name_socket *nbtsock, struct winsdb_addr *winsdb_addr, const struct socket_address *src) { - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_server *winssrv = iface->nbtsrv->winssrv; uint32_t ttl = wins_server_ttl(winssrv, packet->additional[0].ttl); @@ -158,7 +158,7 @@ static uint8_t wins_sgroup_merge(struct nbt_name_socket *nbtsock, const char *address, const struct socket_address *src) { - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_server *winssrv = iface->nbtsrv->winssrv; uint32_t ttl = wins_server_ttl(winssrv, packet->additional[0].ttl); @@ -357,7 +357,7 @@ static void wins_register_wack(struct nbt_name_socket *nbtsock, struct socket_address *src, enum wrepl_name_type new_type) { - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_server *winssrv = iface->nbtsrv->winssrv; struct wack_state *s; @@ -415,7 +415,7 @@ static void nbtd_winsserver_register(struct nbt_name_socket *nbtsock, struct socket_address *src) { NTSTATUS status; - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_server *winssrv = iface->nbtsrv->winssrv; struct nbt_name *name = &packet->questions[0].name; @@ -671,7 +671,7 @@ static void nbtd_winsserver_query(struct loadparm_context *lp_ctx, struct socket_address *src) { NTSTATUS status; - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_server *winssrv = iface->nbtsrv->winssrv; struct nbt_name *name = &packet->questions[0].name; @@ -813,7 +813,7 @@ static void nbtd_winsserver_release(struct nbt_name_socket *nbtsock, struct socket_address *src) { NTSTATUS status; - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_server *winssrv = iface->nbtsrv->winssrv; struct nbt_name *name = &packet->questions[0].name; @@ -928,7 +928,7 @@ void nbtd_winsserver_request(struct nbt_name_socket *nbtsock, struct nbt_name_packet *packet, struct socket_address *src) { - struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private, + struct nbtd_interface *iface = talloc_get_type(nbtsock->incoming.private_data, struct nbtd_interface); struct wins_server *winssrv = iface->nbtsrv->winssrv; if ((packet->operation & NBT_FLAG_BROADCAST) || winssrv == NULL) { diff --git a/source4/nbt_server/wins/winswack.c b/source4/nbt_server/wins/winswack.c index 43d2747ae7..7e0c73a810 100644 --- a/source4/nbt_server/wins/winswack.c +++ b/source4/nbt_server/wins/winswack.c @@ -37,7 +37,7 @@ struct wins_challenge_state { static void wins_challenge_handler(struct nbt_name_request *req) { - struct composite_context *ctx = talloc_get_type(req->async.private, struct composite_context); + struct composite_context *ctx = talloc_get_type(req->async.private_data, struct composite_context); struct wins_challenge_state *state = talloc_get_type(ctx->private_data, struct wins_challenge_state); ctx->status = nbt_name_query_recv(req, state, &state->query); @@ -123,7 +123,7 @@ struct composite_context *wins_challenge_send(TALLOC_CTX *mem_ctx, struct wins_c if (req == NULL) goto failed; req->async.fn = wins_challenge_handler; - req->async.private = result; + req->async.private_data = result; return result; failed: @@ -151,7 +151,7 @@ struct wins_release_demand_state { static void wins_release_demand_handler(struct nbt_name_request *req) { - struct composite_context *ctx = talloc_get_type(req->async.private, struct composite_context); + struct composite_context *ctx = talloc_get_type(req->async.private_data, struct composite_context); struct wins_release_demand_state *state = talloc_get_type(ctx->private_data, struct wins_release_demand_state); ctx->status = nbt_name_release_recv(req, state, &state->release); @@ -240,7 +240,7 @@ static struct composite_context *wins_release_demand_send(TALLOC_CTX *mem_ctx, s if (req == NULL) goto failed; req->async.fn = wins_release_demand_handler; - req->async.private = result; + req->async.private_data = result; return result; failed: |