1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

s4-dns: support Samba command line options to the dlz_bind.so module

this allows setting of Samba command line options in named.conf
This commit is contained in:
Andrew Tridgell 2010-12-06 16:57:12 +11:00
parent c60ce7503c
commit 49e0aef3cb
2 changed files with 36 additions and 1 deletions

View File

@ -26,6 +26,7 @@
#include "dsdb/common/util.h"
#include "auth/session.h"
#include "gen_ndr/ndr_dnsp.h"
#include "lib/cmdline/popt_common.h"
#include "dlz_bind9.h"
struct dlz_bind9_data {
@ -221,6 +222,35 @@ static isc_result_t b9_putnamedrr(struct dlz_bind9_data *state,
}
/*
parse options
*/
static isc_result_t parse_options(struct dlz_bind9_data *state,
unsigned int argc, char *argv[])
{
int opt;
poptContext pc;
struct poptOption long_options[] = {
POPT_COMMON_SAMBA
{ NULL }
};
pc = poptGetContext("dlz_bind9", argc, (const char **)argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
while ((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
default:
state->log(ISC_LOG_ERROR, "Invalid option %s: %s",
poptBadOption(pc, 0), poptStrerror(opt));
return ISC_R_FAILURE;
}
}
return ISC_R_SUCCESS;
}
/*
called to initialise the driver
*/
@ -251,6 +281,11 @@ _PUBLIC_ isc_result_t dlz_create(const char *dlzname,
}
va_end(ap);
result = parse_options(state, argc, argv);
if (result != ISC_R_SUCCESS) {
goto failed;
}
state->lp = loadparm_init_global(true);
if (state->lp == NULL) {
result = ISC_R_NOMEMORY;

View File

@ -14,4 +14,4 @@ bld.SAMBA_LIBRARY('dlz_bind9',
source='dlz_bind9.c',
private_library=True,
link_name='modules/bind9/dlz_bind9.so',
deps='samba-hostconfig ldbsamba samba-util')
deps='samba-hostconfig ldbsamba samba-util popt POPT_SAMBA')