#include "includes.h"
#include "torture/smbtorture.h"
+#include "system/network.h"
#include "dns_server/dlz_minimal.h"
#include <talloc.h>
#include <ldb.h>
static bool calls_zone_hook = false;
static isc_result_t dlz_bind9_writeable_zone_hook(dns_view_t *view,
- const char *zone_name)
+ dns_dlzdb_t *dlzdb,
+ const char *zone_name)
{
struct torture_context *tctx = talloc_get_type((void *)view, struct torture_context);
struct ldb_context *samdb = NULL;
static bool test_dlz_bind9_configure(struct torture_context *tctx)
{
- void *dbdata;
+ void *dbdata = NULL;
+ dns_dlzdb_t *dlzdb = NULL;
const char *argv[] = {
"samba_dlz",
"-H",
"Failed to create samba_dlz");
calls_zone_hook = false;
- torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dbdata),
+ torture_assert_int_equal(tctx, dlz_configure((void*)tctx,
+ dlzdb,
+ dbdata),
ISC_R_SUCCESS,
"Failed to configure samba_dlz");
void **dbdata, int count)
{
int i, res;
+ dns_dlzdb_t *dlzdb = NULL;
const char *argv[] = {
"samba_dlz",
"-H",
torture_assert_int_equal(tctx, res, ISC_R_SUCCESS,
"Failed to create samba_dlz");
- res = dlz_configure((void*)tctx, dbdata[i]);
+ res = dlz_configure((void*)tctx, dlzdb, dbdata[i]);
torture_assert_int_equal(tctx, res, ISC_R_SUCCESS,
"Failed to configure samba_dlz");
}
static bool test_dlz_bind9_gensec(struct torture_context *tctx, const char *mech)
{
NTSTATUS status;
+ dns_dlzdb_t *dlzdb = NULL;
struct gensec_security *gensec_client_context;
ISC_R_SUCCESS,
"Failed to create samba_dlz");
- torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dbdata),
+ torture_assert_int_equal(tctx, dlz_configure((void*)tctx,
+ dlzdb, dbdata),
ISC_R_SUCCESS,
"Failed to configure samba_dlz");
static bool test_dlz_bind9_lookup(struct torture_context *tctx)
{
size_t i;
- void *dbdata;
+ void *dbdata = NULL;
+ dns_clientinfomethods_t *methods = NULL;
+ dns_clientinfo_t *clientinfo = NULL;
+ dns_dlzdb_t *dlzdb = NULL;
const char *argv[] = {
"samba_dlz",
"-H",
ISC_R_SUCCESS,
"Failed to create samba_dlz");
- torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dbdata),
- ISC_R_SUCCESS,
+ torture_assert_int_equal(tctx,
+ dlz_configure((void*)tctx, dlzdb, dbdata),
+ ISC_R_SUCCESS,
"Failed to configure samba_dlz");
expected1 = talloc_zero(tctx, struct test_expected_rr);
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Failed to lookup @");
for (i = 0; i < expected1->num_records; i++) {
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected2->query_name, dbdata,
- (dns_sdlzlookup_t *)expected2),
+ (dns_sdlzlookup_t *)expected2,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Failed to lookup hostname");
for (i = 0; i < expected2->num_records; i++) {
static bool test_dlz_bind9_zonedump(struct torture_context *tctx)
{
size_t i;
- void *dbdata;
+ void *dbdata = NULL;
+ dns_dlzdb_t *dlzdb = NULL;
const char *argv[] = {
"samba_dlz",
"-H",
ISC_R_SUCCESS,
"Failed to create samba_dlz");
- torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dbdata),
+ torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dlzdb, dbdata),
ISC_R_SUCCESS,
"Failed to configure samba_dlz");
NTSTATUS status;
struct gensec_security *gensec_client_context;
DATA_BLOB client_to_server, server_to_client;
- void *dbdata;
+ void *dbdata = NULL;
+ dns_dlzdb_t *dlzdb = NULL;
void *version = NULL;
const char *argv[] = {
"samba_dlz",
char *data1 = NULL;
char *data2 = NULL;
bool ret = false;
+ dns_clientinfomethods_t *methods = NULL;
+ dns_clientinfo_t *clientinfo = NULL;
tctx_static = tctx;
torture_assert_int_equal(tctx, dlz_create("samba_dlz", 3, argv, &dbdata,
ISC_R_SUCCESS,
"Failed to create samba_dlz");
- torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dbdata),
+ torture_assert_int_equal(tctx, dlz_configure((void*)tctx, dlzdb, dbdata),
ISC_R_SUCCESS,
"Failed to configure samba_dlz");
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_NOTFOUND,
"Found hostname");
torture_assert_int_equal(tctx, expected1->num_rr, 0,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Not found hostname");
torture_assert(tctx, expected1->records[0].printed,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Not found hostname");
torture_assert(tctx, expected1->records[0].printed,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Not found hostname");
torture_assert(tctx, expected1->records[0].printed,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Not found hostname");
torture_assert(tctx, expected1->records[1].printed,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_NOTFOUND,
"Found hostname");
torture_assert_int_equal(tctx, expected1->num_rr, 0,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Not found hostname");
torture_assert(tctx, expected1->records[0].printed,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Not found hostname");
torture_assert(tctx, expected1->records[0].printed,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Not found hostname");
torture_assert(tctx, expected1->records[0].printed,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_SUCCESS,
"Not found hostname");
torture_assert(tctx, expected1->records[0].printed,
expected1->records[1].printed = false;
torture_assert_int_equal(tctx, dlz_lookup(lpcfg_dnsdomain(tctx->lp_ctx),
expected1->query_name, dbdata,
- (dns_sdlzlookup_t *)expected1),
+ (dns_sdlzlookup_t *)expected1,
+ methods, clientinfo),
ISC_R_NOTFOUND,
"Found hostname");
torture_assert_int_equal(tctx, expected1->num_rr, 0,