mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling convention to use the lpcfg_ prefix. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
e4c35c5a09
commit
6b266b85cf
@ -450,27 +450,27 @@ bool torture_run_test(struct torture_context *context,
|
|||||||
int torture_setting_int(struct torture_context *test, const char *name,
|
int torture_setting_int(struct torture_context *test, const char *name,
|
||||||
int default_value)
|
int default_value)
|
||||||
{
|
{
|
||||||
return lp_parm_int(test->lp_ctx, NULL, "torture", name, default_value);
|
return lpcfg_parm_int(test->lp_ctx, NULL, "torture", name, default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long torture_setting_ulong(struct torture_context *test,
|
unsigned long torture_setting_ulong(struct torture_context *test,
|
||||||
const char *name,
|
const char *name,
|
||||||
unsigned long default_value)
|
unsigned long default_value)
|
||||||
{
|
{
|
||||||
return lp_parm_ulong(test->lp_ctx, NULL, "torture", name,
|
return lpcfg_parm_ulong(test->lp_ctx, NULL, "torture", name,
|
||||||
default_value);
|
default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
double torture_setting_double(struct torture_context *test, const char *name,
|
double torture_setting_double(struct torture_context *test, const char *name,
|
||||||
double default_value)
|
double default_value)
|
||||||
{
|
{
|
||||||
return lp_parm_double(test->lp_ctx, NULL, "torture", name, default_value);
|
return lpcfg_parm_double(test->lp_ctx, NULL, "torture", name, default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool torture_setting_bool(struct torture_context *test, const char *name,
|
bool torture_setting_bool(struct torture_context *test, const char *name,
|
||||||
bool default_value)
|
bool default_value)
|
||||||
{
|
{
|
||||||
return lp_parm_bool(test->lp_ctx, NULL, "torture", name, default_value);
|
return lpcfg_parm_bool(test->lp_ctx, NULL, "torture", name, default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *torture_setting_string(struct torture_context *test,
|
const char *torture_setting_string(struct torture_context *test,
|
||||||
@ -482,7 +482,7 @@ const char *torture_setting_string(struct torture_context *test,
|
|||||||
SMB_ASSERT(test != NULL);
|
SMB_ASSERT(test != NULL);
|
||||||
SMB_ASSERT(test->lp_ctx != NULL);
|
SMB_ASSERT(test->lp_ctx != NULL);
|
||||||
|
|
||||||
ret = lp_parm_string(test->lp_ctx, NULL, "torture", name);
|
ret = lpcfg_parm_string(test->lp_ctx, NULL, "torture", name);
|
||||||
|
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
return default_value;
|
return default_value;
|
||||||
|
@ -35,7 +35,7 @@ static bool iconv_untestable(struct torture_context *tctx)
|
|||||||
{
|
{
|
||||||
iconv_t cd;
|
iconv_t cd;
|
||||||
|
|
||||||
if (!lp_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true))
|
if (!lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true))
|
||||||
torture_skip(tctx, "system iconv disabled - skipping test");
|
torture_skip(tctx, "system iconv disabled - skipping test");
|
||||||
|
|
||||||
cd = iconv_open("UTF-16LE", "UCS-4LE");
|
cd = iconv_open("UTF-16LE", "UCS-4LE");
|
||||||
@ -158,8 +158,8 @@ static bool test_buffer(struct torture_context *test,
|
|||||||
"failed to open %s to UTF-16LE",
|
"failed to open %s to UTF-16LE",
|
||||||
charset));
|
charset));
|
||||||
}
|
}
|
||||||
cd2 = smb_iconv_open_ex(test, charset, "UTF-16LE", lp_parm_bool(test->lp_ctx, NULL, "iconv", "native", true));
|
cd2 = smb_iconv_open_ex(test, charset, "UTF-16LE", lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "native", true));
|
||||||
cd3 = smb_iconv_open_ex(test, "UTF-16LE", charset, lp_parm_bool(test->lp_ctx, NULL, "iconv", "native", true));
|
cd3 = smb_iconv_open_ex(test, "UTF-16LE", charset, lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "native", true));
|
||||||
last_charset = charset;
|
last_charset = charset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,7 +289,7 @@ static bool test_codepoint(struct torture_context *tctx, unsigned int codepoint)
|
|||||||
size_t size, size2;
|
size_t size, size2;
|
||||||
codepoint_t c;
|
codepoint_t c;
|
||||||
|
|
||||||
size = push_codepoint_convenience(lp_iconv_convenience(tctx->lp_ctx), (char *)buf, codepoint);
|
size = push_codepoint_convenience(lpcfg_iconv_convenience(tctx->lp_ctx), (char *)buf, codepoint);
|
||||||
torture_assert(tctx, size != -1 || (codepoint >= 0xd800 && codepoint <= 0x10000),
|
torture_assert(tctx, size != -1 || (codepoint >= 0xd800 && codepoint <= 0x10000),
|
||||||
"Invalid Codepoint range");
|
"Invalid Codepoint range");
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ static bool test_codepoint(struct torture_context *tctx, unsigned int codepoint)
|
|||||||
buf[size+2] = random();
|
buf[size+2] = random();
|
||||||
buf[size+3] = random();
|
buf[size+3] = random();
|
||||||
|
|
||||||
c = next_codepoint_convenience(lp_iconv_convenience(tctx->lp_ctx), (char *)buf, &size2);
|
c = next_codepoint_convenience(lpcfg_iconv_convenience(tctx->lp_ctx), (char *)buf, &size2);
|
||||||
|
|
||||||
torture_assert(tctx, c == codepoint,
|
torture_assert(tctx, c == codepoint,
|
||||||
talloc_asprintf(tctx,
|
talloc_asprintf(tctx,
|
||||||
|
@ -376,8 +376,8 @@ static bool test_list_unique_2(struct torture_context *tctx)
|
|||||||
const char **list = (const char **)str_list_make_empty(tctx);
|
const char **list = (const char **)str_list_make_empty(tctx);
|
||||||
const char **list_dup = (const char **)str_list_make_empty(tctx);
|
const char **list_dup = (const char **)str_list_make_empty(tctx);
|
||||||
|
|
||||||
count = lp_parm_int(tctx->lp_ctx, NULL, "list_unique", "count", 9);
|
count = lpcfg_parm_int(tctx->lp_ctx, NULL, "list_unique", "count", 9);
|
||||||
num_dups = lp_parm_int(tctx->lp_ctx, NULL, "list_unique", "dups", 7);
|
num_dups = lpcfg_parm_int(tctx->lp_ctx, NULL, "list_unique", "dups", 7);
|
||||||
torture_comment(tctx, "test_list_unique_2() with %d elements and %d dups\n", count, num_dups);
|
torture_comment(tctx, "test_list_unique_2() with %d elements and %d dups\n", count, num_dups);
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
|
@ -357,14 +357,14 @@ int main(int argc, const char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
load_interfaces(NULL, lp_interfaces(cmdline_lp_ctx), &ifaces);
|
load_interfaces(NULL, lpcfg_interfaces(cmdline_lp_ctx), &ifaces);
|
||||||
|
|
||||||
ev = s4_event_context_init(talloc_autofree_context());
|
ev = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
while (poptPeekArg(pc)) {
|
while (poptPeekArg(pc)) {
|
||||||
const char *name = poptGetArg(pc);
|
const char *name = poptGetArg(pc);
|
||||||
|
|
||||||
ret &= process_one(cmdline_lp_ctx, ev, ifaces, name, lp_nbt_port(cmdline_lp_ctx));
|
ret &= process_one(cmdline_lp_ctx, ev, ifaces, name, lpcfg_nbt_port(cmdline_lp_ctx));
|
||||||
}
|
}
|
||||||
|
|
||||||
talloc_free(ev);
|
talloc_free(ev);
|
||||||
|
@ -611,7 +611,7 @@ static bool test_wbc_change_password(struct torture_context *tctx)
|
|||||||
E_md4hash(oldpass, old_nt_hash);
|
E_md4hash(oldpass, old_nt_hash);
|
||||||
E_md4hash(newpass, new_nt_hash);
|
E_md4hash(newpass, new_nt_hash);
|
||||||
|
|
||||||
if (lp_client_lanman_auth(tctx->lp_ctx) &&
|
if (lpcfg_client_lanman_auth(tctx->lp_ctx) &&
|
||||||
E_deshash(newpass, new_lanman_hash) &&
|
E_deshash(newpass, new_lanman_hash) &&
|
||||||
E_deshash(oldpass, old_lanman_hash)) {
|
E_deshash(oldpass, old_lanman_hash)) {
|
||||||
|
|
||||||
|
@ -669,9 +669,9 @@ _PUBLIC_ void cli_credentials_set_conf(struct cli_credentials *cred,
|
|||||||
struct loadparm_context *lp_ctx)
|
struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
cli_credentials_set_username(cred, "", CRED_UNINITIALISED);
|
cli_credentials_set_username(cred, "", CRED_UNINITIALISED);
|
||||||
cli_credentials_set_domain(cred, lp_workgroup(lp_ctx), CRED_UNINITIALISED);
|
cli_credentials_set_domain(cred, lpcfg_workgroup(lp_ctx), CRED_UNINITIALISED);
|
||||||
cli_credentials_set_workstation(cred, lp_netbios_name(lp_ctx), CRED_UNINITIALISED);
|
cli_credentials_set_workstation(cred, lpcfg_netbios_name(lp_ctx), CRED_UNINITIALISED);
|
||||||
cli_credentials_set_realm(cred, lp_realm(lp_ctx), CRED_UNINITIALISED);
|
cli_credentials_set_realm(cred, lpcfg_realm(lp_ctx), CRED_UNINITIALISED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -204,7 +204,7 @@ static PyObject *py_creds_guess(py_talloc_Object *self, PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
|
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
||||||
if (lp_ctx == NULL)
|
if (lp_ctx == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ static PyObject *py_creds_set_machine_account(py_talloc_Object *self, PyObject *
|
|||||||
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
|
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
||||||
if (lp_ctx == NULL)
|
if (lp_ctx == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *arg
|
|||||||
if (!PyArg_ParseTuple(args, "|Os", &py_lp_ctx, &ccache_name))
|
if (!PyArg_ParseTuple(args, "|Os", &py_lp_ctx, &ccache_name))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
||||||
if (lp_ctx == NULL)
|
if (lp_ctx == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ _PUBLIC_ struct gensec_security_ops **gensec_security_all(void)
|
|||||||
|
|
||||||
bool gensec_security_ops_enabled(struct gensec_security_ops *ops, struct gensec_security *security)
|
bool gensec_security_ops_enabled(struct gensec_security_ops *ops, struct gensec_security *security)
|
||||||
{
|
{
|
||||||
return lp_parm_bool(security->settings->lp_ctx, NULL, "gensec", ops->name, ops->enabled);
|
return lpcfg_parm_bool(security->settings->lp_ctx, NULL, "gensec", ops->name, ops->enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sometimes we want to force only kerberos, sometimes we want to
|
/* Sometimes we want to force only kerberos, sometimes we want to
|
||||||
@ -1397,12 +1397,12 @@ static int sort_gensec(struct gensec_security_ops **gs1, struct gensec_security_
|
|||||||
|
|
||||||
int gensec_setting_int(struct gensec_settings *settings, const char *mechanism, const char *name, int default_value)
|
int gensec_setting_int(struct gensec_settings *settings, const char *mechanism, const char *name, int default_value)
|
||||||
{
|
{
|
||||||
return lp_parm_int(settings->lp_ctx, NULL, mechanism, name, default_value);
|
return lpcfg_parm_int(settings->lp_ctx, NULL, mechanism, name, default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gensec_setting_bool(struct gensec_settings *settings, const char *mechanism, const char *name, bool default_value)
|
bool gensec_setting_bool(struct gensec_settings *settings, const char *mechanism, const char *name, bool default_value)
|
||||||
{
|
{
|
||||||
return lp_parm_bool(settings->lp_ctx, NULL, mechanism, name, default_value);
|
return lpcfg_parm_bool(settings->lp_ctx, NULL, mechanism, name, default_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -247,7 +247,7 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security)
|
|||||||
return NT_STATUS_INTERNAL_ERROR;
|
return NT_STATUS_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
realm = lp_realm(gensec_security->settings->lp_ctx);
|
realm = lpcfg_realm(gensec_security->settings->lp_ctx);
|
||||||
if (realm != NULL) {
|
if (realm != NULL) {
|
||||||
ret = gsskrb5_set_default_realm(realm);
|
ret = gsskrb5_set_default_realm(realm);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@ -352,12 +352,12 @@ static NTSTATUS gensec_gssapi_client_start(struct gensec_security *gensec_securi
|
|||||||
gensec_gssapi_state = talloc_get_type(gensec_security->private_data, struct gensec_gssapi_state);
|
gensec_gssapi_state = talloc_get_type(gensec_security->private_data, struct gensec_gssapi_state);
|
||||||
|
|
||||||
principal = gensec_get_target_principal(gensec_security);
|
principal = gensec_get_target_principal(gensec_security);
|
||||||
if (principal && lp_client_use_spnego_principal(gensec_security->settings->lp_ctx)) {
|
if (principal && lpcfg_client_use_spnego_principal(gensec_security->settings->lp_ctx)) {
|
||||||
name_type = GSS_C_NULL_OID;
|
name_type = GSS_C_NULL_OID;
|
||||||
} else {
|
} else {
|
||||||
principal = talloc_asprintf(gensec_gssapi_state, "%s/%s@%s",
|
principal = talloc_asprintf(gensec_gssapi_state, "%s/%s@%s",
|
||||||
gensec_get_target_service(gensec_security),
|
gensec_get_target_service(gensec_security),
|
||||||
hostname, lp_realm(gensec_security->settings->lp_ctx));
|
hostname, lpcfg_realm(gensec_security->settings->lp_ctx));
|
||||||
|
|
||||||
name_type = GSS_C_NT_USER_NAME;
|
name_type = GSS_C_NT_USER_NAME;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ static struct gensec_settings *settings_from_object(TALLOC_CTX *mem_ctx, PyObjec
|
|||||||
}
|
}
|
||||||
|
|
||||||
s->target_hostname = PyString_AsString(py_hostname);
|
s->target_hostname = PyString_AsString(py_hostname);
|
||||||
s->lp_ctx = lp_from_py_object(s, py_lp_ctx);
|
s->lp_ctx = lpcfg_from_py_object(s, py_lp_ctx);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,15 +126,15 @@ static NTSTATUS schannel_update(struct gensec_security *gensec_security, TALLOC_
|
|||||||
workstation = bind_schannel.oem_netbios_computer.a;
|
workstation = bind_schannel.oem_netbios_computer.a;
|
||||||
domain = bind_schannel.oem_netbios_domain.a;
|
domain = bind_schannel.oem_netbios_domain.a;
|
||||||
|
|
||||||
if (strcasecmp_m(domain, lp_workgroup(gensec_security->settings->lp_ctx)) != 0) {
|
if (strcasecmp_m(domain, lpcfg_workgroup(gensec_security->settings->lp_ctx)) != 0) {
|
||||||
DEBUG(3, ("Request for schannel to incorrect domain: %s != our domain %s\n",
|
DEBUG(3, ("Request for schannel to incorrect domain: %s != our domain %s\n",
|
||||||
domain, lp_workgroup(gensec_security->settings->lp_ctx)));
|
domain, lpcfg_workgroup(gensec_security->settings->lp_ctx)));
|
||||||
|
|
||||||
return NT_STATUS_LOGON_FAILURE;
|
return NT_STATUS_LOGON_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = schannel_get_creds_state(out_mem_ctx,
|
status = schannel_get_creds_state(out_mem_ctx,
|
||||||
lp_private_dir(gensec_security->settings->lp_ctx),
|
lpcfg_private_dir(gensec_security->settings->lp_ctx),
|
||||||
workstation, &creds);
|
workstation, &creds);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(3, ("Could not find session key for attempted schannel connection from %s: %s\n",
|
DEBUG(3, ("Could not find session key for attempted schannel connection from %s: %s\n",
|
||||||
|
@ -827,7 +827,7 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA
|
|||||||
|
|
||||||
if (spnego.negTokenInit.targetPrincipal) {
|
if (spnego.negTokenInit.targetPrincipal) {
|
||||||
DEBUG(5, ("Server claims it's principal name is %s\n", spnego.negTokenInit.targetPrincipal));
|
DEBUG(5, ("Server claims it's principal name is %s\n", spnego.negTokenInit.targetPrincipal));
|
||||||
if (lp_client_use_spnego_principal(gensec_security->settings->lp_ctx)) {
|
if (lpcfg_client_use_spnego_principal(gensec_security->settings->lp_ctx)) {
|
||||||
gensec_set_target_principal(gensec_security, spnego.negTokenInit.targetPrincipal);
|
gensec_set_target_principal(gensec_security, spnego.negTokenInit.targetPrincipal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -398,7 +398,7 @@ smb_krb5_init_context_basic(TALLOC_CTX *tmp_ctx,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
realm = lp_realm(lp_ctx);
|
realm = lpcfg_realm(lp_ctx);
|
||||||
if (realm != NULL) {
|
if (realm != NULL) {
|
||||||
ret = krb5_set_default_realm(krb5_ctx, realm);
|
ret = krb5_set_default_realm(krb5_ctx, realm);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@ -480,7 +480,7 @@ krb5_error_code smb_krb5_init_context(void *parent_ctx,
|
|||||||
/* Set options in kerberos */
|
/* Set options in kerberos */
|
||||||
|
|
||||||
krb5_set_dns_canonicalize_hostname((*smb_krb5_context)->krb5_context,
|
krb5_set_dns_canonicalize_hostname((*smb_krb5_context)->krb5_context,
|
||||||
lp_parm_bool(lp_ctx, NULL, "krb5", "set_dns_canonicalize", false));
|
lpcfg_parm_bool(lp_ctx, NULL, "krb5", "set_dns_canonicalize", false));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ _PUBLIC_ struct tevent_req *auth_check_password_send(TALLOC_CTX *mem_ctx,
|
|||||||
state->method = NULL;
|
state->method = NULL;
|
||||||
|
|
||||||
if (!user_info->mapped_state) {
|
if (!user_info->mapped_state) {
|
||||||
nt_status = map_user_info(req, lp_workgroup(auth_ctx->lp_ctx),
|
nt_status = map_user_info(req, lpcfg_workgroup(auth_ctx->lp_ctx),
|
||||||
user_info, &user_info_tmp);
|
user_info, &user_info_tmp);
|
||||||
if (tevent_req_nterror(req, nt_status)) {
|
if (tevent_req_nterror(req, nt_status)) {
|
||||||
return tevent_req_post(req, ev);
|
return tevent_req_post(req, ev);
|
||||||
@ -478,15 +478,15 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **
|
|||||||
static const char **auth_methods_from_lp(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
|
static const char **auth_methods_from_lp(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
const char **auth_methods = NULL;
|
const char **auth_methods = NULL;
|
||||||
switch (lp_server_role(lp_ctx)) {
|
switch (lpcfg_server_role(lp_ctx)) {
|
||||||
case ROLE_STANDALONE:
|
case ROLE_STANDALONE:
|
||||||
auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "standalone", NULL);
|
auth_methods = lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "standalone", NULL);
|
||||||
break;
|
break;
|
||||||
case ROLE_DOMAIN_MEMBER:
|
case ROLE_DOMAIN_MEMBER:
|
||||||
auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "member server", NULL);
|
auth_methods = lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "member server", NULL);
|
||||||
break;
|
break;
|
||||||
case ROLE_DOMAIN_CONTROLLER:
|
case ROLE_DOMAIN_CONTROLLER:
|
||||||
auth_methods = lp_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "domain controller", NULL);
|
auth_methods = lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "auth methods", "domain controller", NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return auth_methods;
|
return auth_methods;
|
||||||
|
@ -54,7 +54,7 @@ static NTSTATUS anonymous_check_password(struct auth_method_context *ctx,
|
|||||||
const struct auth_usersupplied_info *user_info,
|
const struct auth_usersupplied_info *user_info,
|
||||||
struct auth_serversupplied_info **_server_info)
|
struct auth_serversupplied_info **_server_info)
|
||||||
{
|
{
|
||||||
return auth_anonymous_server_info(mem_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx), _server_info);
|
return auth_anonymous_server_info(mem_ctx, lpcfg_netbios_name(ctx->auth_ctx->lp_ctx), _server_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct auth_operations anonymous_auth_ops = {
|
static const struct auth_operations anonymous_auth_ops = {
|
||||||
|
@ -99,7 +99,7 @@ static NTSTATUS authsam_password_ok(struct auth_context *auth_context,
|
|||||||
*lm_sess_key = data_blob(NULL, 0);
|
*lm_sess_key = data_blob(NULL, 0);
|
||||||
*user_sess_key = data_blob(NULL, 0);
|
*user_sess_key = data_blob(NULL, 0);
|
||||||
status = hash_password_check(mem_ctx,
|
status = hash_password_check(mem_ctx,
|
||||||
lp_lanman_auth(auth_context->lp_ctx),
|
lpcfg_lanman_auth(auth_context->lp_ctx),
|
||||||
user_info->password.hash.lanman,
|
user_info->password.hash.lanman,
|
||||||
user_info->password.hash.nt,
|
user_info->password.hash.nt,
|
||||||
user_info->mapped.account_name,
|
user_info->mapped.account_name,
|
||||||
@ -109,8 +109,8 @@ static NTSTATUS authsam_password_ok(struct auth_context *auth_context,
|
|||||||
|
|
||||||
case AUTH_PASSWORD_RESPONSE:
|
case AUTH_PASSWORD_RESPONSE:
|
||||||
status = ntlm_password_check(mem_ctx,
|
status = ntlm_password_check(mem_ctx,
|
||||||
lp_lanman_auth(auth_context->lp_ctx),
|
lpcfg_lanman_auth(auth_context->lp_ctx),
|
||||||
lp_ntlm_auth(auth_context->lp_ctx),
|
lpcfg_ntlm_auth(auth_context->lp_ctx),
|
||||||
user_info->logon_parameters,
|
user_info->logon_parameters,
|
||||||
&auth_context->challenge.data,
|
&auth_context->challenge.data,
|
||||||
&user_info->password.response.lanman,
|
&user_info->password.response.lanman,
|
||||||
@ -229,8 +229,8 @@ static NTSTATUS authsam_check_password_internals(struct auth_method_context *ctx
|
|||||||
return nt_status;
|
return nt_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nt_status = authsam_make_server_info(tmp_ctx, ctx->auth_ctx->sam_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx),
|
nt_status = authsam_make_server_info(tmp_ctx, ctx->auth_ctx->sam_ctx, lpcfg_netbios_name(ctx->auth_ctx->lp_ctx),
|
||||||
lp_sam_name(ctx->auth_ctx->lp_ctx),
|
lpcfg_sam_name(ctx->auth_ctx->lp_ctx),
|
||||||
domain_dn,
|
domain_dn,
|
||||||
msg,
|
msg,
|
||||||
user_sess_key, lm_sess_key,
|
user_sess_key, lm_sess_key,
|
||||||
@ -270,13 +270,13 @@ static NTSTATUS authsam_want_check(struct auth_method_context *ctx,
|
|||||||
return NT_STATUS_NOT_IMPLEMENTED;
|
return NT_STATUS_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
is_local_name = lp_is_myname(ctx->auth_ctx->lp_ctx,
|
is_local_name = lpcfg_is_myname(ctx->auth_ctx->lp_ctx,
|
||||||
user_info->mapped.domain_name);
|
user_info->mapped.domain_name);
|
||||||
is_my_domain = lp_is_mydomain(ctx->auth_ctx->lp_ctx,
|
is_my_domain = lpcfg_is_mydomain(ctx->auth_ctx->lp_ctx,
|
||||||
user_info->mapped.domain_name);
|
user_info->mapped.domain_name);
|
||||||
|
|
||||||
/* check whether or not we service this domain/workgroup name */
|
/* check whether or not we service this domain/workgroup name */
|
||||||
switch (lp_server_role(ctx->auth_ctx->lp_ctx)) {
|
switch (lpcfg_server_role(ctx->auth_ctx->lp_ctx)) {
|
||||||
case ROLE_STANDALONE:
|
case ROLE_STANDALONE:
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ static NTSTATUS authsam_want_check(struct auth_method_context *ctx,
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(6,("authsam_check_password: lp_server_role() has an undefined value\n"));
|
DEBUG(6,("authsam_check_password: lpcfg_server_role() has an undefined value\n"));
|
||||||
return NT_STATUS_NOT_IMPLEMENTED;
|
return NT_STATUS_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,8 +366,8 @@ NTSTATUS authsam_get_server_info_principal(TALLOC_CTX *mem_ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nt_status = authsam_make_server_info(tmp_ctx, auth_context->sam_ctx,
|
nt_status = authsam_make_server_info(tmp_ctx, auth_context->sam_ctx,
|
||||||
lp_netbios_name(auth_context->lp_ctx),
|
lpcfg_netbios_name(auth_context->lp_ctx),
|
||||||
lp_workgroup(auth_context->lp_ctx),
|
lpcfg_workgroup(auth_context->lp_ctx),
|
||||||
domain_dn,
|
domain_dn,
|
||||||
msg,
|
msg,
|
||||||
user_sess_key, lm_sess_key,
|
user_sess_key, lm_sess_key,
|
||||||
|
@ -49,13 +49,13 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX
|
|||||||
|
|
||||||
/* Make a connection to the target server, found by 'password server' in smb.conf */
|
/* Make a connection to the target server, found by 'password server' in smb.conf */
|
||||||
|
|
||||||
lp_smbcli_options(ctx->auth_ctx->lp_ctx, &smb_options);
|
lpcfg_smbcli_options(ctx->auth_ctx->lp_ctx, &smb_options);
|
||||||
|
|
||||||
/* Make a negprot, WITHOUT SPNEGO, so we get a challenge nice an easy */
|
/* Make a negprot, WITHOUT SPNEGO, so we get a challenge nice an easy */
|
||||||
io.in.options.use_spnego = false;
|
io.in.options.use_spnego = false;
|
||||||
|
|
||||||
/* Hope we don't get * (the default), as this won't work... */
|
/* Hope we don't get * (the default), as this won't work... */
|
||||||
host_list = lp_passwordserver(ctx->auth_ctx->lp_ctx);
|
host_list = lpcfg_passwordserver(ctx->auth_ctx->lp_ctx);
|
||||||
if (!host_list) {
|
if (!host_list) {
|
||||||
return NT_STATUS_INTERNAL_ERROR;
|
return NT_STATUS_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
@ -63,16 +63,16 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX
|
|||||||
if (strequal(io.in.dest_host, "*")) {
|
if (strequal(io.in.dest_host, "*")) {
|
||||||
return NT_STATUS_INTERNAL_ERROR;
|
return NT_STATUS_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
io.in.dest_ports = lp_smb_ports(ctx->auth_ctx->lp_ctx);
|
io.in.dest_ports = lpcfg_smb_ports(ctx->auth_ctx->lp_ctx);
|
||||||
io.in.socket_options = lp_socket_options(ctx->auth_ctx->lp_ctx);
|
io.in.socket_options = lpcfg_socket_options(ctx->auth_ctx->lp_ctx);
|
||||||
io.in.gensec_settings = lp_gensec_settings(mem_ctx, ctx->auth_ctx->lp_ctx);
|
io.in.gensec_settings = lpcfg_gensec_settings(mem_ctx, ctx->auth_ctx->lp_ctx);
|
||||||
|
|
||||||
io.in.called_name = strupper_talloc(mem_ctx, io.in.dest_host);
|
io.in.called_name = strupper_talloc(mem_ctx, io.in.dest_host);
|
||||||
|
|
||||||
/* We don't want to get as far as the session setup */
|
/* We don't want to get as far as the session setup */
|
||||||
io.in.credentials = cli_credentials_init_anon(mem_ctx);
|
io.in.credentials = cli_credentials_init_anon(mem_ctx);
|
||||||
cli_credentials_set_workstation(io.in.credentials,
|
cli_credentials_set_workstation(io.in.credentials,
|
||||||
lp_netbios_name(ctx->auth_ctx->lp_ctx),
|
lpcfg_netbios_name(ctx->auth_ctx->lp_ctx),
|
||||||
CRED_SPECIFIED);
|
CRED_SPECIFIED);
|
||||||
|
|
||||||
io.in.service = NULL;
|
io.in.service = NULL;
|
||||||
@ -81,9 +81,9 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX
|
|||||||
|
|
||||||
io.in.options = smb_options;
|
io.in.options = smb_options;
|
||||||
|
|
||||||
lp_smbcli_session_options(ctx->auth_ctx->lp_ctx, &io.in.session_options);
|
lpcfg_smbcli_session_options(ctx->auth_ctx->lp_ctx, &io.in.session_options);
|
||||||
|
|
||||||
status = smb_composite_connect(&io, mem_ctx, lp_resolve_context(ctx->auth_ctx->lp_ctx),
|
status = smb_composite_connect(&io, mem_ctx, lpcfg_resolve_context(ctx->auth_ctx->lp_ctx),
|
||||||
ctx->auth_ctx->event_ctx);
|
ctx->auth_ctx->event_ctx);
|
||||||
NT_STATUS_NOT_OK_RETURN(status);
|
NT_STATUS_NOT_OK_RETURN(status);
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ static NTSTATUS server_check_password(struct auth_method_context *ctx,
|
|||||||
|
|
||||||
session_setup.in.credentials = creds;
|
session_setup.in.credentials = creds;
|
||||||
session_setup.in.workgroup = ""; /* Only used with SPNEGO, which we are not doing */
|
session_setup.in.workgroup = ""; /* Only used with SPNEGO, which we are not doing */
|
||||||
session_setup.in.gensec_settings = lp_gensec_settings(session, ctx->auth_ctx->lp_ctx);
|
session_setup.in.gensec_settings = lpcfg_gensec_settings(session, ctx->auth_ctx->lp_ctx);
|
||||||
|
|
||||||
/* Check password with remove server - this should be async some day */
|
/* Check password with remove server - this should be async some day */
|
||||||
nt_status = smb_composite_sesssetup(session, &session_setup);
|
nt_status = smb_composite_sesssetup(session, &session_setup);
|
||||||
|
@ -465,7 +465,7 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp
|
|||||||
return nt_status;
|
return nt_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nt_status = smb_pam_auth(pamh, lp_null_passwords(lp_ctx), user_info->mapped.account_name);
|
nt_status = smb_pam_auth(pamh, lpcfg_null_passwords(lp_ctx), user_info->mapped.account_name);
|
||||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||||
smb_pam_end(pamh);
|
smb_pam_end(pamh);
|
||||||
return nt_status;
|
return nt_status;
|
||||||
@ -605,7 +605,7 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp
|
|||||||
char *crypted;
|
char *crypted;
|
||||||
struct passwd *pws;
|
struct passwd *pws;
|
||||||
NTSTATUS nt_status;
|
NTSTATUS nt_status;
|
||||||
int level = lp_passwordlevel(lp_ctx);
|
int level = lpcfg_passwordlevel(lp_ctx);
|
||||||
|
|
||||||
*ret_passwd = NULL;
|
*ret_passwd = NULL;
|
||||||
|
|
||||||
@ -708,7 +708,7 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (crypted[0] == '\0') {
|
if (crypted[0] == '\0') {
|
||||||
if (!lp_null_passwords(lp_ctx)) {
|
if (!lpcfg_null_passwords(lp_ctx)) {
|
||||||
DEBUG(2, ("Disallowing %s with null password\n", username));
|
DEBUG(2, ("Disallowing %s with null password\n", username));
|
||||||
return NT_STATUS_LOGON_FAILURE;
|
return NT_STATUS_LOGON_FAILURE;
|
||||||
}
|
}
|
||||||
@ -814,7 +814,7 @@ static NTSTATUS authunix_check_password(struct auth_method_context *ctx,
|
|||||||
return nt_status;
|
return nt_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nt_status = authunix_make_server_info(mem_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx),
|
nt_status = authunix_make_server_info(mem_ctx, lpcfg_netbios_name(ctx->auth_ctx->lp_ctx),
|
||||||
user_info, pwd, server_info);
|
user_info, pwd, server_info);
|
||||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||||
talloc_free(check_ctx);
|
talloc_free(check_ctx);
|
||||||
|
@ -140,8 +140,8 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth_context *auth_contex
|
|||||||
}
|
}
|
||||||
|
|
||||||
chall_blob = data_blob_talloc(mem_ctx, chal, 8);
|
chall_blob = data_blob_talloc(mem_ctx, chal, 8);
|
||||||
if (lp_client_ntlmv2_auth(auth_context->lp_ctx)) {
|
if (lpcfg_client_ntlmv2_auth(auth_context->lp_ctx)) {
|
||||||
DATA_BLOB names_blob = NTLMv2_generate_names_blob(mem_ctx, lp_netbios_name(auth_context->lp_ctx), lp_workgroup(auth_context->lp_ctx));
|
DATA_BLOB names_blob = NTLMv2_generate_names_blob(mem_ctx, lpcfg_netbios_name(auth_context->lp_ctx), lpcfg_workgroup(auth_context->lp_ctx));
|
||||||
DATA_BLOB lmv2_response, ntlmv2_response, lmv2_session_key, ntlmv2_session_key;
|
DATA_BLOB lmv2_response, ntlmv2_response, lmv2_session_key, ntlmv2_session_key;
|
||||||
|
|
||||||
if (!SMBNTLMv2encrypt_hash(user_info_temp,
|
if (!SMBNTLMv2encrypt_hash(user_info_temp,
|
||||||
@ -165,7 +165,7 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth_context *auth_contex
|
|||||||
SMBOWFencrypt(user_info_in->password.hash.nt->hash, chal, blob.data);
|
SMBOWFencrypt(user_info_in->password.hash.nt->hash, chal, blob.data);
|
||||||
|
|
||||||
user_info_temp->password.response.nt = blob;
|
user_info_temp->password.response.nt = blob;
|
||||||
if (lp_client_lanman_auth(auth_context->lp_ctx) && user_info_in->password.hash.lanman) {
|
if (lpcfg_client_lanman_auth(auth_context->lp_ctx) && user_info_in->password.hash.lanman) {
|
||||||
DATA_BLOB lm_blob = data_blob_talloc(mem_ctx, NULL, 24);
|
DATA_BLOB lm_blob = data_blob_talloc(mem_ctx, NULL, 24);
|
||||||
SMBOWFencrypt(user_info_in->password.hash.lanman->hash, chal, blob.data);
|
SMBOWFencrypt(user_info_in->password.hash.lanman->hash, chal, blob.data);
|
||||||
user_info_temp->password.response.lanman = lm_blob;
|
user_info_temp->password.response.lanman = lm_blob;
|
||||||
|
@ -206,7 +206,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
|
|||||||
if (ntlmssp_state->use_nt_response) {
|
if (ntlmssp_state->use_nt_response) {
|
||||||
flags |= CLI_CRED_NTLM_AUTH;
|
flags |= CLI_CRED_NTLM_AUTH;
|
||||||
}
|
}
|
||||||
if (lp_client_lanman_auth(gensec_security->settings->lp_ctx)) {
|
if (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)) {
|
||||||
flags |= CLI_CRED_LANMAN_AUTH;
|
flags |= CLI_CRED_LANMAN_AUTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY)
|
if ((ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY)
|
||||||
&& lp_client_lanman_auth(gensec_security->settings->lp_ctx) && lm_session_key.length == 16) {
|
&& lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx) && lm_session_key.length == 16) {
|
||||||
DATA_BLOB new_session_key = data_blob_talloc(mem_ctx, NULL, 16);
|
DATA_BLOB new_session_key = data_blob_talloc(mem_ctx, NULL, 16);
|
||||||
if (lm_response.length == 24) {
|
if (lm_response.length == 24) {
|
||||||
SMBsesskeygen_lm_sess_key(lm_session_key.data, lm_response.data,
|
SMBsesskeygen_lm_sess_key(lm_session_key.data, lm_response.data,
|
||||||
@ -325,17 +325,17 @@ NTSTATUS gensec_ntlmssp_client_start(struct gensec_security *gensec_security)
|
|||||||
|
|
||||||
ntlmssp_state->role = NTLMSSP_CLIENT;
|
ntlmssp_state->role = NTLMSSP_CLIENT;
|
||||||
|
|
||||||
ntlmssp_state->domain = lp_workgroup(gensec_security->settings->lp_ctx);
|
ntlmssp_state->domain = lpcfg_workgroup(gensec_security->settings->lp_ctx);
|
||||||
|
|
||||||
ntlmssp_state->unicode = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "unicode", true);
|
ntlmssp_state->unicode = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "unicode", true);
|
||||||
|
|
||||||
ntlmssp_state->use_nt_response = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "send_nt_reponse", true);
|
ntlmssp_state->use_nt_response = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "send_nt_reponse", true);
|
||||||
|
|
||||||
ntlmssp_state->allow_lm_key = (lp_client_lanman_auth(gensec_security->settings->lp_ctx)
|
ntlmssp_state->allow_lm_key = (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)
|
||||||
&& (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "allow_lm_key", false)
|
&& (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "allow_lm_key", false)
|
||||||
|| gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "lm_key", false)));
|
|| gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "lm_key", false)));
|
||||||
|
|
||||||
ntlmssp_state->use_ntlmv2 = lp_client_ntlmv2_auth(gensec_security->settings->lp_ctx);
|
ntlmssp_state->use_ntlmv2 = lpcfg_client_ntlmv2_auth(gensec_security->settings->lp_ctx);
|
||||||
|
|
||||||
ntlmssp_state->expected_state = NTLMSSP_INITIAL;
|
ntlmssp_state->expected_state = NTLMSSP_INITIAL;
|
||||||
|
|
||||||
|
@ -724,7 +724,7 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
|
|||||||
|
|
||||||
ntlmssp_state->expected_state = NTLMSSP_NEGOTIATE;
|
ntlmssp_state->expected_state = NTLMSSP_NEGOTIATE;
|
||||||
|
|
||||||
ntlmssp_state->allow_lm_key = (lp_lanman_auth(gensec_security->settings->lp_ctx)
|
ntlmssp_state->allow_lm_key = (lpcfg_lanman_auth(gensec_security->settings->lp_ctx)
|
||||||
&& gensec_setting_bool(gensec_security->settings, "ntlmssp_server", "allow_lm_key", false));
|
&& gensec_setting_bool(gensec_security->settings, "ntlmssp_server", "allow_lm_key", false));
|
||||||
|
|
||||||
ntlmssp_state->neg_flags =
|
ntlmssp_state->neg_flags =
|
||||||
@ -766,22 +766,22 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
|
|||||||
ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
|
ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
|
||||||
ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
|
ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
|
||||||
ntlmssp_state->check_password = auth_ntlmssp_check_password;
|
ntlmssp_state->check_password = auth_ntlmssp_check_password;
|
||||||
if (lp_server_role(gensec_security->settings->lp_ctx) == ROLE_STANDALONE) {
|
if (lpcfg_server_role(gensec_security->settings->lp_ctx) == ROLE_STANDALONE) {
|
||||||
ntlmssp_state->server.is_standalone = true;
|
ntlmssp_state->server.is_standalone = true;
|
||||||
} else {
|
} else {
|
||||||
ntlmssp_state->server.is_standalone = false;
|
ntlmssp_state->server.is_standalone = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ntlmssp_state->server.netbios_name = lp_netbios_name(gensec_security->settings->lp_ctx);
|
ntlmssp_state->server.netbios_name = lpcfg_netbios_name(gensec_security->settings->lp_ctx);
|
||||||
|
|
||||||
ntlmssp_state->server.netbios_domain = lp_workgroup(gensec_security->settings->lp_ctx);
|
ntlmssp_state->server.netbios_domain = lpcfg_workgroup(gensec_security->settings->lp_ctx);
|
||||||
|
|
||||||
{
|
{
|
||||||
char dnsdomname[MAXHOSTNAMELEN], dnsname[MAXHOSTNAMELEN];
|
char dnsdomname[MAXHOSTNAMELEN], dnsname[MAXHOSTNAMELEN];
|
||||||
|
|
||||||
/* Find out the DNS domain name */
|
/* Find out the DNS domain name */
|
||||||
dnsdomname[0] = '\0';
|
dnsdomname[0] = '\0';
|
||||||
safe_strcpy(dnsdomname, lp_dnsdomain(gensec_security->settings->lp_ctx), sizeof(dnsdomname) - 1);
|
safe_strcpy(dnsdomname, lpcfg_dnsdomain(gensec_security->settings->lp_ctx), sizeof(dnsdomname) - 1);
|
||||||
|
|
||||||
/* Find out the DNS host name */
|
/* Find out the DNS host name */
|
||||||
safe_strcpy(dnsname, ntlmssp_state->server.netbios_name, sizeof(dnsname) - 1);
|
safe_strcpy(dnsname, ntlmssp_state->server.netbios_name, sizeof(dnsname) - 1);
|
||||||
|
@ -46,7 +46,7 @@ static PyObject *py_system_session(PyObject *module, PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
|
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: Leaks memory */
|
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: Leaks memory */
|
||||||
if (lp_ctx == NULL)
|
if (lp_ctx == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ static PyObject *py_system_session_anon(PyObject *module, PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
|
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaks memory */
|
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaks memory */
|
||||||
if (lp_ctx == NULL)
|
if (lp_ctx == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ static PyObject *py_admin_session(PyObject *module, PyObject *args)
|
|||||||
if (!PyArg_ParseTuple(args, "OO", &py_lp_ctx, &py_sid))
|
if (!PyArg_ParseTuple(args, "OO", &py_lp_ctx, &py_sid))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
||||||
if (lp_ctx == NULL)
|
if (lp_ctx == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ NTSTATUS samba_server_gensec_start(TALLOC_CTX *mem_ctx,
|
|||||||
|
|
||||||
nt_status = gensec_server_start(mem_ctx,
|
nt_status = gensec_server_start(mem_ctx,
|
||||||
event_ctx,
|
event_ctx,
|
||||||
lp_gensec_settings(mem_ctx, lp_ctx),
|
lpcfg_gensec_settings(mem_ctx, lp_ctx),
|
||||||
auth_context,
|
auth_context,
|
||||||
&gensec_ctx);
|
&gensec_ctx);
|
||||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||||
|
@ -188,7 +188,7 @@ static NTSTATUS _auth_system_session_info(TALLOC_CTX *parent_ctx,
|
|||||||
struct auth_session_info *session_info = NULL;
|
struct auth_session_info *session_info = NULL;
|
||||||
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
|
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
|
||||||
|
|
||||||
nt_status = auth_system_server_info(mem_ctx, lp_netbios_name(lp_ctx),
|
nt_status = auth_system_server_info(mem_ctx, lpcfg_netbios_name(lp_ctx),
|
||||||
&server_info);
|
&server_info);
|
||||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||||
talloc_free(mem_ctx);
|
talloc_free(mem_ctx);
|
||||||
@ -240,7 +240,7 @@ _PUBLIC_ NTSTATUS auth_system_session_info(TALLOC_CTX *parent_ctx,
|
|||||||
{
|
{
|
||||||
return _auth_system_session_info(parent_ctx,
|
return _auth_system_session_info(parent_ctx,
|
||||||
lp_ctx,
|
lp_ctx,
|
||||||
lp_parm_bool(lp_ctx, NULL, "system", "anonymous", false),
|
lpcfg_parm_bool(lp_ctx, NULL, "system", "anonymous", false),
|
||||||
_session_info);
|
_session_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,8 +458,8 @@ static NTSTATUS auth_domain_admin_session_info(TALLOC_CTX *parent_ctx,
|
|||||||
struct auth_session_info *session_info = NULL;
|
struct auth_session_info *session_info = NULL;
|
||||||
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
|
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
|
||||||
|
|
||||||
nt_status = auth_domain_admin_server_info(mem_ctx, lp_netbios_name(lp_ctx),
|
nt_status = auth_domain_admin_server_info(mem_ctx, lpcfg_netbios_name(lp_ctx),
|
||||||
lp_workgroup(lp_ctx), domain_sid,
|
lpcfg_workgroup(lp_ctx), domain_sid,
|
||||||
&server_info);
|
&server_info);
|
||||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||||
talloc_free(mem_ctx);
|
talloc_free(mem_ctx);
|
||||||
@ -519,7 +519,7 @@ _PUBLIC_ NTSTATUS auth_anonymous_session_info(TALLOC_CTX *parent_ctx,
|
|||||||
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
|
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
|
||||||
|
|
||||||
nt_status = auth_anonymous_server_info(mem_ctx,
|
nt_status = auth_anonymous_server_info(mem_ctx,
|
||||||
lp_netbios_name(lp_ctx),
|
lpcfg_netbios_name(lp_ctx),
|
||||||
&server_info);
|
&server_info);
|
||||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||||
talloc_free(mem_ctx);
|
talloc_free(mem_ctx);
|
||||||
|
@ -111,12 +111,12 @@ static NTSTATUS cldapd_add_socket(struct cldapd_server *cldapd, struct loadparm_
|
|||||||
ret = tsocket_address_inet_from_strings(cldapd,
|
ret = tsocket_address_inet_from_strings(cldapd,
|
||||||
"ip",
|
"ip",
|
||||||
address,
|
address,
|
||||||
lp_cldap_port(lp_ctx),
|
lpcfg_cldap_port(lp_ctx),
|
||||||
&socket_address);
|
&socket_address);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
status = map_nt_error_from_unix(errno);
|
status = map_nt_error_from_unix(errno);
|
||||||
DEBUG(0,("invalid address %s:%d - %s:%s\n",
|
DEBUG(0,("invalid address %s:%d - %s:%s\n",
|
||||||
address, lp_cldap_port(lp_ctx),
|
address, lpcfg_cldap_port(lp_ctx),
|
||||||
gai_strerror(ret), nt_errstr(status)));
|
gai_strerror(ret), nt_errstr(status)));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ static NTSTATUS cldapd_startup_interfaces(struct cldapd_server *cldapd, struct l
|
|||||||
|
|
||||||
/* if we are allowing incoming packets from any address, then
|
/* if we are allowing incoming packets from any address, then
|
||||||
we need to bind to the wildcard address */
|
we need to bind to the wildcard address */
|
||||||
if (!lp_bind_interfaces_only(lp_ctx)) {
|
if (!lpcfg_bind_interfaces_only(lp_ctx)) {
|
||||||
status = cldapd_add_socket(cldapd, lp_ctx, "0.0.0.0");
|
status = cldapd_add_socket(cldapd, lp_ctx, "0.0.0.0");
|
||||||
NT_STATUS_NOT_OK_RETURN(status);
|
NT_STATUS_NOT_OK_RETURN(status);
|
||||||
}
|
}
|
||||||
@ -182,14 +182,14 @@ static void cldapd_task_init(struct task_server *task)
|
|||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
|
|
||||||
load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
|
load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
|
||||||
|
|
||||||
if (iface_count(ifaces) == 0) {
|
if (iface_count(ifaces) == 0) {
|
||||||
task_server_terminate(task, "cldapd: no network interfaces configured", false);
|
task_server_terminate(task, "cldapd: no network interfaces configured", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (lp_server_role(task->lp_ctx)) {
|
switch (lpcfg_server_role(task->lp_ctx)) {
|
||||||
case ROLE_STANDALONE:
|
case ROLE_STANDALONE:
|
||||||
task_server_terminate(task, "cldap_server: no CLDAP server required in standalone configuration",
|
task_server_terminate(task, "cldap_server: no CLDAP server required in standalone configuration",
|
||||||
false);
|
false);
|
||||||
|
@ -58,7 +58,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
|
|||||||
const char *none_attrs[] = {NULL};
|
const char *none_attrs[] = {NULL};
|
||||||
struct ldb_result *dom_res = NULL, *user_res = NULL;
|
struct ldb_result *dom_res = NULL, *user_res = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
const char **services = lp_server_services(lp_ctx);
|
const char **services = lpcfg_server_services(lp_ctx);
|
||||||
uint32_t server_type;
|
uint32_t server_type;
|
||||||
const char *pdc_name;
|
const char *pdc_name;
|
||||||
struct GUID domain_uuid;
|
struct GUID domain_uuid;
|
||||||
@ -81,10 +81,10 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Lookup using long or short domainname */
|
/* Lookup using long or short domainname */
|
||||||
if (domain && (strcasecmp_m(domain, lp_dnsdomain(lp_ctx)) == 0)) {
|
if (domain && (strcasecmp_m(domain, lpcfg_dnsdomain(lp_ctx)) == 0)) {
|
||||||
domain_dn = ldb_get_default_basedn(sam_ctx);
|
domain_dn = ldb_get_default_basedn(sam_ctx);
|
||||||
}
|
}
|
||||||
if (netbios_domain && (strcasecmp_m(netbios_domain, lp_sam_name(lp_ctx)) == 0)) {
|
if (netbios_domain && (strcasecmp_m(netbios_domain, lpcfg_sam_name(lp_ctx)) == 0)) {
|
||||||
domain_dn = ldb_get_default_basedn(sam_ctx);
|
domain_dn = ldb_get_default_basedn(sam_ctx);
|
||||||
}
|
}
|
||||||
if (domain_dn) {
|
if (domain_dn) {
|
||||||
@ -180,7 +180,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
|
|||||||
"objectClass=domain");
|
"objectClass=domain");
|
||||||
if (ret != LDB_SUCCESS) {
|
if (ret != LDB_SUCCESS) {
|
||||||
DEBUG(2,("Error finding domain '%s'/'%s' in sam: %s\n",
|
DEBUG(2,("Error finding domain '%s'/'%s' in sam: %s\n",
|
||||||
lp_dnsdomain(lp_ctx),
|
lpcfg_dnsdomain(lp_ctx),
|
||||||
ldb_dn_get_linearized(domain_dn),
|
ldb_dn_get_linearized(domain_dn),
|
||||||
ldb_errstring(sam_ctx)));
|
ldb_errstring(sam_ctx)));
|
||||||
return NT_STATUS_NO_SUCH_DOMAIN;
|
return NT_STATUS_NO_SUCH_DOMAIN;
|
||||||
@ -269,24 +269,24 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
pdc_name = talloc_asprintf(mem_ctx, "\\\\%s",
|
pdc_name = talloc_asprintf(mem_ctx, "\\\\%s",
|
||||||
lp_netbios_name(lp_ctx));
|
lpcfg_netbios_name(lp_ctx));
|
||||||
NT_STATUS_HAVE_NO_MEMORY(pdc_name);
|
NT_STATUS_HAVE_NO_MEMORY(pdc_name);
|
||||||
domain_uuid = samdb_result_guid(dom_res->msgs[0], "objectGUID");
|
domain_uuid = samdb_result_guid(dom_res->msgs[0], "objectGUID");
|
||||||
dns_domain = lp_dnsdomain(lp_ctx);
|
dns_domain = lpcfg_dnsdomain(lp_ctx);
|
||||||
forest_domain = samdb_forest_name(sam_ctx, mem_ctx);
|
forest_domain = samdb_forest_name(sam_ctx, mem_ctx);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(forest_domain);
|
NT_STATUS_HAVE_NO_MEMORY(forest_domain);
|
||||||
pdc_dns_name = talloc_asprintf(mem_ctx, "%s.%s",
|
pdc_dns_name = talloc_asprintf(mem_ctx, "%s.%s",
|
||||||
strlower_talloc(mem_ctx,
|
strlower_talloc(mem_ctx,
|
||||||
lp_netbios_name(lp_ctx)),
|
lpcfg_netbios_name(lp_ctx)),
|
||||||
dns_domain);
|
dns_domain);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(pdc_dns_name);
|
NT_STATUS_HAVE_NO_MEMORY(pdc_dns_name);
|
||||||
flatname = lp_workgroup(lp_ctx);
|
flatname = lpcfg_workgroup(lp_ctx);
|
||||||
server_site = samdb_server_site_name(sam_ctx, mem_ctx);
|
server_site = samdb_server_site_name(sam_ctx, mem_ctx);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(server_site);
|
NT_STATUS_HAVE_NO_MEMORY(server_site);
|
||||||
client_site = samdb_client_site_name(sam_ctx, mem_ctx,
|
client_site = samdb_client_site_name(sam_ctx, mem_ctx,
|
||||||
src_address, NULL);
|
src_address, NULL);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(client_site);
|
NT_STATUS_HAVE_NO_MEMORY(client_site);
|
||||||
load_interfaces(mem_ctx, lp_interfaces(lp_ctx), &ifaces);
|
load_interfaces(mem_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
|
||||||
/*
|
/*
|
||||||
* TODO: the caller should pass the address which the client
|
* TODO: the caller should pass the address which the client
|
||||||
* used to trigger this call, as the client is able to reach
|
* used to trigger this call, as the client is able to reach
|
||||||
@ -450,7 +450,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((domain == NULL) && (domain_guid == NULL) && (domain_sid == NULL)) {
|
if ((domain == NULL) && (domain_guid == NULL) && (domain_sid == NULL)) {
|
||||||
domain = lp_dnsdomain(cldapd->task->lp_ctx);
|
domain = lpcfg_dnsdomain(cldapd->task->lp_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version == -1) {
|
if (version == -1) {
|
||||||
|
@ -425,8 +425,8 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx
|
|||||||
obs = check_arg_numeric("obs");
|
obs = check_arg_numeric("obs");
|
||||||
count = check_arg_numeric("count");
|
count = check_arg_numeric("count");
|
||||||
|
|
||||||
lp_smbcli_options(lp_ctx, &options);
|
lpcfg_smbcli_options(lp_ctx, &options);
|
||||||
lp_smbcli_session_options(lp_ctx, &session_options);
|
lpcfg_smbcli_session_options(lp_ctx, &session_options);
|
||||||
|
|
||||||
/* Allocate IO buffer. We need more than the max IO size because we
|
/* Allocate IO buffer. We need more than the max IO size because we
|
||||||
* could accumulate a remainder if ibs and obs don't match.
|
* could accumulate a remainder if ibs and obs don't match.
|
||||||
@ -444,19 +444,19 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx
|
|||||||
DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
|
DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
|
||||||
(unsigned long long)iomax, options.max_xmit));
|
(unsigned long long)iomax, options.max_xmit));
|
||||||
|
|
||||||
if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if",
|
if (!(ifile = open_file(lpcfg_resolve_context(lp_ctx), ev, "if",
|
||||||
lp_smb_ports(lp_ctx), &options,
|
lpcfg_smb_ports(lp_ctx), &options,
|
||||||
lp_socket_options(lp_ctx),
|
lpcfg_socket_options(lp_ctx),
|
||||||
&session_options,
|
&session_options,
|
||||||
lp_gensec_settings(lp_ctx, lp_ctx)))) {
|
lpcfg_gensec_settings(lp_ctx, lp_ctx)))) {
|
||||||
return(FILESYS_EXIT_CODE);
|
return(FILESYS_EXIT_CODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(ofile = open_file(lp_resolve_context(lp_ctx), ev, "of",
|
if (!(ofile = open_file(lpcfg_resolve_context(lp_ctx), ev, "of",
|
||||||
lp_smb_ports(lp_ctx), &options,
|
lpcfg_smb_ports(lp_ctx), &options,
|
||||||
lp_socket_options(lp_ctx),
|
lpcfg_socket_options(lp_ctx),
|
||||||
&session_options,
|
&session_options,
|
||||||
lp_gensec_settings(lp_ctx, lp_ctx)))) {
|
lpcfg_gensec_settings(lp_ctx, lp_ctx)))) {
|
||||||
return(FILESYS_EXIT_CODE);
|
return(FILESYS_EXIT_CODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3261,8 +3261,8 @@ static int do_message_op(const char *netbios_name, const char *desthost,
|
|||||||
|
|
||||||
poptFreeContext(pc);
|
poptFreeContext(pc);
|
||||||
|
|
||||||
lp_smbcli_options(cmdline_lp_ctx, &smb_options);
|
lpcfg_smbcli_options(cmdline_lp_ctx, &smb_options);
|
||||||
lp_smbcli_session_options(cmdline_lp_ctx, &smb_session_options);
|
lpcfg_smbcli_session_options(cmdline_lp_ctx, &smb_session_options);
|
||||||
|
|
||||||
ev_ctx = s4_event_context_init(talloc_autofree_context());
|
ev_ctx = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
@ -3276,25 +3276,25 @@ static int do_message_op(const char *netbios_name, const char *desthost,
|
|||||||
|
|
||||||
if (query_host) {
|
if (query_host) {
|
||||||
rc = do_host_query(cmdline_lp_ctx, ev_ctx, query_host,
|
rc = do_host_query(cmdline_lp_ctx, ev_ctx, query_host,
|
||||||
lp_workgroup(cmdline_lp_ctx));
|
lpcfg_workgroup(cmdline_lp_ctx));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
rc = do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost,
|
rc = do_message_op(lpcfg_netbios_name(cmdline_lp_ctx), desthost,
|
||||||
lp_smb_ports(cmdline_lp_ctx), dest_ip,
|
lpcfg_smb_ports(cmdline_lp_ctx), dest_ip,
|
||||||
name_type, ev_ctx,
|
name_type, ev_ctx,
|
||||||
lp_resolve_context(cmdline_lp_ctx),
|
lpcfg_resolve_context(cmdline_lp_ctx),
|
||||||
&smb_options,
|
&smb_options,
|
||||||
lp_socket_options(cmdline_lp_ctx));
|
lpcfg_socket_options(cmdline_lp_ctx));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!do_connect(ctx, ev_ctx, lp_resolve_context(cmdline_lp_ctx),
|
if (!do_connect(ctx, ev_ctx, lpcfg_resolve_context(cmdline_lp_ctx),
|
||||||
desthost, lp_smb_ports(cmdline_lp_ctx), service,
|
desthost, lpcfg_smb_ports(cmdline_lp_ctx), service,
|
||||||
lp_socket_options(cmdline_lp_ctx),
|
lpcfg_socket_options(cmdline_lp_ctx),
|
||||||
cmdline_credentials, &smb_options, &smb_session_options,
|
cmdline_credentials, &smb_options, &smb_session_options,
|
||||||
lp_gensec_settings(ctx, cmdline_lp_ctx)))
|
lpcfg_gensec_settings(ctx, cmdline_lp_ctx)))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (base_directory) {
|
if (base_directory) {
|
||||||
|
@ -614,7 +614,7 @@ NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct loadparm_context *lp
|
|||||||
/* Ensure that if we have turned off LM
|
/* Ensure that if we have turned off LM
|
||||||
* authentication, that we never use the LM hash, even
|
* authentication, that we never use the LM hash, even
|
||||||
* if we store it */
|
* if we store it */
|
||||||
if (lp_lanman_auth(lp_ctx)) {
|
if (lpcfg_lanman_auth(lp_ctx)) {
|
||||||
unsigned int num_lm;
|
unsigned int num_lm;
|
||||||
num_lm = samdb_result_hashes(mem_ctx, msg, "dBCSPwd", &lmPwdHash);
|
num_lm = samdb_result_hashes(mem_ctx, msg, "dBCSPwd", &lmPwdHash);
|
||||||
if (num_lm == 0) {
|
if (num_lm == 0) {
|
||||||
|
@ -101,9 +101,9 @@ static void dnsupdate_rebuild(struct dnsupdate_service *service)
|
|||||||
int fd;
|
int fd;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
const char *attrs[] = { "sAMAccountName", NULL };
|
const char *attrs[] = { "sAMAccountName", NULL };
|
||||||
const char *realm = lp_realm(service->task->lp_ctx);
|
const char *realm = lpcfg_realm(service->task->lp_ctx);
|
||||||
TALLOC_CTX *tmp_ctx = talloc_new(service);
|
TALLOC_CTX *tmp_ctx = talloc_new(service);
|
||||||
const char * const *rndc_command = lp_rndc_command(service->task->lp_ctx);
|
const char * const *rndc_command = lpcfg_rndc_command(service->task->lp_ctx);
|
||||||
|
|
||||||
/* abort any pending script run */
|
/* abort any pending script run */
|
||||||
TALLOC_FREE(service->confupdate.subreq);
|
TALLOC_FREE(service->confupdate.subreq);
|
||||||
@ -117,12 +117,12 @@ static void dnsupdate_rebuild(struct dnsupdate_service *service)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = lp_parm_string(service->task->lp_ctx, NULL, "dnsupdate", "path");
|
path = lpcfg_parm_string(service->task->lp_ctx, NULL, "dnsupdate", "path");
|
||||||
if (path == NULL) {
|
if (path == NULL) {
|
||||||
path = private_path(tmp_ctx, service->task->lp_ctx, "named.conf.update");
|
path = private_path(tmp_ctx, service->task->lp_ctx, "named.conf.update");
|
||||||
}
|
}
|
||||||
|
|
||||||
path_static = lp_parm_string(service->task->lp_ctx, NULL, "dnsupdate", "extra_static_grant_rules");
|
path_static = lpcfg_parm_string(service->task->lp_ctx, NULL, "dnsupdate", "extra_static_grant_rules");
|
||||||
if (path_static == NULL) {
|
if (path_static == NULL) {
|
||||||
path_static = private_path(tmp_ctx, service->task->lp_ctx, "named.conf.update.static");
|
path_static = private_path(tmp_ctx, service->task->lp_ctx, "named.conf.update.static");
|
||||||
}
|
}
|
||||||
@ -286,8 +286,8 @@ static void dnsupdate_spnupdate_done(struct tevent_req *subreq)
|
|||||||
*/
|
*/
|
||||||
static void dnsupdate_check_names(struct dnsupdate_service *service)
|
static void dnsupdate_check_names(struct dnsupdate_service *service)
|
||||||
{
|
{
|
||||||
const char * const *dns_update_command = lp_dns_update_command(service->task->lp_ctx);
|
const char * const *dns_update_command = lpcfg_dns_update_command(service->task->lp_ctx);
|
||||||
const char * const *spn_update_command = lp_spn_update_command(service->task->lp_ctx);
|
const char * const *spn_update_command = lpcfg_spn_update_command(service->task->lp_ctx);
|
||||||
|
|
||||||
/* kill any existing child */
|
/* kill any existing child */
|
||||||
TALLOC_FREE(service->nameupdate.subreq);
|
TALLOC_FREE(service->nameupdate.subreq);
|
||||||
@ -355,7 +355,7 @@ static void dnsupdate_task_init(struct task_server *task)
|
|||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
struct dnsupdate_service *service;
|
struct dnsupdate_service *service;
|
||||||
|
|
||||||
if (lp_server_role(task->lp_ctx) != ROLE_DOMAIN_CONTROLLER) {
|
if (lpcfg_server_role(task->lp_ctx) != ROLE_DOMAIN_CONTROLLER) {
|
||||||
/* not useful for non-DC */
|
/* not useful for non-DC */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -386,10 +386,10 @@ static void dnsupdate_task_init(struct task_server *task)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
service->confupdate.interval = lp_parm_int(task->lp_ctx, NULL,
|
service->confupdate.interval = lpcfg_parm_int(task->lp_ctx, NULL,
|
||||||
"dnsupdate", "config interval", 60); /* in seconds */
|
"dnsupdate", "config interval", 60); /* in seconds */
|
||||||
|
|
||||||
service->nameupdate.interval = lp_parm_int(task->lp_ctx, NULL,
|
service->nameupdate.interval = lpcfg_parm_int(task->lp_ctx, NULL,
|
||||||
"dnsupdate", "name interval", 600); /* in seconds */
|
"dnsupdate", "name interval", 600); /* in seconds */
|
||||||
|
|
||||||
dnsupdate_rebuild(service);
|
dnsupdate_rebuild(service);
|
||||||
|
@ -46,7 +46,7 @@ NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_ctx)
|
|||||||
uint32_t tombstoneLifetime;
|
uint32_t tombstoneLifetime;
|
||||||
|
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
if (t - s->last_deleted_check < lp_parm_int(s->task->lp_ctx, NULL, "kccsrv",
|
if (t - s->last_deleted_check < lpcfg_parm_int(s->task->lp_ctx, NULL, "kccsrv",
|
||||||
"check_deleted_interval", 600)) {
|
"check_deleted_interval", 600)) {
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ NTSTATUS kccsrv_simple_update(struct kccsrv_service *s, TALLOC_CTX *mem_ctx)
|
|||||||
r1->other_info = talloc_zero(reps, struct repsFromTo1OtherInfo);
|
r1->other_info = talloc_zero(reps, struct repsFromTo1OtherInfo);
|
||||||
r1->other_info->dns_name = talloc_asprintf(r1->other_info, "%s._msdcs.%s",
|
r1->other_info->dns_name = talloc_asprintf(r1->other_info, "%s._msdcs.%s",
|
||||||
GUID_string(mem_ctx, &ntds_guid),
|
GUID_string(mem_ctx, &ntds_guid),
|
||||||
lp_dnsdomain(s->task->lp_ctx));
|
lpcfg_dnsdomain(s->task->lp_ctx));
|
||||||
r1->source_dsa_obj_guid = ntds_guid;
|
r1->source_dsa_obj_guid = ntds_guid;
|
||||||
r1->source_dsa_invocation_id = invocation_id;
|
r1->source_dsa_invocation_id = invocation_id;
|
||||||
r1->replica_flags =
|
r1->replica_flags =
|
||||||
|
@ -169,7 +169,7 @@ static void kccsrv_task_init(struct task_server *task)
|
|||||||
struct kccsrv_service *service;
|
struct kccsrv_service *service;
|
||||||
uint32_t periodic_startup_interval;
|
uint32_t periodic_startup_interval;
|
||||||
|
|
||||||
switch (lp_server_role(task->lp_ctx)) {
|
switch (lpcfg_server_role(task->lp_ctx)) {
|
||||||
case ROLE_STANDALONE:
|
case ROLE_STANDALONE:
|
||||||
task_server_terminate(task, "kccsrv: no KCC required in standalone configuration", false);
|
task_server_terminate(task, "kccsrv: no KCC required in standalone configuration", false);
|
||||||
return;
|
return;
|
||||||
@ -217,9 +217,9 @@ static void kccsrv_task_init(struct task_server *task)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
periodic_startup_interval = lp_parm_int(task->lp_ctx, NULL, "kccsrv",
|
periodic_startup_interval = lpcfg_parm_int(task->lp_ctx, NULL, "kccsrv",
|
||||||
"periodic_startup_interval", 15); /* in seconds */
|
"periodic_startup_interval", 15); /* in seconds */
|
||||||
service->periodic.interval = lp_parm_int(task->lp_ctx, NULL, "kccsrv",
|
service->periodic.interval = lpcfg_parm_int(task->lp_ctx, NULL, "kccsrv",
|
||||||
"periodic_interval", 300); /* in seconds */
|
"periodic_interval", 300); /* in seconds */
|
||||||
|
|
||||||
status = kccsrv_periodic_schedule(service, periodic_startup_interval);
|
status = kccsrv_periodic_schedule(service, periodic_startup_interval);
|
||||||
|
@ -581,7 +581,7 @@ static void dreplsrv_update_refs_trigger(struct tevent_req *req)
|
|||||||
|
|
||||||
ntds_dns_name = talloc_asprintf(r, "%s._msdcs.%s",
|
ntds_dns_name = talloc_asprintf(r, "%s._msdcs.%s",
|
||||||
ntds_guid_str,
|
ntds_guid_str,
|
||||||
lp_dnsdomain(service->task->lp_ctx));
|
lpcfg_dnsdomain(service->task->lp_ctx));
|
||||||
if (tevent_req_nomem(ntds_dns_name, req)) {
|
if (tevent_req_nomem(ntds_dns_name, req)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ static WERROR drepl_create_rid_manager_source_dsa(struct dreplsrv_service *servi
|
|||||||
sdsa->repsFrom1->other_info->dns_name =
|
sdsa->repsFrom1->other_info->dns_name =
|
||||||
talloc_asprintf(sdsa->repsFrom1->other_info, "%s._msdcs.%s",
|
talloc_asprintf(sdsa->repsFrom1->other_info, "%s._msdcs.%s",
|
||||||
GUID_string(sdsa->repsFrom1->other_info, &sdsa->repsFrom1->source_dsa_obj_guid),
|
GUID_string(sdsa->repsFrom1->other_info, &sdsa->repsFrom1->source_dsa_obj_guid),
|
||||||
lp_dnsdomain(service->task->lp_ctx));
|
lpcfg_dnsdomain(service->task->lp_ctx));
|
||||||
if (!sdsa->repsFrom1->other_info->dns_name) {
|
if (!sdsa->repsFrom1->other_info->dns_name) {
|
||||||
talloc_free(sdsa);
|
talloc_free(sdsa);
|
||||||
return WERR_NOMEM;
|
return WERR_NOMEM;
|
||||||
|
@ -138,7 +138,7 @@ static void dreplsrv_task_init(struct task_server *task)
|
|||||||
bool am_rodc;
|
bool am_rodc;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
switch (lp_server_role(task->lp_ctx)) {
|
switch (lpcfg_server_role(task->lp_ctx)) {
|
||||||
case ROLE_STANDALONE:
|
case ROLE_STANDALONE:
|
||||||
task_server_terminate(task, "dreplsrv: no DSDB replication required in standalone configuration",
|
task_server_terminate(task, "dreplsrv: no DSDB replication required in standalone configuration",
|
||||||
false);
|
false);
|
||||||
@ -187,8 +187,8 @@ static void dreplsrv_task_init(struct task_server *task)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
periodic_startup_interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_startup_interval", 15); /* in seconds */
|
periodic_startup_interval = lpcfg_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_startup_interval", 15); /* in seconds */
|
||||||
service->periodic.interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_interval", 300); /* in seconds */
|
service->periodic.interval = lpcfg_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_interval", 300); /* in seconds */
|
||||||
|
|
||||||
status = dreplsrv_periodic_schedule(service, periodic_startup_interval);
|
status = dreplsrv_periodic_schedule(service, periodic_startup_interval);
|
||||||
if (!W_ERROR_IS_OK(status)) {
|
if (!W_ERROR_IS_OK(status)) {
|
||||||
@ -201,7 +201,7 @@ static void dreplsrv_task_init(struct task_server *task)
|
|||||||
/* if we are a RODC then we do not send DSReplicaSync*/
|
/* if we are a RODC then we do not send DSReplicaSync*/
|
||||||
ret = samdb_rodc(service->samdb, &am_rodc);
|
ret = samdb_rodc(service->samdb, &am_rodc);
|
||||||
if (ret == LDB_SUCCESS && !am_rodc) {
|
if (ret == LDB_SUCCESS && !am_rodc) {
|
||||||
service->notify.interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv",
|
service->notify.interval = lpcfg_parm_int(task->lp_ctx, NULL, "dreplsrv",
|
||||||
"notify_interval", 5); /* in seconds */
|
"notify_interval", 5); /* in seconds */
|
||||||
status = dreplsrv_notify_schedule(service, service->notify.interval);
|
status = dreplsrv_notify_schedule(service, service->notify.interval);
|
||||||
if (!W_ERROR_IS_OK(status)) {
|
if (!W_ERROR_IS_OK(status)) {
|
||||||
|
@ -150,7 +150,7 @@ static int acl_module_init(struct ldb_module *module)
|
|||||||
}
|
}
|
||||||
|
|
||||||
data->password_attrs = NULL;
|
data->password_attrs = NULL;
|
||||||
data->acl_perform = lp_parm_bool(ldb_get_opaque(ldb, "loadparm"),
|
data->acl_perform = lpcfg_parm_bool(ldb_get_opaque(ldb, "loadparm"),
|
||||||
NULL, "acl", "perform", false);
|
NULL, "acl", "perform", false);
|
||||||
ldb_module_set_private(module, data);
|
ldb_module_set_private(module, data);
|
||||||
|
|
||||||
|
@ -459,7 +459,7 @@ static int kludge_acl_init(struct ldb_module *module)
|
|||||||
}
|
}
|
||||||
|
|
||||||
data->password_attrs = NULL;
|
data->password_attrs = NULL;
|
||||||
data->acl_perform = lp_parm_bool(ldb_get_opaque(ldb, "loadparm"),
|
data->acl_perform = lpcfg_parm_bool(ldb_get_opaque(ldb, "loadparm"),
|
||||||
NULL, "acl", "perform", false);
|
NULL, "acl", "perform", false);
|
||||||
ldb_module_set_private(module, data);
|
ldb_module_set_private(module, data);
|
||||||
|
|
||||||
|
@ -582,7 +582,7 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req)
|
|||||||
data->partitions[i]->ctrl->dn) != 0)) {
|
data->partitions[i]->ctrl->dn) != 0)) {
|
||||||
char *ref = talloc_asprintf(ac,
|
char *ref = talloc_asprintf(ac,
|
||||||
"ldap://%s/%s%s",
|
"ldap://%s/%s%s",
|
||||||
lp_dnsdomain(lp_ctx),
|
lpcfg_dnsdomain(lp_ctx),
|
||||||
ldb_dn_get_linearized(data->partitions[i]->ctrl->dn),
|
ldb_dn_get_linearized(data->partitions[i]->ctrl->dn),
|
||||||
req->op.search.scope == LDB_SCOPE_ONELEVEL ? "??base" : "");
|
req->op.search.scope == LDB_SCOPE_ONELEVEL ? "??base" : "");
|
||||||
|
|
||||||
|
@ -1404,7 +1404,7 @@ static int setup_password_fields(struct setup_password_fields_io *io)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp_lanman_auth(lp_ctx)) {
|
if (lpcfg_lanman_auth(lp_ctx)) {
|
||||||
ret = setup_lm_fields(io);
|
ret = setup_lm_fields(io);
|
||||||
if (ret != LDB_SUCCESS) {
|
if (ret != LDB_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
@ -1807,12 +1807,12 @@ static int setup_io(struct ph_context *ac,
|
|||||||
return LDB_ERR_UNWILLING_TO_PERFORM;
|
return LDB_ERR_UNWILLING_TO_PERFORM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp_lanman_auth(lp_ctx) && (lm_hash != NULL)) {
|
if (lpcfg_lanman_auth(lp_ctx) && (lm_hash != NULL)) {
|
||||||
io->n.lm_hash = talloc(io->ac, struct samr_Password);
|
io->n.lm_hash = talloc(io->ac, struct samr_Password);
|
||||||
memcpy(io->n.lm_hash->hash, lm_hash->data, MIN(lm_hash->length,
|
memcpy(io->n.lm_hash->hash, lm_hash->data, MIN(lm_hash->length,
|
||||||
sizeof(io->n.lm_hash->hash)));
|
sizeof(io->n.lm_hash->hash)));
|
||||||
}
|
}
|
||||||
if (lp_lanman_auth(lp_ctx) && (old_lm_hash != NULL)) {
|
if (lpcfg_lanman_auth(lp_ctx) && (old_lm_hash != NULL)) {
|
||||||
io->og.lm_hash = talloc(io->ac, struct samr_Password);
|
io->og.lm_hash = talloc(io->ac, struct samr_Password);
|
||||||
memcpy(io->og.lm_hash->hash, old_lm_hash->data, MIN(old_lm_hash->length,
|
memcpy(io->og.lm_hash->hash, old_lm_hash->data, MIN(old_lm_hash->length,
|
||||||
sizeof(io->og.lm_hash->hash)));
|
sizeof(io->og.lm_hash->hash)));
|
||||||
@ -2061,9 +2061,9 @@ static int get_domain_data_callback(struct ldb_request *req,
|
|||||||
lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
|
lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
|
||||||
struct loadparm_context);
|
struct loadparm_context);
|
||||||
|
|
||||||
ac->status->domain_data.dns_domain = lp_dnsdomain(lp_ctx);
|
ac->status->domain_data.dns_domain = lpcfg_dnsdomain(lp_ctx);
|
||||||
ac->status->domain_data.realm = lp_realm(lp_ctx);
|
ac->status->domain_data.realm = lpcfg_realm(lp_ctx);
|
||||||
ac->status->domain_data.netbios_domain = lp_sam_name(lp_ctx);
|
ac->status->domain_data.netbios_domain = lpcfg_sam_name(lp_ctx);
|
||||||
|
|
||||||
ac->status->reject_reason = SAM_PWD_CHANGE_NO_ERROR;
|
ac->status->reject_reason = SAM_PWD_CHANGE_NO_ERROR;
|
||||||
|
|
||||||
|
@ -2180,7 +2180,7 @@ static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
|
|||||||
|
|
||||||
referral = talloc_asprintf(req,
|
referral = talloc_asprintf(req,
|
||||||
"ldap://%s/%s",
|
"ldap://%s/%s",
|
||||||
lp_dnsdomain(lp_ctx),
|
lpcfg_dnsdomain(lp_ctx),
|
||||||
ldb_dn_get_linearized(msg->dn));
|
ldb_dn_get_linearized(msg->dn));
|
||||||
ret = ldb_module_send_referral(req, referral);
|
ret = ldb_module_send_referral(req, referral);
|
||||||
return ldb_module_done(req, NULL, NULL, ret);
|
return ldb_module_done(req, NULL, NULL, ret);
|
||||||
|
@ -72,7 +72,7 @@ static void ridalloc_poke_rid_manager(struct ldb_module *module)
|
|||||||
(struct loadparm_context *)ldb_get_opaque(ldb, "loadparm");
|
(struct loadparm_context *)ldb_get_opaque(ldb, "loadparm");
|
||||||
TALLOC_CTX *tmp_ctx = talloc_new(module);
|
TALLOC_CTX *tmp_ctx = talloc_new(module);
|
||||||
|
|
||||||
msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, lp_ctx),
|
msg = messaging_client_init(tmp_ctx, lpcfg_messaging_path(tmp_ctx, lp_ctx),
|
||||||
ldb_get_event_context(ldb));
|
ldb_get_event_context(ldb));
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
DEBUG(3,(__location__ ": Failed to create messaging context\n"));
|
DEBUG(3,(__location__ ": Failed to create messaging context\n"));
|
||||||
|
@ -56,7 +56,7 @@ static int samba3sid_next_sid(struct ldb_module *module,
|
|||||||
DSDB_FLAG_NEXT_MODULE |
|
DSDB_FLAG_NEXT_MODULE |
|
||||||
DSDB_SEARCH_SEARCH_ALL_PARTITIONS,
|
DSDB_SEARCH_SEARCH_ALL_PARTITIONS,
|
||||||
"(&(objectClass=sambaDomain)(sambaDomainName=%s))",
|
"(&(objectClass=sambaDomain)(sambaDomainName=%s))",
|
||||||
lp_sam_name(ldb_get_opaque(ldb, "loadparm")));
|
lpcfg_sam_name(ldb_get_opaque(ldb, "loadparm")));
|
||||||
if (ret != LDB_SUCCESS) {
|
if (ret != LDB_SUCCESS) {
|
||||||
ldb_asprintf_errstring(ldb,
|
ldb_asprintf_errstring(ldb,
|
||||||
__location__
|
__location__
|
||||||
|
@ -950,7 +950,7 @@ static int samldb_fill_object(struct samldb_ctx *ac, const char *type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! ac->sid) {
|
if ( ! ac->sid) {
|
||||||
sid_generator = lp_sid_generator(lp_ctx);
|
sid_generator = lpcfg_sid_generator(lp_ctx);
|
||||||
if (sid_generator == SID_GENERATOR_INTERNAL) {
|
if (sid_generator == SID_GENERATOR_INTERNAL) {
|
||||||
ret = samldb_add_step(ac, samldb_allocate_sid);
|
ret = samldb_add_step(ac, samldb_allocate_sid);
|
||||||
if (ret != LDB_SUCCESS) return ret;
|
if (ret != LDB_SUCCESS) return ret;
|
||||||
|
@ -127,7 +127,7 @@ struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
|
|||||||
{
|
{
|
||||||
struct ldb_context *ldb;
|
struct ldb_context *ldb;
|
||||||
ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx,
|
ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx,
|
||||||
lp_sam_url(lp_ctx), session_info,
|
lpcfg_sam_url(lp_ctx), session_info,
|
||||||
samdb_credentials(ev_ctx, lp_ctx),
|
samdb_credentials(ev_ctx, lp_ctx),
|
||||||
0);
|
0);
|
||||||
if (!ldb) {
|
if (!ldb) {
|
||||||
|
@ -517,7 +517,7 @@ static krb5_error_code samba_kdc_message2entry(krb5_context context,
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
krb5_error_code ret = 0;
|
krb5_error_code ret = 0;
|
||||||
krb5_boolean is_computer = FALSE;
|
krb5_boolean is_computer = FALSE;
|
||||||
char *realm = strupper_talloc(mem_ctx, lp_realm(lp_ctx));
|
char *realm = strupper_talloc(mem_ctx, lpcfg_realm(lp_ctx));
|
||||||
|
|
||||||
struct samba_kdc_entry *p;
|
struct samba_kdc_entry *p;
|
||||||
NTTIME acct_expiry;
|
NTTIME acct_expiry;
|
||||||
@ -604,7 +604,7 @@ static krb5_error_code samba_kdc_message2entry(krb5_context context,
|
|||||||
* their probably patheticly insecure password) */
|
* their probably patheticly insecure password) */
|
||||||
|
|
||||||
if (entry_ex->entry.flags.server
|
if (entry_ex->entry.flags.server
|
||||||
&& lp_parm_bool(lp_ctx, NULL, "kdc", "require spn for service", true)) {
|
&& lpcfg_parm_bool(lp_ctx, NULL, "kdc", "require spn for service", true)) {
|
||||||
if (!is_computer && !ldb_msg_find_attr_as_string(msg, "servicePrincipalName", NULL)) {
|
if (!is_computer && !ldb_msg_find_attr_as_string(msg, "servicePrincipalName", NULL)) {
|
||||||
entry_ex->entry.flags.server = 0;
|
entry_ex->entry.flags.server = 0;
|
||||||
}
|
}
|
||||||
@ -663,7 +663,7 @@ static krb5_error_code samba_kdc_message2entry(krb5_context context,
|
|||||||
&& principal->name.name_string.len == 2
|
&& principal->name.name_string.len == 2
|
||||||
&& (strcmp(principal->name.name_string.val[0], "kadmin") == 0)
|
&& (strcmp(principal->name.name_string.val[0], "kadmin") == 0)
|
||||||
&& (strcmp(principal->name.name_string.val[1], "changepw") == 0)
|
&& (strcmp(principal->name.name_string.val[1], "changepw") == 0)
|
||||||
&& lp_is_my_domain_or_realm(lp_ctx, principal->realm)) {
|
&& lpcfg_is_my_domain_or_realm(lp_ctx, principal->realm)) {
|
||||||
entry_ex->entry.flags.change_pw = 1;
|
entry_ex->entry.flags.change_pw = 1;
|
||||||
}
|
}
|
||||||
entry_ex->entry.flags.client = 0;
|
entry_ex->entry.flags.client = 0;
|
||||||
@ -769,7 +769,7 @@ static krb5_error_code samba_kdc_trust_message2entry(krb5_context context,
|
|||||||
{
|
{
|
||||||
struct loadparm_context *lp_ctx = kdc_db_ctx->lp_ctx;
|
struct loadparm_context *lp_ctx = kdc_db_ctx->lp_ctx;
|
||||||
const char *dnsdomain;
|
const char *dnsdomain;
|
||||||
char *realm = strupper_talloc(mem_ctx, lp_realm(lp_ctx));
|
char *realm = strupper_talloc(mem_ctx, lpcfg_realm(lp_ctx));
|
||||||
DATA_BLOB password_utf16;
|
DATA_BLOB password_utf16;
|
||||||
struct samr_Password password_hash;
|
struct samr_Password password_hash;
|
||||||
const struct ldb_val *password_val;
|
const struct ldb_val *password_val;
|
||||||
@ -1052,8 +1052,8 @@ static krb5_error_code samba_kdc_fetch_krbtgt(krb5_context context,
|
|||||||
|
|
||||||
/* krbtgt case. Either us or a trusted realm */
|
/* krbtgt case. Either us or a trusted realm */
|
||||||
|
|
||||||
if (lp_is_my_domain_or_realm(lp_ctx, principal->realm)
|
if (lpcfg_is_my_domain_or_realm(lp_ctx, principal->realm)
|
||||||
&& lp_is_my_domain_or_realm(lp_ctx, principal->name.name_string.val[1])) {
|
&& lpcfg_is_my_domain_or_realm(lp_ctx, principal->name.name_string.val[1])) {
|
||||||
/* us */
|
/* us */
|
||||||
/* Cludge, cludge cludge. If the realm part of krbtgt/realm,
|
/* Cludge, cludge cludge. If the realm part of krbtgt/realm,
|
||||||
* is in our db, then direct the caller at our primary
|
* is in our db, then direct the caller at our primary
|
||||||
@ -1077,7 +1077,7 @@ static krb5_error_code samba_kdc_fetch_krbtgt(krb5_context context,
|
|||||||
return HDB_ERR_NOENTRY;
|
return HDB_ERR_NOENTRY;
|
||||||
}
|
}
|
||||||
|
|
||||||
realm_fixed = strupper_talloc(mem_ctx, lp_realm(lp_ctx));
|
realm_fixed = strupper_talloc(mem_ctx, lpcfg_realm(lp_ctx));
|
||||||
if (!realm_fixed) {
|
if (!realm_fixed) {
|
||||||
ret = ENOMEM;
|
ret = ENOMEM;
|
||||||
krb5_set_error_message(context, ret, "strupper_talloc: out of memory");
|
krb5_set_error_message(context, ret, "strupper_talloc: out of memory");
|
||||||
@ -1112,13 +1112,13 @@ static krb5_error_code samba_kdc_fetch_krbtgt(krb5_context context,
|
|||||||
|
|
||||||
/* Either an inbound or outbound trust */
|
/* Either an inbound or outbound trust */
|
||||||
|
|
||||||
if (strcasecmp(lp_realm(lp_ctx), principal->realm) == 0) {
|
if (strcasecmp(lpcfg_realm(lp_ctx), principal->realm) == 0) {
|
||||||
/* look for inbound trust */
|
/* look for inbound trust */
|
||||||
direction = INBOUND;
|
direction = INBOUND;
|
||||||
realm = principal->name.name_string.val[1];
|
realm = principal->name.name_string.val[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp(lp_realm(lp_ctx), principal->name.name_string.val[1]) == 0) {
|
if (strcasecmp(lpcfg_realm(lp_ctx), principal->name.name_string.val[1]) == 0) {
|
||||||
/* look for outbound trust */
|
/* look for outbound trust */
|
||||||
direction = OUTBOUND;
|
direction = OUTBOUND;
|
||||||
realm = principal->realm;
|
realm = principal->realm;
|
||||||
|
@ -483,7 +483,7 @@ static NTSTATUS kdc_add_socket(struct kdc_server *kdc,
|
|||||||
model_ops,
|
model_ops,
|
||||||
&kdc_tcp_stream_ops,
|
&kdc_tcp_stream_ops,
|
||||||
"ip", address, &port,
|
"ip", address, &port,
|
||||||
lp_socket_options(kdc->task->lp_ctx),
|
lpcfg_socket_options(kdc->task->lp_ctx),
|
||||||
kdc_socket);
|
kdc_socket);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(0,("Failed to bind to %s:%u TCP - %s\n",
|
DEBUG(0,("Failed to bind to %s:%u TCP - %s\n",
|
||||||
@ -547,8 +547,8 @@ static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc, struct loadparm_c
|
|||||||
|
|
||||||
for (i=0; i<num_interfaces; i++) {
|
for (i=0; i<num_interfaces; i++) {
|
||||||
const char *address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
|
const char *address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
|
||||||
uint16_t kdc_port = lp_krb5_port(lp_ctx);
|
uint16_t kdc_port = lpcfg_krb5_port(lp_ctx);
|
||||||
uint16_t kpasswd_port = lp_kpasswd_port(lp_ctx);
|
uint16_t kpasswd_port = lpcfg_kpasswd_port(lp_ctx);
|
||||||
|
|
||||||
if (kdc_port) {
|
if (kdc_port) {
|
||||||
status = kdc_add_socket(kdc, model_ops,
|
status = kdc_add_socket(kdc, model_ops,
|
||||||
@ -620,8 +620,8 @@ static NTSTATUS kdc_check_generic_kerberos(struct irpc_message *msg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = krb5_make_principal(kdc->smb_krb5_context->krb5_context, &principal,
|
ret = krb5_make_principal(kdc->smb_krb5_context->krb5_context, &principal,
|
||||||
lp_realm(kdc->task->lp_ctx),
|
lpcfg_realm(kdc->task->lp_ctx),
|
||||||
"krbtgt", lp_realm(kdc->task->lp_ctx),
|
"krbtgt", lpcfg_realm(kdc->task->lp_ctx),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
@ -678,7 +678,7 @@ static void kdc_task_init(struct task_server *task)
|
|||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
|
|
||||||
switch (lp_server_role(task->lp_ctx)) {
|
switch (lpcfg_server_role(task->lp_ctx)) {
|
||||||
case ROLE_STANDALONE:
|
case ROLE_STANDALONE:
|
||||||
task_server_terminate(task, "kdc: no KDC required in standalone configuration", false);
|
task_server_terminate(task, "kdc: no KDC required in standalone configuration", false);
|
||||||
return;
|
return;
|
||||||
@ -690,7 +690,7 @@ static void kdc_task_init(struct task_server *task)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
|
load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
|
||||||
|
|
||||||
if (iface_count(ifaces) == 0) {
|
if (iface_count(ifaces) == 0) {
|
||||||
task_server_terminate(task, "kdc: no network interfaces configured", false);
|
task_server_terminate(task, "kdc: no network interfaces configured", false);
|
||||||
|
@ -222,7 +222,7 @@ static bool kpasswd_process_request(struct kdc_server *kdc,
|
|||||||
case KRB5_KPASSWD_VERS_CHANGEPW:
|
case KRB5_KPASSWD_VERS_CHANGEPW:
|
||||||
{
|
{
|
||||||
DATA_BLOB password;
|
DATA_BLOB password;
|
||||||
if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(kdc->task->lp_ctx),
|
if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(kdc->task->lp_ctx),
|
||||||
CH_UTF8, CH_UTF16,
|
CH_UTF8, CH_UTF16,
|
||||||
(const char *)input->data,
|
(const char *)input->data,
|
||||||
input->length,
|
input->length,
|
||||||
@ -262,7 +262,7 @@ static bool kpasswd_process_request(struct kdc_server *kdc,
|
|||||||
reply);
|
reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(kdc->task->lp_ctx),
|
if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(kdc->task->lp_ctx),
|
||||||
CH_UTF8, CH_UTF16,
|
CH_UTF8, CH_UTF16,
|
||||||
(const char *)chpw.newpasswd.data,
|
(const char *)chpw.newpasswd.data,
|
||||||
chpw.newpasswd.length,
|
chpw.newpasswd.length,
|
||||||
|
@ -82,11 +82,11 @@ static int mit_samba_context_init(struct mit_samba_context **_ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* init s4 configuration */
|
/* init s4 configuration */
|
||||||
s4_conf_file = lp_configfile(ctx->db_ctx->lp_ctx);
|
s4_conf_file = lpcfg_configfile(ctx->db_ctx->lp_ctx);
|
||||||
if (s4_conf_file) {
|
if (s4_conf_file) {
|
||||||
lp_load(ctx->db_ctx->lp_ctx, s4_conf_file);
|
lpcfg_load(ctx->db_ctx->lp_ctx, s4_conf_file);
|
||||||
} else {
|
} else {
|
||||||
lp_load_default(ctx->db_ctx->lp_ctx);
|
lpcfg_load_default(ctx->db_ctx->lp_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->session_info = system_session(ctx->db_ctx->lp_ctx);
|
ctx->session_info = system_session(ctx->db_ctx->lp_ctx);
|
||||||
|
@ -140,8 +140,8 @@ NTSTATUS samba_kdc_get_pac_blob(TALLOC_CTX *mem_ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
nt_status = authsam_make_server_info(mem_ctx, p->kdc_db_ctx->samdb,
|
nt_status = authsam_make_server_info(mem_ctx, p->kdc_db_ctx->samdb,
|
||||||
lp_netbios_name(p->kdc_db_ctx->lp_ctx),
|
lpcfg_netbios_name(p->kdc_db_ctx->lp_ctx),
|
||||||
lp_sam_name(p->kdc_db_ctx->lp_ctx),
|
lpcfg_sam_name(p->kdc_db_ctx->lp_ctx),
|
||||||
p->realm_dn,
|
p->realm_dn,
|
||||||
p->msg,
|
p->msg,
|
||||||
data_blob(NULL, 0),
|
data_blob(NULL, 0),
|
||||||
|
@ -184,7 +184,7 @@ NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn)
|
|||||||
conn->ldb = ldb_wrap_connect(conn,
|
conn->ldb = ldb_wrap_connect(conn,
|
||||||
conn->connection->event.ctx,
|
conn->connection->event.ctx,
|
||||||
conn->lp_ctx,
|
conn->lp_ctx,
|
||||||
lp_sam_url(conn->lp_ctx),
|
lpcfg_sam_url(conn->lp_ctx),
|
||||||
conn->session_info,
|
conn->session_info,
|
||||||
samdb_credentials(conn->connection->event.ctx, conn->lp_ctx),
|
samdb_credentials(conn->connection->event.ctx, conn->lp_ctx),
|
||||||
conn->global_catalog ? LDB_FLG_RDONLY : 0);
|
conn->global_catalog ? LDB_FLG_RDONLY : 0);
|
||||||
@ -199,7 +199,7 @@ NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn)
|
|||||||
= gensec_use_kerberos_mechs(conn, backends, conn->server_credentials);
|
= gensec_use_kerberos_mechs(conn, backends, conn->server_credentials);
|
||||||
unsigned int i, j = 0;
|
unsigned int i, j = 0;
|
||||||
for (i = 0; ops && ops[i]; i++) {
|
for (i = 0; ops && ops[i]; i++) {
|
||||||
if (!lp_parm_bool(conn->lp_ctx, NULL, "gensec", ops[i]->name, ops[i]->enabled))
|
if (!lpcfg_parm_bool(conn->lp_ctx, NULL, "gensec", ops[i]->name, ops[i]->enabled))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ops[i]->sasl_name && ops[i]->server_start) {
|
if (ops[i]->sasl_name && ops[i]->server_start) {
|
||||||
|
@ -501,7 +501,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context,
|
|||||||
status = stream_setup_socket(event_context, lp_ctx,
|
status = stream_setup_socket(event_context, lp_ctx,
|
||||||
model_ops, &ldap_stream_nonpriv_ops,
|
model_ops, &ldap_stream_nonpriv_ops,
|
||||||
"ipv4", address, &port,
|
"ipv4", address, &port,
|
||||||
lp_socket_options(lp_ctx),
|
lpcfg_socket_options(lp_ctx),
|
||||||
ldap_service);
|
ldap_service);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
|
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
|
||||||
@ -516,7 +516,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context,
|
|||||||
model_ops,
|
model_ops,
|
||||||
&ldap_stream_nonpriv_ops,
|
&ldap_stream_nonpriv_ops,
|
||||||
"ipv4", address, &port,
|
"ipv4", address, &port,
|
||||||
lp_socket_options(lp_ctx),
|
lpcfg_socket_options(lp_ctx),
|
||||||
ldap_service);
|
ldap_service);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
|
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
|
||||||
@ -538,7 +538,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context,
|
|||||||
model_ops,
|
model_ops,
|
||||||
&ldap_stream_nonpriv_ops,
|
&ldap_stream_nonpriv_ops,
|
||||||
"ipv4", address, &port,
|
"ipv4", address, &port,
|
||||||
lp_socket_options(lp_ctx),
|
lpcfg_socket_options(lp_ctx),
|
||||||
ldap_service);
|
ldap_service);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
|
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
|
||||||
@ -567,7 +567,7 @@ static void ldapsrv_task_init(struct task_server *task)
|
|||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
const struct model_ops *model_ops;
|
const struct model_ops *model_ops;
|
||||||
|
|
||||||
switch (lp_server_role(task->lp_ctx)) {
|
switch (lpcfg_server_role(task->lp_ctx)) {
|
||||||
case ROLE_STANDALONE:
|
case ROLE_STANDALONE:
|
||||||
task_server_terminate(task, "ldap_server: no LDAP server required in standalone configuration",
|
task_server_terminate(task, "ldap_server: no LDAP server required in standalone configuration",
|
||||||
false);
|
false);
|
||||||
@ -595,12 +595,12 @@ static void ldapsrv_task_init(struct task_server *task)
|
|||||||
ldap_service->tls_params = tls_initialise(ldap_service, task->lp_ctx);
|
ldap_service->tls_params = tls_initialise(ldap_service, task->lp_ctx);
|
||||||
if (ldap_service->tls_params == NULL) goto failed;
|
if (ldap_service->tls_params == NULL) goto failed;
|
||||||
|
|
||||||
if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) {
|
if (lpcfg_interfaces(task->lp_ctx) && lpcfg_bind_interfaces_only(task->lp_ctx)) {
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
int num_interfaces;
|
int num_interfaces;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
|
load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
|
||||||
num_interfaces = iface_count(ifaces);
|
num_interfaces = iface_count(ifaces);
|
||||||
|
|
||||||
/* We have been given an interfaces line, and been
|
/* We have been given an interfaces line, and been
|
||||||
@ -614,7 +614,7 @@ static void ldapsrv_task_init(struct task_server *task)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
status = add_socket(task->event_ctx, task->lp_ctx, model_ops,
|
status = add_socket(task->event_ctx, task->lp_ctx, model_ops,
|
||||||
lp_socket_address(task->lp_ctx), ldap_service);
|
lpcfg_socket_address(task->lp_ctx), ldap_service);
|
||||||
if (!NT_STATUS_IS_OK(status)) goto failed;
|
if (!NT_STATUS_IS_OK(status)) goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ static void ldapsrv_task_init(struct task_server *task)
|
|||||||
status = stream_setup_socket(task->event_ctx, task->lp_ctx,
|
status = stream_setup_socket(task->event_ctx, task->lp_ctx,
|
||||||
model_ops, &ldap_stream_nonpriv_ops,
|
model_ops, &ldap_stream_nonpriv_ops,
|
||||||
"unix", ldapi_path, NULL,
|
"unix", ldapi_path, NULL,
|
||||||
lp_socket_options(task->lp_ctx),
|
lpcfg_socket_options(task->lp_ctx),
|
||||||
ldap_service);
|
ldap_service);
|
||||||
talloc_free(ldapi_path);
|
talloc_free(ldapi_path);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -657,7 +657,7 @@ static void ldapsrv_task_init(struct task_server *task)
|
|||||||
status = stream_setup_socket(task->event_ctx, task->lp_ctx,
|
status = stream_setup_socket(task->event_ctx, task->lp_ctx,
|
||||||
model_ops, &ldap_stream_priv_ops,
|
model_ops, &ldap_stream_priv_ops,
|
||||||
"unix", ldapi_path, NULL,
|
"unix", ldapi_path, NULL,
|
||||||
lp_socket_options(task->lp_ctx),
|
lpcfg_socket_options(task->lp_ctx),
|
||||||
ldap_service);
|
ldap_service);
|
||||||
talloc_free(ldapi_path);
|
talloc_free(ldapi_path);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
@ -66,8 +66,8 @@ static void popt_samba_callback(poptContext con,
|
|||||||
const char *pname;
|
const char *pname;
|
||||||
|
|
||||||
if (reason == POPT_CALLBACK_REASON_POST) {
|
if (reason == POPT_CALLBACK_REASON_POST) {
|
||||||
if (lp_configfile(cmdline_lp_ctx) == NULL) {
|
if (lpcfg_configfile(cmdline_lp_ctx) == NULL) {
|
||||||
lp_load_default(cmdline_lp_ctx);
|
lpcfg_load_default(cmdline_lp_ctx);
|
||||||
}
|
}
|
||||||
/* Hook any 'every Samba program must do this, after
|
/* Hook any 'every Samba program must do this, after
|
||||||
* the smb.conf is setup' functions here */
|
* the smb.conf is setup' functions here */
|
||||||
@ -108,14 +108,14 @@ static void popt_samba_callback(poptContext con,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_OPTION:
|
case OPT_OPTION:
|
||||||
if (!lp_set_option(cmdline_lp_ctx, arg)) {
|
if (!lpcfg_set_option(cmdline_lp_ctx, arg)) {
|
||||||
fprintf(stderr, "Error setting option '%s'\n", arg);
|
fprintf(stderr, "Error setting option '%s'\n", arg);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
lp_set_cmdline(cmdline_lp_ctx, "log level", arg);
|
lpcfg_set_cmdline(cmdline_lp_ctx, "log level", arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_DEBUG_STDERR:
|
case OPT_DEBUG_STDERR:
|
||||||
@ -124,14 +124,14 @@ static void popt_samba_callback(poptContext con,
|
|||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
if (arg) {
|
if (arg) {
|
||||||
lp_load(cmdline_lp_ctx, arg);
|
lpcfg_load(cmdline_lp_ctx, arg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
if (arg) {
|
if (arg) {
|
||||||
char *new_logfile = talloc_asprintf(NULL, "%s/log.%s", arg, pname);
|
char *new_logfile = talloc_asprintf(NULL, "%s/log.%s", arg, pname);
|
||||||
lp_set_cmdline(cmdline_lp_ctx, "log file", new_logfile);
|
lpcfg_set_cmdline(cmdline_lp_ctx, "log file", new_logfile);
|
||||||
talloc_free(new_logfile);
|
talloc_free(new_logfile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -152,36 +152,36 @@ static void popt_common_callback(poptContext con,
|
|||||||
switch(opt->val) {
|
switch(opt->val) {
|
||||||
case 'O':
|
case 'O':
|
||||||
if (arg) {
|
if (arg) {
|
||||||
lp_set_cmdline(lp_ctx, "socket options", arg);
|
lpcfg_set_cmdline(lp_ctx, "socket options", arg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'W':
|
case 'W':
|
||||||
lp_set_cmdline(lp_ctx, "workgroup", arg);
|
lpcfg_set_cmdline(lp_ctx, "workgroup", arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
lp_set_cmdline(lp_ctx, "realm", arg);
|
lpcfg_set_cmdline(lp_ctx, "realm", arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
lp_set_cmdline(lp_ctx, "netbios name", arg);
|
lpcfg_set_cmdline(lp_ctx, "netbios name", arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'i':
|
case 'i':
|
||||||
lp_set_cmdline(lp_ctx, "netbios scope", arg);
|
lpcfg_set_cmdline(lp_ctx, "netbios scope", arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'm':
|
case 'm':
|
||||||
lp_set_cmdline(lp_ctx, "client max protocol", arg);
|
lpcfg_set_cmdline(lp_ctx, "client max protocol", arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'R':
|
case 'R':
|
||||||
lp_set_cmdline(lp_ctx, "name resolve order", arg);
|
lpcfg_set_cmdline(lp_ctx, "name resolve order", arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'S':
|
case 'S':
|
||||||
lp_set_cmdline(lp_ctx, "client signing", arg);
|
lpcfg_set_cmdline(lp_ctx, "client signing", arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx,
|
|||||||
if (server == NULL) {
|
if (server == NULL) {
|
||||||
return dcerpc_pipe_connect(ctx->event_ctx, p, "ncalrpc",
|
return dcerpc_pipe_connect(ctx->event_ctx, p, "ncalrpc",
|
||||||
&ndr_table_IRemoteActivation,
|
&ndr_table_IRemoteActivation,
|
||||||
dcom_get_server_credentials(ctx, NULL), ctx->event_ctx, ctx->lp_ctx);
|
dcom_get_server_credentials(ctx, NULL), ctx->event_ctx, ctx->lp_ctx);
|
||||||
}
|
}
|
||||||
loc_ctx = talloc_new(ctx);
|
loc_ctx = talloc_new(ctx);
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx,
|
|||||||
bd->flags |= DCERPC_DEBUG_PRINT_BOTH;
|
bd->flags |= DCERPC_DEBUG_PRINT_BOTH;
|
||||||
status = dcerpc_pipe_connect_b(ctx->event_ctx, p, bd,
|
status = dcerpc_pipe_connect_b(ctx->event_ctx, p, bd,
|
||||||
&ndr_table_IRemoteActivation,
|
&ndr_table_IRemoteActivation,
|
||||||
dcom_get_server_credentials(ctx, bd->host), ctx->event_ctx, ctx->lp_ctx);
|
dcom_get_server_credentials(ctx, bd->host), ctx->event_ctx, ctx->lp_ctx);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w)
|
|||||||
ldb_set_modules_dir(ldb,
|
ldb_set_modules_dir(ldb,
|
||||||
talloc_asprintf(ldb,
|
talloc_asprintf(ldb,
|
||||||
"%s/ldb",
|
"%s/ldb",
|
||||||
lp_modulesdir(lp_ctx)));
|
lpcfg_modulesdir(lp_ctx)));
|
||||||
|
|
||||||
if (session_info) {
|
if (session_info) {
|
||||||
if (ldb_set_opaque(ldb, "sessionInfo", session_info)) {
|
if (ldb_set_opaque(ldb, "sessionInfo", session_info)) {
|
||||||
@ -197,7 +197,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) {
|
if (lp_ctx != NULL && strcmp(lpcfg_sam_url(lp_ctx), url) == 0) {
|
||||||
dsdb_set_global_schema(ldb);
|
dsdb_set_global_schema(ldb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* allow admins to force non-sync ldb for all databases */
|
/* allow admins to force non-sync ldb for all databases */
|
||||||
if (lp_parm_bool(lp_ctx, NULL, "ldb", "nosync", false)) {
|
if (lpcfg_parm_bool(lp_ctx, NULL, "ldb", "nosync", false)) {
|
||||||
flags |= LDB_FLG_NOSYNC;
|
flags |= LDB_FLG_NOSYNC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w)
|
|||||||
DLIST_ADD(ldb_wrap_list, w);
|
DLIST_ADD(ldb_wrap_list, w);
|
||||||
|
|
||||||
/* make the resulting schema global */
|
/* make the resulting schema global */
|
||||||
if (lp_ctx != NULL && strcmp(lp_sam_url(lp_ctx), url) == 0) {
|
if (lp_ctx != NULL && strcmp(lpcfg_sam_url(lp_ctx), url) == 0) {
|
||||||
struct dsdb_schema *schema = dsdb_get_schema(ldb, NULL);
|
struct dsdb_schema *schema = dsdb_get_schema(ldb, NULL);
|
||||||
if (schema) {
|
if (schema) {
|
||||||
dsdb_make_schema_global(ldb, schema);
|
dsdb_make_schema_global(ldb, schema);
|
||||||
|
@ -56,7 +56,7 @@ static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args)
|
|||||||
|
|
||||||
ldb = PyLdb_AsLdbContext(self);
|
ldb = PyLdb_AsLdbContext(self);
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(ldb, py_lp_ctx);
|
lp_ctx = lpcfg_from_py_object(ldb, py_lp_ctx);
|
||||||
if (lp_ctx == NULL) {
|
if (lp_ctx == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Expected loadparm object");
|
PyErr_SetString(PyExc_TypeError, "Expected loadparm object");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -84,7 +84,7 @@ PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObject *kwa
|
|||||||
ev = s4_event_context_init(ret->mem_ctx);
|
ev = s4_event_context_init(ret->mem_ctx);
|
||||||
|
|
||||||
if (messaging_path == NULL) {
|
if (messaging_path == NULL) {
|
||||||
messaging_path = lp_messaging_path(ret->mem_ctx,
|
messaging_path = lpcfg_messaging_path(ret->mem_ctx,
|
||||||
py_default_loadparm_context(ret->mem_ctx));
|
py_default_loadparm_context(ret->mem_ctx));
|
||||||
} else {
|
} else {
|
||||||
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
|
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
|
||||||
@ -338,7 +338,7 @@ PyObject *py_irpc_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
|
|||||||
ev = s4_event_context_init(ret->mem_ctx);
|
ev = s4_event_context_init(ret->mem_ctx);
|
||||||
|
|
||||||
if (messaging_path == NULL) {
|
if (messaging_path == NULL) {
|
||||||
messaging_path = lp_messaging_path(ret->mem_ctx,
|
messaging_path = lpcfg_messaging_path(ret->mem_ctx,
|
||||||
py_default_loadparm_context(ret->mem_ctx));
|
py_default_loadparm_context(ret->mem_ctx));
|
||||||
} else {
|
} else {
|
||||||
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
|
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
|
||||||
|
@ -215,19 +215,19 @@ static bool irpc_setup(struct torture_context *tctx, void **_data)
|
|||||||
|
|
||||||
*_data = data = talloc(tctx, struct irpc_test_data);
|
*_data = data = talloc(tctx, struct irpc_test_data);
|
||||||
|
|
||||||
lp_set_cmdline(tctx->lp_ctx, "pid directory", "piddir.tmp");
|
lpcfg_set_cmdline(tctx->lp_ctx, "pid directory", "piddir.tmp");
|
||||||
|
|
||||||
data->ev = tctx->ev;
|
data->ev = tctx->ev;
|
||||||
torture_assert(tctx, data->msg_ctx1 =
|
torture_assert(tctx, data->msg_ctx1 =
|
||||||
messaging_init(tctx,
|
messaging_init(tctx,
|
||||||
lp_messaging_path(tctx, tctx->lp_ctx),
|
lpcfg_messaging_path(tctx, tctx->lp_ctx),
|
||||||
cluster_id(0, MSG_ID1),
|
cluster_id(0, MSG_ID1),
|
||||||
data->ev),
|
data->ev),
|
||||||
"Failed to init first messaging context");
|
"Failed to init first messaging context");
|
||||||
|
|
||||||
torture_assert(tctx, data->msg_ctx2 =
|
torture_assert(tctx, data->msg_ctx2 =
|
||||||
messaging_init(tctx,
|
messaging_init(tctx,
|
||||||
lp_messaging_path(tctx, tctx->lp_ctx),
|
lpcfg_messaging_path(tctx, tctx->lp_ctx),
|
||||||
cluster_id(0, MSG_ID2),
|
cluster_id(0, MSG_ID2),
|
||||||
data->ev),
|
data->ev),
|
||||||
"Failed to init second messaging context");
|
"Failed to init second messaging context");
|
||||||
|
@ -67,12 +67,12 @@ static bool test_ping_speed(struct torture_context *tctx)
|
|||||||
int timelimit = torture_setting_int(tctx, "timelimit", 10);
|
int timelimit = torture_setting_int(tctx, "timelimit", 10);
|
||||||
uint32_t msg_ping, msg_exit;
|
uint32_t msg_ping, msg_exit;
|
||||||
|
|
||||||
lp_set_cmdline(tctx->lp_ctx, "pid directory", "piddir.tmp");
|
lpcfg_set_cmdline(tctx->lp_ctx, "pid directory", "piddir.tmp");
|
||||||
|
|
||||||
ev = tctx->ev;
|
ev = tctx->ev;
|
||||||
|
|
||||||
msg_server_ctx = messaging_init(tctx,
|
msg_server_ctx = messaging_init(tctx,
|
||||||
lp_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1),
|
lpcfg_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1),
|
||||||
ev);
|
ev);
|
||||||
|
|
||||||
torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
|
torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
|
||||||
@ -81,7 +81,7 @@ static bool test_ping_speed(struct torture_context *tctx)
|
|||||||
messaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit);
|
messaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit);
|
||||||
|
|
||||||
msg_client_ctx = messaging_init(tctx,
|
msg_client_ctx = messaging_init(tctx,
|
||||||
lp_messaging_path(tctx, tctx->lp_ctx),
|
lpcfg_messaging_path(tctx, tctx->lp_ctx),
|
||||||
cluster_id(0, 2),
|
cluster_id(0, 2),
|
||||||
ev);
|
ev);
|
||||||
|
|
||||||
|
@ -161,23 +161,23 @@ static NTSTATUS gp_cli_connect(struct gp_context *gp_ctx)
|
|||||||
|
|
||||||
gp_ctx->cli = smbcli_state_init(gp_ctx);
|
gp_ctx->cli = smbcli_state_init(gp_ctx);
|
||||||
|
|
||||||
lp_smbcli_options(gp_ctx->lp_ctx, &options);
|
lpcfg_smbcli_options(gp_ctx->lp_ctx, &options);
|
||||||
lp_smbcli_session_options(gp_ctx->lp_ctx, &session_options);
|
lpcfg_smbcli_session_options(gp_ctx->lp_ctx, &session_options);
|
||||||
|
|
||||||
|
|
||||||
return smbcli_full_connection(gp_ctx,
|
return smbcli_full_connection(gp_ctx,
|
||||||
&gp_ctx->cli,
|
&gp_ctx->cli,
|
||||||
gp_ctx->active_dc.name,
|
gp_ctx->active_dc.name,
|
||||||
lp_smb_ports(gp_ctx->lp_ctx),
|
lpcfg_smb_ports(gp_ctx->lp_ctx),
|
||||||
"sysvol",
|
"sysvol",
|
||||||
NULL,
|
NULL,
|
||||||
lp_socket_options(gp_ctx->lp_ctx),
|
lpcfg_socket_options(gp_ctx->lp_ctx),
|
||||||
gp_ctx->credentials,
|
gp_ctx->credentials,
|
||||||
lp_resolve_context(gp_ctx->lp_ctx),
|
lpcfg_resolve_context(gp_ctx->lp_ctx),
|
||||||
gp_ctx->ev_ctx,
|
gp_ctx->ev_ctx,
|
||||||
&options,
|
&options,
|
||||||
&session_options,
|
&session_options,
|
||||||
lp_gensec_settings(gp_ctx, gp_ctx->lp_ctx));
|
lpcfg_gensec_settings(gp_ctx, gp_ctx->lp_ctx));
|
||||||
|
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ NTSTATUS gp_init(TALLOC_CTX *mem_ctx,
|
|||||||
io = talloc_zero(mem_ctx, struct libnet_LookupDCs);
|
io = talloc_zero(mem_ctx, struct libnet_LookupDCs);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(io);
|
NT_STATUS_HAVE_NO_MEMORY(io);
|
||||||
io->in.name_type = NBT_NAME_PDC;
|
io->in.name_type = NBT_NAME_PDC;
|
||||||
io->in.domain_name = lp_workgroup(lp_ctx);
|
io->in.domain_name = lpcfg_workgroup(lp_ctx);
|
||||||
|
|
||||||
/* Find Active DC's */
|
/* Find Active DC's */
|
||||||
rv = libnet_LookupDCs(net_ctx, mem_ctx, io);
|
rv = libnet_LookupDCs(net_ctx, mem_ctx, io);
|
||||||
|
@ -156,7 +156,7 @@ NTSTATUS gp_create_gpo (struct gp_context *gp_ctx, const char *display_name, str
|
|||||||
gpo->display_name = talloc_strdup(gpo, display_name);
|
gpo->display_name = talloc_strdup(gpo, display_name);
|
||||||
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(gpo->display_name, mem_ctx);
|
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(gpo->display_name, mem_ctx);
|
||||||
|
|
||||||
gpo->file_sys_path = talloc_asprintf(gpo, "\\\\%s\\sysvol\\%s\\Policies\\%s", lp_dnsdomain(gp_ctx->lp_ctx), lp_dnsdomain(gp_ctx->lp_ctx), name);
|
gpo->file_sys_path = talloc_asprintf(gpo, "\\\\%s\\sysvol\\%s\\Policies\\%s", lpcfg_dnsdomain(gp_ctx->lp_ctx), lpcfg_dnsdomain(gp_ctx->lp_ctx), name);
|
||||||
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(gpo->file_sys_path, mem_ctx);
|
NT_STATUS_HAVE_NO_MEMORY_AND_FREE(gpo->file_sys_path, mem_ctx);
|
||||||
|
|
||||||
/* Create the GPT */
|
/* Create the GPT */
|
||||||
|
@ -275,7 +275,7 @@ static PyObject *py_open_samba(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||||||
&py_credentials))
|
&py_credentials))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
||||||
if (lp_ctx == NULL) {
|
if (lp_ctx == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -346,7 +346,7 @@ static PyObject *py_open_ldb_file(PyObject *self, PyObject *args, PyObject *kwar
|
|||||||
&py_credentials, &py_lp_ctx))
|
&py_credentials, &py_lp_ctx))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
|
||||||
if (lp_ctx == NULL) {
|
if (lp_ctx == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -38,7 +38,7 @@ static WERROR mount_samba_hive(struct registry_context *ctx,
|
|||||||
const char *location;
|
const char *location;
|
||||||
|
|
||||||
location = talloc_asprintf(ctx, "%s/%s.ldb",
|
location = talloc_asprintf(ctx, "%s/%s.ldb",
|
||||||
lp_private_dir(lp_ctx),
|
lpcfg_private_dir(lp_ctx),
|
||||||
name);
|
name);
|
||||||
W_ERROR_HAVE_NO_MEMORY(location);
|
W_ERROR_HAVE_NO_MEMORY(location);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ static bool test_udp(struct torture_context *tctx)
|
|||||||
TALLOC_CTX *mem_ctx = tctx;
|
TALLOC_CTX *mem_ctx = tctx;
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
|
|
||||||
load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
|
load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
|
||||||
|
|
||||||
status = socket_create("ip", SOCKET_TYPE_DGRAM, &sock1, 0);
|
status = socket_create("ip", SOCKET_TYPE_DGRAM, &sock1, 0);
|
||||||
torture_assert_ntstatus_ok(tctx, status, "creating DGRAM IP socket 1");
|
torture_assert_ntstatus_ok(tctx, status, "creating DGRAM IP socket 1");
|
||||||
@ -135,7 +135,7 @@ static bool test_tcp(struct torture_context *tctx)
|
|||||||
torture_assert_ntstatus_ok(tctx, status, "creating IP stream socket 1");
|
torture_assert_ntstatus_ok(tctx, status, "creating IP stream socket 1");
|
||||||
talloc_steal(mem_ctx, sock2);
|
talloc_steal(mem_ctx, sock2);
|
||||||
|
|
||||||
load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
|
load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
|
||||||
localhost = socket_address_from_strings(sock1, sock1->backend_name,
|
localhost = socket_address_from_strings(sock1, sock1->backend_name,
|
||||||
iface_best_ip(ifaces, "127.0.0.1"), 0);
|
iface_best_ip(ifaces, "127.0.0.1"), 0);
|
||||||
torture_assert(tctx, localhost, "Localhost not found");
|
torture_assert(tctx, localhost, "Localhost not found");
|
||||||
|
@ -357,11 +357,11 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context *
|
|||||||
struct tls_params *params;
|
struct tls_params *params;
|
||||||
int ret;
|
int ret;
|
||||||
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
|
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
|
||||||
const char *keyfile = lp_tls_keyfile(tmp_ctx, lp_ctx);
|
const char *keyfile = lpcfg_tls_keyfile(tmp_ctx, lp_ctx);
|
||||||
const char *certfile = lp_tls_certfile(tmp_ctx, lp_ctx);
|
const char *certfile = lpcfg_tls_certfile(tmp_ctx, lp_ctx);
|
||||||
const char *cafile = lp_tls_cafile(tmp_ctx, lp_ctx);
|
const char *cafile = lpcfg_tls_cafile(tmp_ctx, lp_ctx);
|
||||||
const char *crlfile = lp_tls_crlfile(tmp_ctx, lp_ctx);
|
const char *crlfile = lpcfg_tls_crlfile(tmp_ctx, lp_ctx);
|
||||||
const char *dhpfile = lp_tls_dhpfile(tmp_ctx, lp_ctx);
|
const char *dhpfile = lpcfg_tls_dhpfile(tmp_ctx, lp_ctx);
|
||||||
void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *, const char *);
|
void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *, const char *);
|
||||||
params = talloc(mem_ctx, struct tls_params);
|
params = talloc(mem_ctx, struct tls_params);
|
||||||
if (params == NULL) {
|
if (params == NULL) {
|
||||||
@ -369,7 +369,7 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context *
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!lp_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) {
|
if (!lpcfg_tls_enabled(lp_ctx) || keyfile == NULL || *keyfile == 0) {
|
||||||
params->tls_enabled = false;
|
params->tls_enabled = false;
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
return params;
|
return params;
|
||||||
@ -377,8 +377,8 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context *
|
|||||||
|
|
||||||
if (!file_exist(cafile)) {
|
if (!file_exist(cafile)) {
|
||||||
char *hostname = talloc_asprintf(mem_ctx, "%s.%s",
|
char *hostname = talloc_asprintf(mem_ctx, "%s.%s",
|
||||||
lp_netbios_name(lp_ctx),
|
lpcfg_netbios_name(lp_ctx),
|
||||||
lp_dnsdomain(lp_ctx));
|
lpcfg_dnsdomain(lp_ctx));
|
||||||
if (hostname == NULL) {
|
if (hostname == NULL) {
|
||||||
goto init_failed;
|
goto init_failed;
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ _PUBLIC_ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn,
|
|||||||
|
|
||||||
status = gensec_client_start(conn, &conn->gensec,
|
status = gensec_client_start(conn, &conn->gensec,
|
||||||
conn->event.event_ctx,
|
conn->event.event_ctx,
|
||||||
lp_gensec_settings(conn, lp_ctx));
|
lpcfg_gensec_settings(conn, lp_ctx));
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(0, ("Failed to start GENSEC engine (%s)\n", nt_errstr(status)));
|
DEBUG(0, ("Failed to start GENSEC engine (%s)\n", nt_errstr(status)));
|
||||||
goto failed;
|
goto failed;
|
||||||
|
@ -339,8 +339,8 @@ _PUBLIC_ struct composite_context *ldap_connect_send(struct ldap_connection *con
|
|||||||
* local host name as the target for gensec's
|
* local host name as the target for gensec's
|
||||||
* DIGEST-MD5 mechanism */
|
* DIGEST-MD5 mechanism */
|
||||||
conn->host = talloc_asprintf(conn, "%s.%s",
|
conn->host = talloc_asprintf(conn, "%s.%s",
|
||||||
lp_netbios_name(conn->lp_ctx),
|
lpcfg_netbios_name(conn->lp_ctx),
|
||||||
lp_dnsdomain(conn->lp_ctx));
|
lpcfg_dnsdomain(conn->lp_ctx));
|
||||||
if (composite_nomem(conn->host, state->ctx)) {
|
if (composite_nomem(conn->host, state->ctx)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -375,7 +375,7 @@ _PUBLIC_ struct composite_context *ldap_connect_send(struct ldap_connection *con
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx = socket_connect_multi_send(state, conn->host, 1, &conn->port,
|
ctx = socket_connect_multi_send(state, conn->host, 1, &conn->port,
|
||||||
lp_resolve_context(conn->lp_ctx), conn->event.event_ctx);
|
lpcfg_resolve_context(conn->lp_ctx), conn->event.event_ctx);
|
||||||
if (ctx == NULL) goto failed;
|
if (ctx == NULL) goto failed;
|
||||||
|
|
||||||
ctx->async.fn = ldap_connect_recv_tcp_conn;
|
ctx->async.fn = ldap_connect_recv_tcp_conn;
|
||||||
@ -405,7 +405,7 @@ static void ldap_connect_got_sock(struct composite_context *ctx,
|
|||||||
talloc_steal(conn, conn->sock);
|
talloc_steal(conn, conn->sock);
|
||||||
if (conn->ldaps) {
|
if (conn->ldaps) {
|
||||||
struct socket_context *tls_socket;
|
struct socket_context *tls_socket;
|
||||||
char *cafile = lp_tls_cafile(conn->sock, conn->lp_ctx);
|
char *cafile = lpcfg_tls_cafile(conn->sock, conn->lp_ctx);
|
||||||
|
|
||||||
if (!cafile || !*cafile) {
|
if (!cafile || !*cafile) {
|
||||||
talloc_free(conn->sock);
|
talloc_free(conn->sock);
|
||||||
|
@ -101,6 +101,6 @@ bool resolve_context_add_bcast_method(struct resolve_context *ctx, struct interf
|
|||||||
bool resolve_context_add_bcast_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
|
bool resolve_context_add_bcast_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces);
|
load_interfaces(ctx, lpcfg_interfaces(lp_ctx), &ifaces);
|
||||||
return resolve_context_add_bcast_method(ctx, ifaces, lp_nbt_port(lp_ctx), lp_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
|
return resolve_context_add_bcast_method(ctx, ifaces, lpcfg_nbt_port(lp_ctx), lpcfg_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
|
||||||
}
|
}
|
||||||
|
@ -146,5 +146,5 @@ bool resolve_context_add_file_method(struct resolve_context *ctx, const char *lo
|
|||||||
|
|
||||||
bool resolve_context_add_file_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
|
bool resolve_context_add_file_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
return resolve_context_add_file_method(ctx, lp_parm_string(lp_ctx, NULL, "resolv", "host file"));
|
return resolve_context_add_file_method(ctx, lpcfg_parm_string(lp_ctx, NULL, "resolv", "host file"));
|
||||||
}
|
}
|
||||||
|
@ -21,9 +21,9 @@
|
|||||||
#include "libcli/resolve/resolve.h"
|
#include "libcli/resolve/resolve.h"
|
||||||
#include "param/param.h"
|
#include "param/param.h"
|
||||||
|
|
||||||
struct resolve_context *lp_resolve_context(struct loadparm_context *lp_ctx)
|
struct resolve_context *lpcfg_resolve_context(struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
const char **methods = lp_name_resolve_order(lp_ctx);
|
const char **methods = lpcfg_name_resolve_order(lp_ctx);
|
||||||
int i;
|
int i;
|
||||||
struct resolve_context *ret = resolve_context_init(lp_ctx);
|
struct resolve_context *ret = resolve_context_init(lp_ctx);
|
||||||
|
|
||||||
|
@ -77,6 +77,6 @@ bool resolve_context_add_wins_method(struct resolve_context *ctx, const char **a
|
|||||||
bool resolve_context_add_wins_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
|
bool resolve_context_add_wins_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
load_interfaces(ctx, lp_interfaces(lp_ctx), &ifaces);
|
load_interfaces(ctx, lpcfg_interfaces(lp_ctx), &ifaces);
|
||||||
return resolve_context_add_wins_method(ctx, lp_wins_server_list(lp_ctx), ifaces, lp_nbt_port(lp_ctx), lp_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
|
return resolve_context_add_wins_method(ctx, lpcfg_wins_server_list(lp_ctx), ifaces, lpcfg_nbt_port(lp_ctx), lpcfg_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ struct smb_composite_connectmulti {
|
|||||||
int num_dests;
|
int num_dests;
|
||||||
const char **hostnames;
|
const char **hostnames;
|
||||||
const char **addresses;
|
const char **addresses;
|
||||||
int *ports; /* Either NULL for lp_smb_ports() per
|
int *ports; /* Either NULL for lpcfg_smb_ports() per
|
||||||
* destination or a list of explicit ports */
|
* destination or a list of explicit ports */
|
||||||
} in;
|
} in;
|
||||||
struct {
|
struct {
|
||||||
|
@ -136,7 +136,7 @@ NTSTATUS wrepl_socket_split_stream(struct wrepl_socket *wrepl_socket,
|
|||||||
const char *wrepl_best_ip(struct loadparm_context *lp_ctx, const char *peer_ip)
|
const char *wrepl_best_ip(struct loadparm_context *lp_ctx, const char *peer_ip)
|
||||||
{
|
{
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
load_interfaces(lp_ctx, lp_interfaces(lp_ctx), &ifaces);
|
load_interfaces(lp_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
|
||||||
return iface_best_ip(ifaces, peer_ip);
|
return iface_best_ip(ifaces, peer_ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ struct libnet_context *libnet_context_init(struct tevent_context *ev,
|
|||||||
dcerpc_init(lp_ctx);
|
dcerpc_init(lp_ctx);
|
||||||
|
|
||||||
/* name resolution methods */
|
/* name resolution methods */
|
||||||
ctx->resolve_ctx = lp_resolve_context(lp_ctx);
|
ctx->resolve_ctx = lpcfg_resolve_context(lp_ctx);
|
||||||
|
|
||||||
/* connected services' params */
|
/* connected services' params */
|
||||||
ZERO_STRUCT(ctx->samr);
|
ZERO_STRUCT(ctx->samr);
|
||||||
|
@ -740,7 +740,7 @@ struct libnet_BecomeDC_state {
|
|||||||
static int32_t get_dc_function_level(struct loadparm_context *lp_ctx)
|
static int32_t get_dc_function_level(struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
/* per default we are (Windows) 2008 R2 compatible */
|
/* per default we are (Windows) 2008 R2 compatible */
|
||||||
return lp_parm_int(lp_ctx, NULL, "ads", "dc function level",
|
return lpcfg_parm_int(lp_ctx, NULL, "ads", "dc function level",
|
||||||
DS_DOMAIN_FUNCTION_2008_R2);
|
DS_DOMAIN_FUNCTION_2008_R2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,7 +766,7 @@ static void becomeDC_send_cldap(struct libnet_BecomeDC_state *s)
|
|||||||
|
|
||||||
ret = tsocket_address_inet_from_strings(s, "ip",
|
ret = tsocket_address_inet_from_strings(s, "ip",
|
||||||
s->source_dsa.address,
|
s->source_dsa.address,
|
||||||
lp_cldap_port(s->libnet->lp_ctx),
|
lpcfg_cldap_port(s->libnet->lp_ctx),
|
||||||
&dest_address);
|
&dest_address);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
c->status = map_nt_error_from_unix(errno);
|
c->status = map_nt_error_from_unix(errno);
|
||||||
@ -1549,12 +1549,12 @@ static void becomeDC_drsuapi_connect_send(struct libnet_BecomeDC_state *s,
|
|||||||
* configuration partition works fine, but it fails for
|
* configuration partition works fine, but it fails for
|
||||||
* the domain partition.
|
* the domain partition.
|
||||||
*/
|
*/
|
||||||
if (lp_parm_bool(s->libnet->lp_ctx, NULL, "become_dc",
|
if (lpcfg_parm_bool(s->libnet->lp_ctx, NULL, "become_dc",
|
||||||
"force krb5", true))
|
"force krb5", true))
|
||||||
{
|
{
|
||||||
krb5_str = "krb5,";
|
krb5_str = "krb5,";
|
||||||
}
|
}
|
||||||
if (lp_parm_bool(s->libnet->lp_ctx, NULL, "become_dc",
|
if (lpcfg_parm_bool(s->libnet->lp_ctx, NULL, "become_dc",
|
||||||
"print", false))
|
"print", false))
|
||||||
{
|
{
|
||||||
print_str = "print,";
|
print_str = "print,";
|
||||||
@ -2905,7 +2905,7 @@ static void becomeDC_drsuapi_update_refs_send(struct libnet_BecomeDC_state *s,
|
|||||||
r->in.req.req1.options = DRSUAPI_DRS_ADD_REF | DRSUAPI_DRS_DEL_REF;
|
r->in.req.req1.options = DRSUAPI_DRS_ADD_REF | DRSUAPI_DRS_DEL_REF;
|
||||||
|
|
||||||
/* I think this is how we mark ourselves as a RODC */
|
/* I think this is how we mark ourselves as a RODC */
|
||||||
if (!lp_parm_bool(s->libnet->lp_ctx, NULL, "repl", "RODC", false)) {
|
if (!lpcfg_parm_bool(s->libnet->lp_ctx, NULL, "repl", "RODC", false)) {
|
||||||
r->in.req.req1.options |= DRSUAPI_DRS_WRIT_REP;
|
r->in.req.req1.options |= DRSUAPI_DRS_WRIT_REP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,8 +560,8 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
|
|||||||
connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, r->in.domain_name);
|
connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, r->in.domain_name);
|
||||||
} else {
|
} else {
|
||||||
/* Bugger, we just lost our way to automatically find the domain name */
|
/* Bugger, we just lost our way to automatically find the domain name */
|
||||||
connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, lp_workgroup(ctx->lp_ctx));
|
connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, lpcfg_workgroup(ctx->lp_ctx));
|
||||||
connect_with_info->out.realm = talloc_strdup(tmp_ctx, lp_realm(ctx->lp_ctx));
|
connect_with_info->out.realm = talloc_strdup(tmp_ctx, lpcfg_realm(ctx->lp_ctx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -934,7 +934,7 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx,
|
|||||||
if (r->in.netbios_name != NULL) {
|
if (r->in.netbios_name != NULL) {
|
||||||
netbios_name = r->in.netbios_name;
|
netbios_name = r->in.netbios_name;
|
||||||
} else {
|
} else {
|
||||||
netbios_name = talloc_strdup(tmp_mem, lp_netbios_name(ctx->lp_ctx));
|
netbios_name = talloc_strdup(tmp_mem, lpcfg_netbios_name(ctx->lp_ctx));
|
||||||
if (!netbios_name) {
|
if (!netbios_name) {
|
||||||
r->out.error_string = NULL;
|
r->out.error_string = NULL;
|
||||||
talloc_free(tmp_mem);
|
talloc_free(tmp_mem);
|
||||||
|
@ -193,11 +193,11 @@ struct composite_context* libnet_LookupDCs_send(struct libnet_context *ctx,
|
|||||||
struct composite_context *c;
|
struct composite_context *c;
|
||||||
struct messaging_context *msg_ctx =
|
struct messaging_context *msg_ctx =
|
||||||
messaging_client_init(mem_ctx,
|
messaging_client_init(mem_ctx,
|
||||||
lp_messaging_path(mem_ctx, ctx->lp_ctx),
|
lpcfg_messaging_path(mem_ctx, ctx->lp_ctx),
|
||||||
ctx->event_ctx);
|
ctx->event_ctx);
|
||||||
|
|
||||||
c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx),
|
c = finddcs_send(mem_ctx, lpcfg_netbios_name(ctx->lp_ctx),
|
||||||
lp_nbt_port(ctx->lp_ctx), io->in.domain_name,
|
lpcfg_nbt_port(ctx->lp_ctx), io->in.domain_name,
|
||||||
io->in.name_type, NULL, ctx->resolve_ctx,
|
io->in.name_type, NULL, ctx->resolve_ctx,
|
||||||
ctx->event_ctx, msg_ctx);
|
ctx->event_ctx, msg_ctx);
|
||||||
return c;
|
return c;
|
||||||
|
@ -185,7 +185,7 @@ NTSTATUS libnet_SamDump(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
|
|||||||
if (strcasecmp_m(s->name, secret_name) != 0) {
|
if (strcasecmp_m(s->name, secret_name) != 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(ctx->lp_ctx), CH_UTF16, CH_UNIX,
|
if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(ctx->lp_ctx), CH_UTF16, CH_UNIX,
|
||||||
s->secret.data, s->secret.length,
|
s->secret.data, s->secret.length,
|
||||||
(void **)&secret_string, NULL, false)) {
|
(void **)&secret_string, NULL, false)) {
|
||||||
r->out.error_string = talloc_asprintf(mem_ctx,
|
r->out.error_string = talloc_asprintf(mem_ctx,
|
||||||
|
@ -168,7 +168,7 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
make_nbt_name_client(&name, libnet_r->out.samr_binding->host);
|
make_nbt_name_client(&name, libnet_r->out.samr_binding->host);
|
||||||
status = resolve_name(lp_resolve_context(ctx->lp_ctx), &name, r, &dest_addr, ctx->event_ctx);
|
status = resolve_name(lpcfg_resolve_context(ctx->lp_ctx), &name, r, &dest_addr, ctx->event_ctx);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
libnet_r->out.error_string = NULL;
|
libnet_r->out.error_string = NULL;
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
@ -179,7 +179,7 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx,
|
|||||||
r->in.dest_address = dest_addr;
|
r->in.dest_address = dest_addr;
|
||||||
r->in.netbios_name = libnet_r->in.netbios_name;
|
r->in.netbios_name = libnet_r->in.netbios_name;
|
||||||
r->in.domain_dn_str = libnet_r->out.domain_dn_str;
|
r->in.domain_dn_str = libnet_r->out.domain_dn_str;
|
||||||
r->in.cldap_port = lp_cldap_port(ctx->lp_ctx);
|
r->in.cldap_port = lpcfg_cldap_port(ctx->lp_ctx);
|
||||||
|
|
||||||
status = libnet_FindSite(tmp_ctx, ctx, r);
|
status = libnet_FindSite(tmp_ctx, ctx, r);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
@ -274,7 +274,7 @@ static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s)
|
|||||||
|
|
||||||
ret = tsocket_address_inet_from_strings(s, "ip",
|
ret = tsocket_address_inet_from_strings(s, "ip",
|
||||||
s->source_dsa.address,
|
s->source_dsa.address,
|
||||||
lp_cldap_port(s->libnet->lp_ctx),
|
lpcfg_cldap_port(s->libnet->lp_ctx),
|
||||||
&dest_address);
|
&dest_address);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
c->status = map_nt_error_from_unix(errno);
|
c->status = map_nt_error_from_unix(errno);
|
||||||
|
@ -378,7 +378,7 @@ static NTSTATUS libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s
|
|||||||
return werror_to_ntstatus(status);
|
return werror_to_ntstatus(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) {
|
if (lpcfg_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) {
|
||||||
for (i=0; i < schema_objs->num_objects; i++) {
|
for (i=0; i < schema_objs->num_objects; i++) {
|
||||||
struct ldb_ldif ldif;
|
struct ldb_ldif ldif;
|
||||||
fprintf(stdout, "#\n");
|
fprintf(stdout, "#\n");
|
||||||
@ -652,7 +652,7 @@ NTSTATUS libnet_vampire_cb_store_chunk(void *private_data,
|
|||||||
return werror_to_ntstatus(status);
|
return werror_to_ntstatus(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) {
|
if (lpcfg_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) {
|
||||||
for (i=0; i < objs->num_objects; i++) {
|
for (i=0; i < objs->num_objects; i++) {
|
||||||
struct ldb_ldif ldif;
|
struct ldb_ldif ldif;
|
||||||
fprintf(stdout, "#\n");
|
fprintf(stdout, "#\n");
|
||||||
@ -689,7 +689,7 @@ NTSTATUS libnet_vampire_cb_store_chunk(void *private_data,
|
|||||||
return NT_STATUS_FOOBAR;
|
return NT_STATUS_FOOBAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) {
|
if (lpcfg_parm_bool(s->lp_ctx, NULL, "become dc", "dump objects", false)) {
|
||||||
DEBUG(0,("# %s\n", sa->lDAPDisplayName));
|
DEBUG(0,("# %s\n", sa->lDAPDisplayName));
|
||||||
NDR_PRINT_DEBUG(drsuapi_DsReplicaLinkedAttribute, &linked_attributes[i]);
|
NDR_PRINT_DEBUG(drsuapi_DsReplicaLinkedAttribute, &linked_attributes[i]);
|
||||||
dump_data(0,
|
dump_data(0,
|
||||||
@ -727,7 +727,7 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
|
|||||||
if (r->in.netbios_name != NULL) {
|
if (r->in.netbios_name != NULL) {
|
||||||
netbios_name = r->in.netbios_name;
|
netbios_name = r->in.netbios_name;
|
||||||
} else {
|
} else {
|
||||||
netbios_name = talloc_reference(join, lp_netbios_name(ctx->lp_ctx));
|
netbios_name = talloc_reference(join, lpcfg_netbios_name(ctx->lp_ctx));
|
||||||
if (!netbios_name) {
|
if (!netbios_name) {
|
||||||
talloc_free(join);
|
talloc_free(join);
|
||||||
r->out.error_string = NULL;
|
r->out.error_string = NULL;
|
||||||
@ -780,8 +780,8 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
|
|||||||
/* Now set these values into the smb.conf - we probably had
|
/* Now set these values into the smb.conf - we probably had
|
||||||
* empty or useless defaults here from whatever smb.conf we
|
* empty or useless defaults here from whatever smb.conf we
|
||||||
* started with */
|
* started with */
|
||||||
lp_set_cmdline(s->lp_ctx, "realm", join->out.realm);
|
lpcfg_set_cmdline(s->lp_ctx, "realm", join->out.realm);
|
||||||
lp_set_cmdline(s->lp_ctx, "workgroup", join->out.domain_name);
|
lpcfg_set_cmdline(s->lp_ctx, "workgroup", join->out.domain_name);
|
||||||
|
|
||||||
b.in.domain_dns_name = join->out.realm;
|
b.in.domain_dns_name = join->out.realm;
|
||||||
b.in.domain_netbios_name = join->out.domain_name;
|
b.in.domain_netbios_name = join->out.domain_name;
|
||||||
@ -796,7 +796,7 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
|
|||||||
b.in.callbacks.config_chunk = libnet_vampire_cb_store_chunk;
|
b.in.callbacks.config_chunk = libnet_vampire_cb_store_chunk;
|
||||||
b.in.callbacks.domain_chunk = libnet_vampire_cb_store_chunk;
|
b.in.callbacks.domain_chunk = libnet_vampire_cb_store_chunk;
|
||||||
|
|
||||||
b.in.rodc_join = lp_parm_bool(s->lp_ctx, NULL, "repl", "RODC", false);
|
b.in.rodc_join = lpcfg_parm_bool(s->lp_ctx, NULL, "repl", "RODC", false);
|
||||||
|
|
||||||
status = libnet_BecomeDC(ctx, s, &b);
|
status = libnet_BecomeDC(ctx, s, &b);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
@ -281,7 +281,7 @@ static PyObject *py_net_vampire(py_net_Object *self, PyObject *args, PyObject *k
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
r.in.netbios_name = lp_netbios_name(self->libnet_ctx->lp_ctx);
|
r.in.netbios_name = lpcfg_netbios_name(self->libnet_ctx->lp_ctx);
|
||||||
r.out.error_string = NULL;
|
r.out.error_string = NULL;
|
||||||
|
|
||||||
mem_ctx = talloc_new(NULL);
|
mem_ctx = talloc_new(NULL);
|
||||||
@ -346,7 +346,7 @@ static PyObject *net_obj_new(PyTypeObject *type, PyObject *args, PyObject *kwarg
|
|||||||
ret->ev = s4_event_context_init(NULL);
|
ret->ev = s4_event_context_init(NULL);
|
||||||
ret->mem_ctx = talloc_new(ret->ev);
|
ret->mem_ctx = talloc_new(ret->ev);
|
||||||
|
|
||||||
lp = lp_from_py_object(ret->mem_ctx, py_lp);
|
lp = lpcfg_from_py_object(ret->mem_ctx, py_lp);
|
||||||
if (lp == NULL) {
|
if (lp == NULL) {
|
||||||
Py_DECREF(ret);
|
Py_DECREF(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -111,19 +111,19 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT
|
|||||||
/* prepare smb connection parameters: we're connecting to IPC$ share on
|
/* prepare smb connection parameters: we're connecting to IPC$ share on
|
||||||
remote rpc server */
|
remote rpc server */
|
||||||
conn->in.dest_host = s->io.binding->host;
|
conn->in.dest_host = s->io.binding->host;
|
||||||
conn->in.dest_ports = lp_smb_ports(lp_ctx);
|
conn->in.dest_ports = lpcfg_smb_ports(lp_ctx);
|
||||||
if (s->io.binding->target_hostname == NULL)
|
if (s->io.binding->target_hostname == NULL)
|
||||||
conn->in.called_name = "*SMBSERVER"; /* FIXME: This is invalid */
|
conn->in.called_name = "*SMBSERVER"; /* FIXME: This is invalid */
|
||||||
else
|
else
|
||||||
conn->in.called_name = s->io.binding->target_hostname;
|
conn->in.called_name = s->io.binding->target_hostname;
|
||||||
conn->in.socket_options = lp_socket_options(lp_ctx);
|
conn->in.socket_options = lpcfg_socket_options(lp_ctx);
|
||||||
conn->in.service = "IPC$";
|
conn->in.service = "IPC$";
|
||||||
conn->in.service_type = NULL;
|
conn->in.service_type = NULL;
|
||||||
conn->in.workgroup = lp_workgroup(lp_ctx);
|
conn->in.workgroup = lpcfg_workgroup(lp_ctx);
|
||||||
conn->in.gensec_settings = lp_gensec_settings(conn, lp_ctx);
|
conn->in.gensec_settings = lpcfg_gensec_settings(conn, lp_ctx);
|
||||||
|
|
||||||
lp_smbcli_options(lp_ctx, &conn->in.options);
|
lpcfg_smbcli_options(lp_ctx, &conn->in.options);
|
||||||
lp_smbcli_session_options(lp_ctx, &conn->in.session_options);
|
lpcfg_smbcli_session_options(lp_ctx, &conn->in.session_options);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* provide proper credentials - user supplied, but allow a
|
* provide proper credentials - user supplied, but allow a
|
||||||
@ -244,18 +244,18 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send(
|
|||||||
cli_credentials_guess(s->io.creds, lp_ctx);
|
cli_credentials_guess(s->io.creds, lp_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
lp_smbcli_options(lp_ctx, &options);
|
lpcfg_smbcli_options(lp_ctx, &options);
|
||||||
|
|
||||||
/* send smb2 connect request */
|
/* send smb2 connect request */
|
||||||
conn_req = smb2_connect_send(mem_ctx, s->io.binding->host,
|
conn_req = smb2_connect_send(mem_ctx, s->io.binding->host,
|
||||||
lp_parm_string_list(mem_ctx, lp_ctx, NULL, "smb2", "ports", NULL),
|
lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "smb2", "ports", NULL),
|
||||||
"IPC$",
|
"IPC$",
|
||||||
s->io.resolve_ctx,
|
s->io.resolve_ctx,
|
||||||
s->io.creds,
|
s->io.creds,
|
||||||
c->event_ctx,
|
c->event_ctx,
|
||||||
&options,
|
&options,
|
||||||
lp_socket_options(lp_ctx),
|
lpcfg_socket_options(lp_ctx),
|
||||||
lp_gensec_settings(mem_ctx, lp_ctx)
|
lpcfg_gensec_settings(mem_ctx, lp_ctx)
|
||||||
);
|
);
|
||||||
composite_continue(c, conn_req, continue_smb2_connect, c);
|
composite_continue(c, conn_req, continue_smb2_connect, c);
|
||||||
return c;
|
return c;
|
||||||
@ -462,7 +462,7 @@ static struct composite_context* dcerpc_pipe_connect_ncalrpc_send(TALLOC_CTX *me
|
|||||||
s->io = *io;
|
s->io = *io;
|
||||||
|
|
||||||
/* send pipe open request */
|
/* send pipe open request */
|
||||||
pipe_req = dcerpc_pipe_open_pipe_send(s->io.pipe->conn, lp_ncalrpc_dir(lp_ctx),
|
pipe_req = dcerpc_pipe_open_pipe_send(s->io.pipe->conn, lpcfg_ncalrpc_dir(lp_ctx),
|
||||||
s->io.binding->endpoint);
|
s->io.binding->endpoint);
|
||||||
composite_continue(c, pipe_req, continue_pipe_open_ncalrpc, c);
|
composite_continue(c, pipe_req, continue_pipe_open_ncalrpc, c);
|
||||||
return c;
|
return c;
|
||||||
@ -539,7 +539,7 @@ static void continue_connect(struct composite_context *c, struct pipe_connect_st
|
|||||||
pc.binding = s->binding;
|
pc.binding = s->binding;
|
||||||
pc.interface = s->table;
|
pc.interface = s->table;
|
||||||
pc.creds = s->credentials;
|
pc.creds = s->credentials;
|
||||||
pc.resolve_ctx = lp_resolve_context(s->lp_ctx);
|
pc.resolve_ctx = lpcfg_resolve_context(s->lp_ctx);
|
||||||
|
|
||||||
/* connect dcerpc pipe depending on required transport */
|
/* connect dcerpc pipe depending on required transport */
|
||||||
switch (s->binding->transport) {
|
switch (s->binding->transport) {
|
||||||
@ -746,7 +746,7 @@ _PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent
|
|||||||
if (composite_nomem(s->pipe, c)) return c;
|
if (composite_nomem(s->pipe, c)) return c;
|
||||||
|
|
||||||
if (DEBUGLEVEL >= 10)
|
if (DEBUGLEVEL >= 10)
|
||||||
s->pipe->conn->packet_log_dir = lp_lockdir(lp_ctx);
|
s->pipe->conn->packet_log_dir = lpcfg_lockdir(lp_ctx);
|
||||||
|
|
||||||
/* store parameters in state structure */
|
/* store parameters in state structure */
|
||||||
s->binding = binding;
|
s->binding = binding;
|
||||||
|
@ -327,7 +327,7 @@ static void continue_schannel_key(struct composite_context *ctx)
|
|||||||
|
|
||||||
/* send bind auth request with received creds */
|
/* send bind auth request with received creds */
|
||||||
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table, s->credentials,
|
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table, s->credentials,
|
||||||
lp_gensec_settings(c, s->lp_ctx),
|
lpcfg_gensec_settings(c, s->lp_ctx),
|
||||||
DCERPC_AUTH_TYPE_SCHANNEL, s->auth_level,
|
DCERPC_AUTH_TYPE_SCHANNEL, s->auth_level,
|
||||||
NULL);
|
NULL);
|
||||||
if (composite_nomem(auth_req, c)) return;
|
if (composite_nomem(auth_req, c)) return;
|
||||||
|
@ -460,7 +460,7 @@ static void continue_ntlmssp_connection(struct composite_context *ctx)
|
|||||||
/* initiate a authenticated bind */
|
/* initiate a authenticated bind */
|
||||||
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
|
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
|
||||||
s->credentials,
|
s->credentials,
|
||||||
lp_gensec_settings(c, s->lp_ctx),
|
lpcfg_gensec_settings(c, s->lp_ctx),
|
||||||
DCERPC_AUTH_TYPE_NTLMSSP,
|
DCERPC_AUTH_TYPE_NTLMSSP,
|
||||||
dcerpc_auth_level(s->pipe->conn),
|
dcerpc_auth_level(s->pipe->conn),
|
||||||
s->table->authservices->names[0]);
|
s->table->authservices->names[0]);
|
||||||
@ -493,7 +493,7 @@ static void continue_spnego_after_wrong_pass(struct composite_context *ctx)
|
|||||||
/* initiate a authenticated bind */
|
/* initiate a authenticated bind */
|
||||||
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
|
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
|
||||||
s->credentials,
|
s->credentials,
|
||||||
lp_gensec_settings(c, s->lp_ctx),
|
lpcfg_gensec_settings(c, s->lp_ctx),
|
||||||
DCERPC_AUTH_TYPE_SPNEGO,
|
DCERPC_AUTH_TYPE_SPNEGO,
|
||||||
dcerpc_auth_level(s->pipe->conn),
|
dcerpc_auth_level(s->pipe->conn),
|
||||||
s->table->authservices->names[0]);
|
s->table->authservices->names[0]);
|
||||||
@ -618,7 +618,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
|
|||||||
/* try SPNEGO with fallback to NTLMSSP */
|
/* try SPNEGO with fallback to NTLMSSP */
|
||||||
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
|
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
|
||||||
s->credentials,
|
s->credentials,
|
||||||
lp_gensec_settings(c, s->lp_ctx),
|
lpcfg_gensec_settings(c, s->lp_ctx),
|
||||||
DCERPC_AUTH_TYPE_SPNEGO,
|
DCERPC_AUTH_TYPE_SPNEGO,
|
||||||
dcerpc_auth_level(conn),
|
dcerpc_auth_level(conn),
|
||||||
s->table->authservices->names[0]);
|
s->table->authservices->names[0]);
|
||||||
@ -628,7 +628,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
|
|||||||
|
|
||||||
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
|
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
|
||||||
s->credentials,
|
s->credentials,
|
||||||
lp_gensec_settings(c, s->lp_ctx),
|
lpcfg_gensec_settings(c, s->lp_ctx),
|
||||||
auth_type,
|
auth_type,
|
||||||
dcerpc_auth_level(conn),
|
dcerpc_auth_level(conn),
|
||||||
s->table->authservices->names[0]);
|
s->table->authservices->names[0]);
|
||||||
|
@ -317,7 +317,7 @@ PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, Py
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(mem_ctx, py_lp_ctx);
|
lp_ctx = lpcfg_from_py_object(mem_ctx, py_lp_ctx);
|
||||||
if (lp_ctx == NULL) {
|
if (lp_ctx == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
||||||
talloc_free(mem_ctx);
|
talloc_free(mem_ctx);
|
||||||
@ -411,7 +411,7 @@ static PyObject *dcerpc_interface_new(PyTypeObject *type, PyObject *args, PyObje
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
lp_ctx = lp_from_py_object(mem_ctx, py_lp_ctx);
|
lp_ctx = lpcfg_from_py_object(mem_ctx, py_lp_ctx);
|
||||||
if (lp_ctx == NULL) {
|
if (lp_ctx == NULL) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
||||||
talloc_free(mem_ctx);
|
talloc_free(mem_ctx);
|
||||||
|
@ -55,13 +55,13 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot,
|
|||||||
|
|
||||||
samctx = iface->nbtsrv->sam_ctx;
|
samctx = iface->nbtsrv->sam_ctx;
|
||||||
|
|
||||||
if (lp_server_role(iface->nbtsrv->task->lp_ctx) != ROLE_DOMAIN_CONTROLLER
|
if (lpcfg_server_role(iface->nbtsrv->task->lp_ctx) != ROLE_DOMAIN_CONTROLLER
|
||||||
|| !samdb_is_pdc(samctx)) {
|
|| !samdb_is_pdc(samctx)) {
|
||||||
DEBUG(2, ("Not a PDC, so not processing LOGON_PRIMARY_QUERY\n"));
|
DEBUG(2, ("Not a PDC, so not processing LOGON_PRIMARY_QUERY\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp_m(name->name, lp_workgroup(iface->nbtsrv->task->lp_ctx)) != 0) {
|
if (strcasecmp_m(name->name, lpcfg_workgroup(iface->nbtsrv->task->lp_ctx)) != 0) {
|
||||||
DEBUG(5,("GetDC requested for a domian %s that we don't host\n", name->name));
|
DEBUG(5,("GetDC requested for a domian %s that we don't host\n", name->name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -72,16 +72,16 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot,
|
|||||||
pdc = &netlogon_response.data.get_pdc;
|
pdc = &netlogon_response.data.get_pdc;
|
||||||
|
|
||||||
pdc->command = NETLOGON_RESPONSE_FROM_PDC;
|
pdc->command = NETLOGON_RESPONSE_FROM_PDC;
|
||||||
pdc->pdc_name = lp_netbios_name(iface->nbtsrv->task->lp_ctx);
|
pdc->pdc_name = lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx);
|
||||||
pdc->unicode_pdc_name = pdc->pdc_name;
|
pdc->unicode_pdc_name = pdc->pdc_name;
|
||||||
pdc->domain_name = lp_workgroup(iface->nbtsrv->task->lp_ctx);
|
pdc->domain_name = lpcfg_workgroup(iface->nbtsrv->task->lp_ctx);
|
||||||
pdc->nt_version = 1;
|
pdc->nt_version = 1;
|
||||||
pdc->lmnt_token = 0xFFFF;
|
pdc->lmnt_token = 0xFFFF;
|
||||||
pdc->lm20_token = 0xFFFF;
|
pdc->lm20_token = 0xFFFF;
|
||||||
|
|
||||||
dgram_mailslot_netlogon_reply(reply_iface->dgmsock,
|
dgram_mailslot_netlogon_reply(reply_iface->dgmsock,
|
||||||
packet,
|
packet,
|
||||||
lp_netbios_name(iface->nbtsrv->task->lp_ctx),
|
lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx),
|
||||||
netlogon->req.pdc.mailslot_name,
|
netlogon->req.pdc.mailslot_name,
|
||||||
&netlogon_response);
|
&netlogon_response);
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ static void nbtd_netlogon_samlogon(struct dgram_mailslot_handler *dgmslot,
|
|||||||
|
|
||||||
dgram_mailslot_netlogon_reply(reply_iface->dgmsock,
|
dgram_mailslot_netlogon_reply(reply_iface->dgmsock,
|
||||||
packet,
|
packet,
|
||||||
lp_netbios_name(iface->nbtsrv->task->lp_ctx),
|
lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx),
|
||||||
netlogon->req.logon.mailslot_name,
|
netlogon->req.logon.mailslot_name,
|
||||||
&netlogon_response);
|
&netlogon_response);
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,9 @@ static void nbtd_ntlogon_sam_logon(struct dgram_mailslot_handler *dgmslot,
|
|||||||
logon = &reply.req.reply;
|
logon = &reply.req.reply;
|
||||||
|
|
||||||
logon->server = talloc_asprintf(packet, "\\\\%s",
|
logon->server = talloc_asprintf(packet, "\\\\%s",
|
||||||
lp_netbios_name(iface->nbtsrv->task->lp_ctx));
|
lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx));
|
||||||
logon->user_name = ntlogon->req.logon.user_name;
|
logon->user_name = ntlogon->req.logon.user_name;
|
||||||
logon->domain = lp_workgroup(iface->nbtsrv->task->lp_ctx);
|
logon->domain = lpcfg_workgroup(iface->nbtsrv->task->lp_ctx);
|
||||||
logon->nt_version = 1;
|
logon->nt_version = 1;
|
||||||
logon->lmnt_token = 0xFFFF;
|
logon->lmnt_token = 0xFFFF;
|
||||||
logon->lm20_token = 0xFFFF;
|
logon->lm20_token = 0xFFFF;
|
||||||
@ -62,7 +62,7 @@ static void nbtd_ntlogon_sam_logon(struct dgram_mailslot_handler *dgmslot,
|
|||||||
|
|
||||||
dgram_mailslot_ntlogon_reply(reply_iface->dgmsock,
|
dgram_mailslot_ntlogon_reply(reply_iface->dgmsock,
|
||||||
packet,
|
packet,
|
||||||
lp_netbios_name(iface->nbtsrv->task->lp_ctx),
|
lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx),
|
||||||
ntlogon->req.logon.mailslot_name,
|
ntlogon->req.logon.mailslot_name,
|
||||||
&reply);
|
&reply);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
|
|||||||
|
|
||||||
bcast_addr = socket_address_from_strings(tmp_ctx, bcast_dgmsock->sock->backend_name,
|
bcast_addr = socket_address_from_strings(tmp_ctx, bcast_dgmsock->sock->backend_name,
|
||||||
iface->bcast_address,
|
iface->bcast_address,
|
||||||
lp_dgram_port(iface->nbtsrv->task->lp_ctx));
|
lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx));
|
||||||
if (!bcast_addr) {
|
if (!bcast_addr) {
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
@ -93,7 +93,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
|
|||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
DEBUG(0,("Failed to bind to %s:%d - %s\n",
|
DEBUG(0,("Failed to bind to %s:%d - %s\n",
|
||||||
iface->bcast_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx),
|
iface->bcast_address, lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx),
|
||||||
nt_errstr(status)));
|
nt_errstr(status)));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
|
|||||||
}
|
}
|
||||||
|
|
||||||
bind_addr = socket_address_from_strings(tmp_ctx, iface->dgmsock->sock->backend_name,
|
bind_addr = socket_address_from_strings(tmp_ctx, iface->dgmsock->sock->backend_name,
|
||||||
bind_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx));
|
bind_address, lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx));
|
||||||
if (!bind_addr) {
|
if (!bind_addr) {
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
@ -119,7 +119,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
|
|||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
DEBUG(0,("Failed to bind to %s:%d - %s\n",
|
DEBUG(0,("Failed to bind to %s:%d - %s\n",
|
||||||
bind_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx), nt_errstr(status)));
|
bind_address, lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx), nt_errstr(status)));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bcast_address = socket_address_from_strings(bcast_nbtsock, bcast_nbtsock->sock->backend_name,
|
bcast_address = socket_address_from_strings(bcast_nbtsock, bcast_nbtsock->sock->backend_name,
|
||||||
bcast, lp_nbt_port(lp_ctx));
|
bcast, lpcfg_nbt_port(lp_ctx));
|
||||||
if (!bcast_address) {
|
if (!bcast_address) {
|
||||||
talloc_free(iface);
|
talloc_free(iface);
|
||||||
return NT_STATUS_NO_MEMORY;
|
return NT_STATUS_NO_MEMORY;
|
||||||
@ -202,7 +202,7 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv,
|
|||||||
status = socket_listen(bcast_nbtsock->sock, bcast_address, 0, 0);
|
status = socket_listen(bcast_nbtsock->sock, bcast_address, 0, 0);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(0,("Failed to bind to %s:%d - %s\n",
|
DEBUG(0,("Failed to bind to %s:%d - %s\n",
|
||||||
bcast, lp_nbt_port(lp_ctx), nt_errstr(status)));
|
bcast, lpcfg_nbt_port(lp_ctx), nt_errstr(status)));
|
||||||
talloc_free(iface);
|
talloc_free(iface);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -220,12 +220,12 @@ static NTSTATUS nbtd_add_socket(struct nbtd_server *nbtsrv,
|
|||||||
|
|
||||||
unicast_address = socket_address_from_strings(iface->nbtsock,
|
unicast_address = socket_address_from_strings(iface->nbtsock,
|
||||||
iface->nbtsock->sock->backend_name,
|
iface->nbtsock->sock->backend_name,
|
||||||
bind_address, lp_nbt_port(lp_ctx));
|
bind_address, lpcfg_nbt_port(lp_ctx));
|
||||||
|
|
||||||
status = socket_listen(iface->nbtsock->sock, unicast_address, 0, 0);
|
status = socket_listen(iface->nbtsock->sock, unicast_address, 0, 0);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(0,("Failed to bind to %s:%d - %s\n",
|
DEBUG(0,("Failed to bind to %s:%d - %s\n",
|
||||||
bind_address, lp_nbt_port(lp_ctx), nt_errstr(status)));
|
bind_address, lpcfg_nbt_port(lp_ctx), nt_errstr(status)));
|
||||||
talloc_free(iface);
|
talloc_free(iface);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -283,7 +283,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con
|
|||||||
|
|
||||||
/* if we are allowing incoming packets from any address, then
|
/* if we are allowing incoming packets from any address, then
|
||||||
we also need to bind to the wildcard address */
|
we also need to bind to the wildcard address */
|
||||||
if (!lp_bind_interfaces_only(lp_ctx)) {
|
if (!lpcfg_bind_interfaces_only(lp_ctx)) {
|
||||||
const char *primary_address;
|
const char *primary_address;
|
||||||
|
|
||||||
/* the primary address is the address we will return
|
/* the primary address is the address we will return
|
||||||
@ -293,7 +293,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con
|
|||||||
primary_address = iface_n_ip(ifaces, 0);
|
primary_address = iface_n_ip(ifaces, 0);
|
||||||
} else {
|
} else {
|
||||||
primary_address = inet_ntoa(interpret_addr2(
|
primary_address = inet_ntoa(interpret_addr2(
|
||||||
lp_netbios_name(lp_ctx)));
|
lpcfg_netbios_name(lp_ctx)));
|
||||||
}
|
}
|
||||||
primary_address = talloc_strdup(tmp_ctx, primary_address);
|
primary_address = talloc_strdup(tmp_ctx, primary_address);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(primary_address);
|
NT_STATUS_HAVE_NO_MEMORY(primary_address);
|
||||||
@ -323,7 +323,7 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con
|
|||||||
NT_STATUS_NOT_OK_RETURN(status);
|
NT_STATUS_NOT_OK_RETURN(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp_wins_server_list(lp_ctx)) {
|
if (lpcfg_wins_server_list(lp_ctx)) {
|
||||||
status = nbtd_add_wins_socket(nbtsrv);
|
status = nbtd_add_wins_socket(nbtsrv);
|
||||||
NT_STATUS_NOT_OK_RETURN(status);
|
NT_STATUS_NOT_OK_RETURN(status);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ static void nbtd_task_init(struct task_server *task)
|
|||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
|
|
||||||
load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
|
load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
|
||||||
|
|
||||||
if (iface_count(ifaces) == 0) {
|
if (iface_count(ifaces) == 0) {
|
||||||
task_server_terminate(task, "nbtd: no network interfaces configured", false);
|
task_server_terminate(task, "nbtd: no network interfaces configured", false);
|
||||||
|
@ -79,7 +79,7 @@ bool nbtd_self_packet(struct nbt_name_socket *nbtsock,
|
|||||||
struct nbtd_server *nbtsrv = iface->nbtsrv;
|
struct nbtd_server *nbtsrv = iface->nbtsrv;
|
||||||
|
|
||||||
/* if its not from the nbt port, then it wasn't a broadcast from us */
|
/* if its not from the nbt port, then it wasn't a broadcast from us */
|
||||||
if (src->port != lp_nbt_port(iface->nbtsrv->task->lp_ctx)) {
|
if (src->port != lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ void nbtd_request_query(struct nbt_name_socket *nbtsock,
|
|||||||
if (!(packet->operation & NBT_FLAG_BROADCAST) &&
|
if (!(packet->operation & NBT_FLAG_BROADCAST) &&
|
||||||
(packet->operation & NBT_FLAG_RECURSION_DESIRED) &&
|
(packet->operation & NBT_FLAG_RECURSION_DESIRED) &&
|
||||||
(iname->nb_flags & NBT_NM_GROUP) &&
|
(iname->nb_flags & NBT_NM_GROUP) &&
|
||||||
lp_wins_support(iface->nbtsrv->task->lp_ctx)) {
|
lpcfg_wins_support(iface->nbtsrv->task->lp_ctx)) {
|
||||||
nbtd_winsserver_request(nbtsock, packet, src);
|
nbtd_winsserver_request(nbtsock, packet, src);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ static void name_refresh_handler(struct tevent_context *ev, struct tevent_timer
|
|||||||
registration packets */
|
registration packets */
|
||||||
io.in.name = iname->name;
|
io.in.name = iname->name;
|
||||||
io.in.dest_addr = iface->bcast_address;
|
io.in.dest_addr = iface->bcast_address;
|
||||||
io.in.dest_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
|
io.in.dest_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx);
|
||||||
io.in.address = iface->ip_address;
|
io.in.address = iface->ip_address;
|
||||||
io.in.nb_flags = iname->nb_flags;
|
io.in.nb_flags = iname->nb_flags;
|
||||||
io.in.ttl = iname->ttl;
|
io.in.ttl = iname->ttl;
|
||||||
@ -118,7 +118,7 @@ static void name_refresh_handler(struct tevent_context *ev, struct tevent_timer
|
|||||||
static void nbtd_start_refresh_timer(struct nbtd_iface_name *iname)
|
static void nbtd_start_refresh_timer(struct nbtd_iface_name *iname)
|
||||||
{
|
{
|
||||||
uint32_t refresh_time;
|
uint32_t refresh_time;
|
||||||
uint32_t max_refresh_time = lp_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200);
|
uint32_t max_refresh_time = lpcfg_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200);
|
||||||
|
|
||||||
refresh_time = MIN(max_refresh_time, iname->ttl/2);
|
refresh_time = MIN(max_refresh_time, iname->ttl/2);
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface,
|
|||||||
uint16_t nb_flags)
|
uint16_t nb_flags)
|
||||||
{
|
{
|
||||||
struct nbtd_iface_name *iname;
|
struct nbtd_iface_name *iname;
|
||||||
const char *scope = lp_netbios_scope(iface->nbtsrv->task->lp_ctx);
|
const char *scope = lpcfg_netbios_scope(iface->nbtsrv->task->lp_ctx);
|
||||||
struct nbt_name_register_bcast io;
|
struct nbt_name_register_bcast io;
|
||||||
struct composite_context *creq;
|
struct composite_context *creq;
|
||||||
struct nbtd_server *nbtsrv = iface->nbtsrv;
|
struct nbtd_server *nbtsrv = iface->nbtsrv;
|
||||||
@ -188,7 +188,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface,
|
|||||||
iname->name.scope = NULL;
|
iname->name.scope = NULL;
|
||||||
}
|
}
|
||||||
iname->nb_flags = nb_flags;
|
iname->nb_flags = nb_flags;
|
||||||
iname->ttl = lp_parm_int(iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "bcast_ttl", 300000);
|
iname->ttl = lpcfg_parm_int(iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "bcast_ttl", 300000);
|
||||||
iname->registration_time = timeval_zero();
|
iname->registration_time = timeval_zero();
|
||||||
iname->wins_server = NULL;
|
iname->wins_server = NULL;
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface,
|
|||||||
/* setup a broadcast name registration request */
|
/* setup a broadcast name registration request */
|
||||||
io.in.name = iname->name;
|
io.in.name = iname->name;
|
||||||
io.in.dest_addr = iface->bcast_address;
|
io.in.dest_addr = iface->bcast_address;
|
||||||
io.in.dest_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
|
io.in.dest_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx);
|
||||||
io.in.address = iface->ip_address;
|
io.in.address = iface->ip_address;
|
||||||
io.in.nb_flags = nb_flags;
|
io.in.nb_flags = nb_flags;
|
||||||
io.in.ttl = iname->ttl;
|
io.in.ttl = iname->ttl;
|
||||||
@ -262,29 +262,29 @@ void nbtd_register_names(struct nbtd_server *nbtsrv)
|
|||||||
|
|
||||||
/* note that we don't initially mark the names "ACTIVE". They are
|
/* note that we don't initially mark the names "ACTIVE". They are
|
||||||
marked active once registration is successful */
|
marked active once registration is successful */
|
||||||
nbtd_register_name(nbtsrv, lp_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_CLIENT, nb_flags);
|
nbtd_register_name(nbtsrv, lpcfg_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_CLIENT, nb_flags);
|
||||||
nbtd_register_name(nbtsrv, lp_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_USER, nb_flags);
|
nbtd_register_name(nbtsrv, lpcfg_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_USER, nb_flags);
|
||||||
nbtd_register_name(nbtsrv, lp_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_SERVER, nb_flags);
|
nbtd_register_name(nbtsrv, lpcfg_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_SERVER, nb_flags);
|
||||||
|
|
||||||
aliases = lp_netbios_aliases(nbtsrv->task->lp_ctx);
|
aliases = lpcfg_netbios_aliases(nbtsrv->task->lp_ctx);
|
||||||
while (aliases && aliases[0]) {
|
while (aliases && aliases[0]) {
|
||||||
nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_CLIENT, nb_flags);
|
nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_CLIENT, nb_flags);
|
||||||
nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_SERVER, nb_flags);
|
nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_SERVER, nb_flags);
|
||||||
aliases++;
|
aliases++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp_server_role(nbtsrv->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER) {
|
if (lpcfg_server_role(nbtsrv->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER) {
|
||||||
bool is_pdc = samdb_is_pdc(nbtsrv->sam_ctx);
|
bool is_pdc = samdb_is_pdc(nbtsrv->sam_ctx);
|
||||||
if (is_pdc) {
|
if (is_pdc) {
|
||||||
nbtd_register_name(nbtsrv, lp_workgroup(nbtsrv->task->lp_ctx),
|
nbtd_register_name(nbtsrv, lpcfg_workgroup(nbtsrv->task->lp_ctx),
|
||||||
NBT_NAME_PDC, nb_flags);
|
NBT_NAME_PDC, nb_flags);
|
||||||
}
|
}
|
||||||
nbtd_register_name(nbtsrv, lp_workgroup(nbtsrv->task->lp_ctx),
|
nbtd_register_name(nbtsrv, lpcfg_workgroup(nbtsrv->task->lp_ctx),
|
||||||
NBT_NAME_LOGON, nb_flags | NBT_NM_GROUP);
|
NBT_NAME_LOGON, nb_flags | NBT_NM_GROUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
nb_flags |= NBT_NM_GROUP;
|
nb_flags |= NBT_NM_GROUP;
|
||||||
nbtd_register_name(nbtsrv, lp_workgroup(nbtsrv->task->lp_ctx), NBT_NAME_CLIENT, nb_flags);
|
nbtd_register_name(nbtsrv, lpcfg_workgroup(nbtsrv->task->lp_ctx), NBT_NAME_CLIENT, nb_flags);
|
||||||
|
|
||||||
nb_flags |= NBT_NM_PERMANENT;
|
nb_flags |= NBT_NM_PERMANENT;
|
||||||
nbtd_register_name(nbtsrv, "__SAMBA__", NBT_NAME_CLIENT, nb_flags);
|
nbtd_register_name(nbtsrv, "__SAMBA__", NBT_NAME_CLIENT, nb_flags);
|
||||||
|
@ -89,10 +89,10 @@ static int wins_ldb_init(struct ldb_module *module)
|
|||||||
|
|
||||||
ldb_module_set_private(module, NULL);
|
ldb_module_set_private(module, NULL);
|
||||||
|
|
||||||
owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
|
owner = lpcfg_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
|
||||||
if (!owner) {
|
if (!owner) {
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
load_interfaces(module, lp_interfaces(lp_ctx), &ifaces);
|
load_interfaces(module, lpcfg_interfaces(lp_ctx), &ifaces);
|
||||||
owner = iface_n_ip(ifaces, 0);
|
owner = iface_n_ip(ifaces, 0);
|
||||||
if (!owner) {
|
if (!owner) {
|
||||||
owner = "0.0.0.0";
|
owner = "0.0.0.0";
|
||||||
|
@ -58,7 +58,7 @@ static void nbtd_wins_register_retry(struct tevent_context *ev, struct tevent_ti
|
|||||||
static void nbtd_wins_start_refresh_timer(struct nbtd_iface_name *iname)
|
static void nbtd_wins_start_refresh_timer(struct nbtd_iface_name *iname)
|
||||||
{
|
{
|
||||||
uint32_t refresh_time;
|
uint32_t refresh_time;
|
||||||
uint32_t max_refresh_time = lp_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200);
|
uint32_t max_refresh_time = lpcfg_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "max_refresh_time", 7200);
|
||||||
|
|
||||||
refresh_time = MIN(max_refresh_time, iname->ttl/2);
|
refresh_time = MIN(max_refresh_time, iname->ttl/2);
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ static void nbtd_wins_refresh(struct tevent_context *ev, struct tevent_timer *te
|
|||||||
/* setup a wins name refresh request */
|
/* setup a wins name refresh request */
|
||||||
io.in.name = iname->name;
|
io.in.name = iname->name;
|
||||||
io.in.wins_servers = (const char **)str_list_make_single(tmp_ctx, iname->wins_server);
|
io.in.wins_servers = (const char **)str_list_make_single(tmp_ctx, iname->wins_server);
|
||||||
io.in.wins_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
|
io.in.wins_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx);
|
||||||
io.in.addresses = nbtd_address_list(iface, tmp_ctx);
|
io.in.addresses = nbtd_address_list(iface, tmp_ctx);
|
||||||
io.in.nb_flags = iname->nb_flags;
|
io.in.nb_flags = iname->nb_flags;
|
||||||
io.in.ttl = iname->ttl;
|
io.in.ttl = iname->ttl;
|
||||||
@ -180,7 +180,7 @@ static void nbtd_wins_register_handler(struct composite_context *c)
|
|||||||
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
|
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
|
||||||
/* none of the WINS servers responded - try again
|
/* none of the WINS servers responded - try again
|
||||||
periodically */
|
periodically */
|
||||||
int wins_retry_time = lp_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "wins_retry", 300);
|
int wins_retry_time = lpcfg_parm_int(iname->iface->nbtsrv->task->lp_ctx, NULL, "nbtd", "wins_retry", 300);
|
||||||
event_add_timed(iname->iface->nbtsrv->task->event_ctx,
|
event_add_timed(iname->iface->nbtsrv->task->event_ctx,
|
||||||
iname,
|
iname,
|
||||||
timeval_current_ofs(wins_retry_time, 0),
|
timeval_current_ofs(wins_retry_time, 0),
|
||||||
@ -237,8 +237,8 @@ void nbtd_winsclient_register(struct nbtd_iface_name *iname)
|
|||||||
|
|
||||||
/* setup a wins name register request */
|
/* setup a wins name register request */
|
||||||
io.in.name = iname->name;
|
io.in.name = iname->name;
|
||||||
io.in.wins_port = lp_nbt_port(iname->iface->nbtsrv->task->lp_ctx);
|
io.in.wins_port = lpcfg_nbt_port(iname->iface->nbtsrv->task->lp_ctx);
|
||||||
io.in.wins_servers = lp_wins_server_list(iname->iface->nbtsrv->task->lp_ctx);
|
io.in.wins_servers = lpcfg_wins_server_list(iname->iface->nbtsrv->task->lp_ctx);
|
||||||
io.in.addresses = nbtd_address_list(iface, iname);
|
io.in.addresses = nbtd_address_list(iface, iname);
|
||||||
io.in.nb_flags = iname->nb_flags;
|
io.in.nb_flags = iname->nb_flags;
|
||||||
io.in.ttl = iname->ttl;
|
io.in.ttl = iname->ttl;
|
||||||
|
@ -971,11 +971,11 @@ static bool winsdb_check_or_add_module_list(struct tevent_context *ev_ctx,
|
|||||||
talloc_free(h->ldb);
|
talloc_free(h->ldb);
|
||||||
h->ldb = NULL;
|
h->ldb = NULL;
|
||||||
|
|
||||||
if (lp_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) {
|
if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) {
|
||||||
flags |= LDB_FLG_NOSYNC;
|
flags |= LDB_FLG_NOSYNC;
|
||||||
}
|
}
|
||||||
|
|
||||||
h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lp_wins_url(lp_ctx)),
|
h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)),
|
||||||
NULL, NULL, flags);
|
NULL, NULL, flags);
|
||||||
if (!h->ldb) goto failed;
|
if (!h->ldb) goto failed;
|
||||||
|
|
||||||
@ -1007,16 +1007,16 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx,
|
|||||||
h = talloc_zero(mem_ctx, struct winsdb_handle);
|
h = talloc_zero(mem_ctx, struct winsdb_handle);
|
||||||
if (!h) return NULL;
|
if (!h) return NULL;
|
||||||
|
|
||||||
if (lp_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) {
|
if (lpcfg_parm_bool(lp_ctx, NULL,"winsdb", "nosync", false)) {
|
||||||
flags |= LDB_FLG_NOSYNC;
|
flags |= LDB_FLG_NOSYNC;
|
||||||
}
|
}
|
||||||
|
|
||||||
h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lp_wins_url(lp_ctx)),
|
h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)),
|
||||||
NULL, NULL, flags);
|
NULL, NULL, flags);
|
||||||
if (!h->ldb) goto failed;
|
if (!h->ldb) goto failed;
|
||||||
|
|
||||||
h->caller = caller;
|
h->caller = caller;
|
||||||
h->hook_script = lp_wins_hook(lp_ctx);
|
h->hook_script = lpcfg_wins_hook(lp_ctx);
|
||||||
|
|
||||||
h->local_owner = talloc_strdup(h, owner);
|
h->local_owner = talloc_strdup(h, owner);
|
||||||
if (!h->local_owner) goto failed;
|
if (!h->local_owner) goto failed;
|
||||||
|
@ -415,7 +415,7 @@ static void wins_register_wack(struct nbt_name_socket *nbtsock,
|
|||||||
if (talloc_reference(s, src) == NULL) goto failed;
|
if (talloc_reference(s, src) == NULL) goto failed;
|
||||||
|
|
||||||
s->io.in.nbtd_server = iface->nbtsrv;
|
s->io.in.nbtd_server = iface->nbtsrv;
|
||||||
s->io.in.nbt_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
|
s->io.in.nbt_port = lpcfg_nbt_port(iface->nbtsrv->task->lp_ctx);
|
||||||
s->io.in.event_ctx = iface->nbtsrv->task->event_ctx;
|
s->io.in.event_ctx = iface->nbtsrv->task->event_ctx;
|
||||||
s->io.in.name = rec->name;
|
s->io.in.name = rec->name;
|
||||||
s->io.in.num_addresses = winsdb_addr_list_length(rec->addresses);
|
s->io.in.num_addresses = winsdb_addr_list_length(rec->addresses);
|
||||||
@ -672,7 +672,7 @@ static void nbtd_wins_randomize1Clist(struct loadparm_context *lp_ctx,
|
|||||||
/* first sort the addresses depending on the matching to the client */
|
/* first sort the addresses depending on the matching to the client */
|
||||||
LDB_TYPESAFE_QSORT(addresses, num_addrs, src, nbtd_wins_randomize1Clist_sort);
|
LDB_TYPESAFE_QSORT(addresses, num_addrs, src, nbtd_wins_randomize1Clist_sort);
|
||||||
|
|
||||||
mask = lp_parm_string(lp_ctx, NULL, "nbtd", "wins_randomize1Clist_mask");
|
mask = lpcfg_parm_string(lp_ctx, NULL, "nbtd", "wins_randomize1Clist_mask");
|
||||||
if (!mask) {
|
if (!mask) {
|
||||||
mask = "255.255.255.0";
|
mask = "255.255.255.0";
|
||||||
}
|
}
|
||||||
@ -750,7 +750,7 @@ static void nbtd_winsserver_query(struct loadparm_context *lp_ctx,
|
|||||||
* Value: 0 = deactivated, 1 = activated
|
* Value: 0 = deactivated, 1 = activated
|
||||||
*/
|
*/
|
||||||
if (name->type == NBT_NAME_LOGON &&
|
if (name->type == NBT_NAME_LOGON &&
|
||||||
lp_parm_bool(lp_ctx, NULL, "nbtd", "wins_prepend1Bto1Cqueries", true)) {
|
lpcfg_parm_bool(lp_ctx, NULL, "nbtd", "wins_prepend1Bto1Cqueries", true)) {
|
||||||
struct nbt_name name_1b;
|
struct nbt_name name_1b;
|
||||||
|
|
||||||
name_1b = *name;
|
name_1b = *name;
|
||||||
@ -764,7 +764,7 @@ static void nbtd_winsserver_query(struct loadparm_context *lp_ctx,
|
|||||||
|
|
||||||
status = winsdb_lookup(winssrv->wins_db, name, packet, &rec);
|
status = winsdb_lookup(winssrv->wins_db, name, packet, &rec);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
if (!lp_wins_dns_proxy(lp_ctx)) {
|
if (!lpcfg_wins_dns_proxy(lp_ctx)) {
|
||||||
goto notfound;
|
goto notfound;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -846,7 +846,7 @@ static void nbtd_winsserver_query(struct loadparm_context *lp_ctx,
|
|||||||
* Value: 0 = deactivated, 1 = activated
|
* Value: 0 = deactivated, 1 = activated
|
||||||
*/
|
*/
|
||||||
if (name->type == NBT_NAME_LOGON &&
|
if (name->type == NBT_NAME_LOGON &&
|
||||||
lp_parm_bool(lp_ctx, NULL, "nbtd", "wins_randomize1Clist", false)) {
|
lpcfg_parm_bool(lp_ctx, NULL, "nbtd", "wins_randomize1Clist", false)) {
|
||||||
nbtd_wins_randomize1Clist(lp_ctx, addresses, src);
|
nbtd_wins_randomize1Clist(lp_ctx, addresses, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -959,7 +959,7 @@ static void nbtd_winsserver_release(struct nbt_name_socket *nbtsock,
|
|||||||
if (strcmp(rec->wins_owner, winssrv->wins_db->local_owner) != 0) {
|
if (strcmp(rec->wins_owner, winssrv->wins_db->local_owner) != 0) {
|
||||||
modify_flags = WINSDB_FLAG_ALLOC_VERSION | WINSDB_FLAG_TAKE_OWNERSHIP;
|
modify_flags = WINSDB_FLAG_ALLOC_VERSION | WINSDB_FLAG_TAKE_OWNERSHIP;
|
||||||
}
|
}
|
||||||
if (lp_parm_bool(iface->nbtsrv->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false)) {
|
if (lpcfg_parm_bool(iface->nbtsrv->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false)) {
|
||||||
/*
|
/*
|
||||||
* We have an option to propagate every name release,
|
* We have an option to propagate every name release,
|
||||||
* this is off by default to match windows servers
|
* this is off by default to match windows servers
|
||||||
@ -1038,7 +1038,7 @@ NTSTATUS nbtd_winsserver_init(struct nbtd_server *nbtsrv)
|
|||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
const char *owner;
|
const char *owner;
|
||||||
|
|
||||||
if (!lp_wins_support(nbtsrv->task->lp_ctx)) {
|
if (!lpcfg_wins_support(nbtsrv->task->lp_ctx)) {
|
||||||
nbtsrv->winssrv = NULL;
|
nbtsrv->winssrv = NULL;
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
@ -1046,18 +1046,18 @@ NTSTATUS nbtd_winsserver_init(struct nbtd_server *nbtsrv)
|
|||||||
nbtsrv->winssrv = talloc_zero(nbtsrv, struct wins_server);
|
nbtsrv->winssrv = talloc_zero(nbtsrv, struct wins_server);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(nbtsrv->winssrv);
|
NT_STATUS_HAVE_NO_MEMORY(nbtsrv->winssrv);
|
||||||
|
|
||||||
nbtsrv->winssrv->config.max_renew_interval = lp_max_wins_ttl(nbtsrv->task->lp_ctx);
|
nbtsrv->winssrv->config.max_renew_interval = lpcfg_max_wins_ttl(nbtsrv->task->lp_ctx);
|
||||||
nbtsrv->winssrv->config.min_renew_interval = lp_min_wins_ttl(nbtsrv->task->lp_ctx);
|
nbtsrv->winssrv->config.min_renew_interval = lpcfg_min_wins_ttl(nbtsrv->task->lp_ctx);
|
||||||
tmp = lp_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv", "tombstone_interval", 6*24*60*60);
|
tmp = lpcfg_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv", "tombstone_interval", 6*24*60*60);
|
||||||
nbtsrv->winssrv->config.tombstone_interval = tmp;
|
nbtsrv->winssrv->config.tombstone_interval = tmp;
|
||||||
tmp = lp_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv"," tombstone_timeout", 1*24*60*60);
|
tmp = lpcfg_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv"," tombstone_timeout", 1*24*60*60);
|
||||||
nbtsrv->winssrv->config.tombstone_timeout = tmp;
|
nbtsrv->winssrv->config.tombstone_timeout = tmp;
|
||||||
|
|
||||||
owner = lp_parm_string(nbtsrv->task->lp_ctx, NULL, "winsdb", "local_owner");
|
owner = lpcfg_parm_string(nbtsrv->task->lp_ctx, NULL, "winsdb", "local_owner");
|
||||||
|
|
||||||
if (owner == NULL) {
|
if (owner == NULL) {
|
||||||
struct interface *ifaces;
|
struct interface *ifaces;
|
||||||
load_interfaces(nbtsrv->task, lp_interfaces(nbtsrv->task->lp_ctx), &ifaces);
|
load_interfaces(nbtsrv->task, lpcfg_interfaces(nbtsrv->task->lp_ctx), &ifaces);
|
||||||
owner = iface_n_ip(ifaces, 0);
|
owner = iface_n_ip(ifaces, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ static void wins_release_demand_handler(struct nbt_name_request *req)
|
|||||||
if (state->current_address < state->io->in.num_addresses) {
|
if (state->current_address < state->io->in.num_addresses) {
|
||||||
struct nbtd_interface *iface;
|
struct nbtd_interface *iface;
|
||||||
|
|
||||||
state->release.in.dest_port = lp_nbt_port(state->io->in.nbtd_server->task->lp_ctx);
|
state->release.in.dest_port = lpcfg_nbt_port(state->io->in.nbtd_server->task->lp_ctx);
|
||||||
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
|
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
|
||||||
state->release.in.address = state->release.in.dest_addr;
|
state->release.in.address = state->release.in.dest_addr;
|
||||||
state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1);
|
state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1);
|
||||||
@ -223,7 +223,7 @@ static struct composite_context *wins_release_demand_send(TALLOC_CTX *mem_ctx, s
|
|||||||
* with 2 retries
|
* with 2 retries
|
||||||
*/
|
*/
|
||||||
state->release.in.name = *state->io->in.name;
|
state->release.in.name = *state->io->in.name;
|
||||||
state->release.in.dest_port = lp_nbt_port(state->io->in.nbtd_server->task->lp_ctx);
|
state->release.in.dest_port = lpcfg_nbt_port(state->io->in.nbtd_server->task->lp_ctx);
|
||||||
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
|
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
|
||||||
state->release.in.address = state->release.in.dest_addr;
|
state->release.in.address = state->release.in.dest_addr;
|
||||||
state->release.in.broadcast = false;
|
state->release.in.broadcast = false;
|
||||||
@ -306,7 +306,7 @@ NTSTATUS nbtd_proxy_wins_challenge(struct irpc_message *msg,
|
|||||||
s->req = req;
|
s->req = req;
|
||||||
|
|
||||||
s->io.in.nbtd_server = nbtd_server;
|
s->io.in.nbtd_server = nbtd_server;
|
||||||
s->io.in.nbt_port = lp_nbt_port(nbtd_server->task->lp_ctx);
|
s->io.in.nbt_port = lpcfg_nbt_port(nbtd_server->task->lp_ctx);
|
||||||
s->io.in.event_ctx = msg->ev;
|
s->io.in.event_ctx = msg->ev;
|
||||||
s->io.in.name = &req->in.name;
|
s->io.in.name = &req->in.name;
|
||||||
s->io.in.num_addresses = req->in.num_addrs;
|
s->io.in.num_addresses = req->in.num_addrs;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user