int torture_setting_int(struct torture_context *test, const char *name,
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,
const char *name,
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);
}
double torture_setting_double(struct torture_context *test, const char *name,
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 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,
SMB_ASSERT(test != 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)
return default_value;
{
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");
cd = iconv_open("UTF-16LE", "UCS-4LE");
"failed to open %s to UTF-16LE",
charset));
}
- cd2 = smb_iconv_open_ex(test, charset, "UTF-16LE", lp_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));
+ 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, lpcfg_parm_bool(test->lp_ctx, NULL, "iconv", "native", true));
last_charset = charset;
}
size_t size, size2;
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),
"Invalid Codepoint range");
buf[size+2] = 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,
talloc_asprintf(tctx,
const char **list = (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);
- num_dups = lp_parm_int(tctx->lp_ctx, NULL, "list_unique", "dups", 7);
+ count = lpcfg_parm_int(tctx->lp_ctx, NULL, "list_unique", "count", 9);
+ 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);
for (i = 0; i < count; i++) {
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());
while (poptPeekArg(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);
E_md4hash(oldpass, old_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(oldpass, old_lanman_hash)) {
struct loadparm_context *lp_ctx)
{
cli_credentials_set_username(cred, "", CRED_UNINITIALISED);
- cli_credentials_set_domain(cred, lp_workgroup(lp_ctx), CRED_UNINITIALISED);
- cli_credentials_set_workstation(cred, lp_netbios_name(lp_ctx), CRED_UNINITIALISED);
- cli_credentials_set_realm(cred, lp_realm(lp_ctx), CRED_UNINITIALISED);
+ cli_credentials_set_domain(cred, lpcfg_workgroup(lp_ctx), CRED_UNINITIALISED);
+ cli_credentials_set_workstation(cred, lpcfg_netbios_name(lp_ctx), CRED_UNINITIALISED);
+ cli_credentials_set_realm(cred, lpcfg_realm(lp_ctx), CRED_UNINITIALISED);
}
/**
cred->machine_account_pending = false;
filter = talloc_asprintf(cred, SECRETS_PRIMARY_DOMAIN_FILTER,
cli_credentials_get_domain(cred));
- status = cli_credentials_set_secrets(cred, event_context_find(cred), lp_ctx, NULL,
+ status = cli_credentials_set_secrets(cred, event_context_find(cred), lp_ctx, NULL,
SECRETS_PRIMARY_DOMAIN_DN,
filter, &error_string);
if (!NT_STATUS_IS_OK(status)) {
filter = talloc_asprintf(cred, SECRETS_KRBTGT_SEARCH,
cli_credentials_get_realm(cred),
cli_credentials_get_domain(cred));
- status = cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL,
+ status = cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL,
SECRETS_PRINCIPALS_DN,
filter, &error_string);
if (!NT_STATUS_IS_OK(status)) {
cli_credentials_get_realm(cred),
cli_credentials_get_domain(cred),
serviceprincipal);
- status = cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL,
+ status = cli_credentials_set_secrets(cred, event_ctx, lp_ctx, NULL,
SECRETS_PRINCIPALS_DN, filter,
&error_string);
if (!NT_STATUS_IS_OK(status)) {
return 0;
}
- ret = smb_krb5_init_context(cred, event_ctx, lp_ctx,
+ ret = smb_krb5_init_context(cred, event_ctx, lp_ctx,
&cred->smb_krb5_context);
if (ret) {
cred->smb_krb5_context = NULL;
return ENOMEM;
}
- ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx,
+ ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx,
&ccc->smb_krb5_context);
if (ret) {
(*error_string) = error_message(ret);
return ENOMEM;
}
- ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx,
+ ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx,
&ccc->smb_krb5_context);
if (ret) {
talloc_free(ccc);
return 0;
}
- ret = cli_credentials_get_ccache(cred, event_ctx, lp_ctx,
+ ret = cli_credentials_get_ccache(cred, event_ctx, lp_ctx,
&ccache, error_string);
if (ret) {
DEBUG(1, ("Failed to get CCACHE for GSSAPI client: %s\n", error_message(ret)));
return EINVAL;
}
- ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx,
+ ret = cli_credentials_get_krb5_context(cred, event_ctx, lp_ctx,
&smb_krb5_context);
if (ret) {
return ret;
_PUBLIC_ int cli_credentials_update_keytab(struct cli_credentials *cred,
struct tevent_context *event_ctx,
- struct loadparm_context *lp_ctx)
+ struct loadparm_context *lp_ctx)
{
krb5_error_code ret;
struct keytab_container *ktc;
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
return NULL;
- lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
- if (lp_ctx == NULL)
+ lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
+ if (lp_ctx == NULL)
return NULL;
cli_credentials_guess(creds, lp_ctx);
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
return NULL;
- lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
- if (lp_ctx == NULL)
+ lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
+ if (lp_ctx == NULL)
return NULL;
status = cli_credentials_set_machine_account(creds, lp_ctx);
if (!PyArg_ParseTuple(args, "|Os", &py_lp_ctx, &ccache_name))
return NULL;
- lp_ctx = lp_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
- if (lp_ctx == NULL)
+ lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaky */
+ if (lp_ctx == NULL)
return NULL;
event_ctx = tevent_context_init(NULL);
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
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)
{
- return lp_parm_bool(settings->lp_ctx, NULL, mechanism, name, default_value);
+ return lpcfg_parm_bool(settings->lp_ctx, NULL, mechanism, name, default_value);
}
/*
return NT_STATUS_INTERNAL_ERROR;
}
- realm = lp_realm(gensec_security->settings->lp_ctx);
+ realm = lpcfg_realm(gensec_security->settings->lp_ctx);
if (realm != NULL) {
ret = gsskrb5_set_default_realm(realm);
if (ret) {
gensec_gssapi_state = talloc_get_type(gensec_security->private_data, struct gensec_gssapi_state);
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;
} else {
principal = talloc_asprintf(gensec_gssapi_state, "%s/%s@%s",
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;
}
ret = cli_credentials_set_client_gss_creds(session_info->credentials,
gensec_security->event_ctx,
- gensec_security->settings->lp_ctx,
+ gensec_security->settings->lp_ctx,
gensec_gssapi_state->delegated_cred_handle,
CRED_SPECIFIED, &error_string);
if (ret) {
}
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;
}
workstation = bind_schannel.oem_netbios_computer.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",
- domain, lp_workgroup(gensec_security->settings->lp_ctx)));
+ domain, lpcfg_workgroup(gensec_security->settings->lp_ctx)));
return NT_STATUS_LOGON_FAILURE;
}
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);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("Could not find session key for attempted schannel connection from %s: %s\n",
if (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);
}
}
return ret;
}
- realm = lp_realm(lp_ctx);
+ realm = lpcfg_realm(lp_ctx);
if (realm != NULL) {
ret = krb5_set_default_realm(krb5_ctx, realm);
if (ret) {
/* Set options in kerberos */
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;
}
state->method = NULL;
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);
if (tevent_req_nterror(req, nt_status)) {
return tevent_req_post(req, ev);
static const char **auth_methods_from_lp(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
const char **auth_methods = NULL;
- switch (lp_server_role(lp_ctx)) {
+ switch (lpcfg_server_role(lp_ctx)) {
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;
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;
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;
}
return auth_methods;
const struct auth_usersupplied_info *user_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 = {
*lm_sess_key = data_blob(NULL, 0);
*user_sess_key = data_blob(NULL, 0);
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.nt,
user_info->mapped.account_name,
case AUTH_PASSWORD_RESPONSE:
status = ntlm_password_check(mem_ctx,
- lp_lanman_auth(auth_context->lp_ctx),
- lp_ntlm_auth(auth_context->lp_ctx),
+ lpcfg_lanman_auth(auth_context->lp_ctx),
+ lpcfg_ntlm_auth(auth_context->lp_ctx),
user_info->logon_parameters,
&auth_context->challenge.data,
&user_info->password.response.lanman,
return nt_status;
}
- nt_status = authsam_make_server_info(tmp_ctx, ctx->auth_ctx->sam_ctx, lp_netbios_name(ctx->auth_ctx->lp_ctx),
- lp_sam_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),
+ lpcfg_sam_name(ctx->auth_ctx->lp_ctx),
domain_dn,
msg,
user_sess_key, lm_sess_key,
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);
- 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);
/* 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:
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;
}
}
nt_status = authsam_make_server_info(tmp_ctx, auth_context->sam_ctx,
- lp_netbios_name(auth_context->lp_ctx),
- lp_workgroup(auth_context->lp_ctx),
+ lpcfg_netbios_name(auth_context->lp_ctx),
+ lpcfg_workgroup(auth_context->lp_ctx),
domain_dn,
msg,
user_sess_key, lm_sess_key,
/* 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 */
io.in.options.use_spnego = false;
/* 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) {
return NT_STATUS_INTERNAL_ERROR;
}
if (strequal(io.in.dest_host, "*")) {
return NT_STATUS_INTERNAL_ERROR;
}
- io.in.dest_ports = lp_smb_ports(ctx->auth_ctx->lp_ctx);
- io.in.socket_options = lp_socket_options(ctx->auth_ctx->lp_ctx);
- io.in.gensec_settings = lp_gensec_settings(mem_ctx, ctx->auth_ctx->lp_ctx);
+ io.in.dest_ports = lpcfg_smb_ports(ctx->auth_ctx->lp_ctx);
+ io.in.socket_options = lpcfg_socket_options(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);
/* We don't want to get as far as the session setup */
io.in.credentials = cli_credentials_init_anon(mem_ctx);
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);
io.in.service = NULL;
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);
NT_STATUS_NOT_OK_RETURN(status);
session_setup.in.credentials = creds;
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 */
nt_status = smb_composite_sesssetup(session, &session_setup);
return pam_to_nt_status(pam_error);
}
-static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx,
+static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx,
const struct auth_usersupplied_info *user_info, struct passwd **pws)
{
struct smb_pam_user_info *info;
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)) {
smb_pam_end(pamh);
return nt_status;
char *crypted;
struct passwd *pws;
NTSTATUS nt_status;
- int level = lp_passwordlevel(lp_ctx);
+ int level = lpcfg_passwordlevel(lp_ctx);
*ret_passwd = NULL;
#endif
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));
return NT_STATUS_LOGON_FAILURE;
}
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);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(check_ctx);
}
chall_blob = data_blob_talloc(mem_ctx, chal, 8);
- if (lp_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));
+ if (lpcfg_client_ntlmv2_auth(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;
if (!SMBNTLMv2encrypt_hash(user_info_temp,
SMBOWFencrypt(user_info_in->password.hash.nt->hash, chal, blob.data);
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);
SMBOWFencrypt(user_info_in->password.hash.lanman->hash, chal, blob.data);
user_info_temp->password.response.lanman = lm_blob;
if (ntlmssp_state->use_nt_response) {
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;
}
}
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);
if (lm_response.length == 24) {
SMBsesskeygen_lm_sess_key(lm_session_key.data, lm_response.data,
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->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", "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_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));
ntlmssp_state->neg_flags =
ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
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;
} else {
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];
/* Find out the DNS domain name */
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 */
safe_strcpy(dnsname, ntlmssp_state->server.netbios_name, sizeof(dnsname) - 1);
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
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)
return NULL;
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
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)
return NULL;
if (!PyArg_ParseTuple(args, "OO", &py_lp_ctx, &py_sid))
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)
return NULL;
nt_status = gensec_server_start(mem_ctx,
event_ctx,
- lp_gensec_settings(mem_ctx, lp_ctx),
+ lpcfg_gensec_settings(mem_ctx, lp_ctx),
auth_context,
&gensec_ctx);
if (!NT_STATUS_IS_OK(nt_status)) {
#include "auth/session_proto.h"
_PUBLIC_ struct auth_session_info *anonymous_session(TALLOC_CTX *mem_ctx,
- struct loadparm_context *lp_ctx)
+ struct loadparm_context *lp_ctx)
{
NTSTATUS nt_status;
struct auth_session_info *session_info = NULL;
* trusted/prvilaged account), including the local machine account as
* the off-host credentials
*/
-_PUBLIC_ struct auth_session_info *system_session(struct loadparm_context *lp_ctx)
+_PUBLIC_ struct auth_session_info *system_session(struct loadparm_context *lp_ctx)
{
static struct auth_session_info *static_session;
NTSTATUS nt_status;
struct auth_session_info *session_info = NULL;
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);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(mem_ctx);
/*
Create a system session, but with anonymous credentials (so we do not need to open secrets.ldb)
*/
-_PUBLIC_ struct auth_session_info *system_session_anon(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
+_PUBLIC_ struct auth_session_info *system_session_anon(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
NTSTATUS nt_status;
struct auth_session_info *session_info = NULL;
{
return _auth_system_session_info(parent_ctx,
lp_ctx,
- lp_parm_bool(lp_ctx, NULL, "system", "anonymous", false),
+ lpcfg_parm_bool(lp_ctx, NULL, "system", "anonymous", false),
_session_info);
}
struct auth_session_info *session_info = NULL;
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
- nt_status = auth_domain_admin_server_info(mem_ctx, lp_netbios_name(lp_ctx),
- lp_workgroup(lp_ctx), domain_sid,
+ nt_status = auth_domain_admin_server_info(mem_ctx, lpcfg_netbios_name(lp_ctx),
+ lpcfg_workgroup(lp_ctx), domain_sid,
&server_info);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(mem_ctx);
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
nt_status = auth_anonymous_server_info(mem_ctx,
- lp_netbios_name(lp_ctx),
+ lpcfg_netbios_name(lp_ctx),
&server_info);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(mem_ctx);
ret = tsocket_address_inet_from_strings(cldapd,
"ip",
address,
- lp_cldap_port(lp_ctx),
+ lpcfg_cldap_port(lp_ctx),
&socket_address);
if (ret != 0) {
status = map_nt_error_from_unix(errno);
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)));
return status;
}
/* if we are allowing incoming packets from any address, then
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");
NT_STATUS_NOT_OK_RETURN(status);
}
NTSTATUS status;
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) {
task_server_terminate(task, "cldapd: no network interfaces configured", false);
return;
}
- switch (lp_server_role(task->lp_ctx)) {
+ switch (lpcfg_server_role(task->lp_ctx)) {
case ROLE_STANDALONE:
task_server_terminate(task, "cldap_server: no CLDAP server required in standalone configuration",
false);
const char *none_attrs[] = {NULL};
struct ldb_result *dom_res = NULL, *user_res = NULL;
int ret;
- const char **services = lp_server_services(lp_ctx);
+ const char **services = lpcfg_server_services(lp_ctx);
uint32_t server_type;
const char *pdc_name;
struct GUID domain_uuid;
}
/* 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);
}
- 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);
}
if (domain_dn) {
"objectClass=domain");
if (ret != LDB_SUCCESS) {
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_errstring(sam_ctx)));
return NT_STATUS_NO_SUCH_DOMAIN;
#endif
pdc_name = talloc_asprintf(mem_ctx, "\\\\%s",
- lp_netbios_name(lp_ctx));
+ lpcfg_netbios_name(lp_ctx));
NT_STATUS_HAVE_NO_MEMORY(pdc_name);
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);
NT_STATUS_HAVE_NO_MEMORY(forest_domain);
pdc_dns_name = talloc_asprintf(mem_ctx, "%s.%s",
strlower_talloc(mem_ctx,
- lp_netbios_name(lp_ctx)),
+ lpcfg_netbios_name(lp_ctx)),
dns_domain);
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);
NT_STATUS_HAVE_NO_MEMORY(server_site);
client_site = samdb_client_site_name(sam_ctx, mem_ctx,
src_address, NULL);
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
* used to trigger this call, as the client is able to reach
}
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) {
obs = check_arg_numeric("obs");
count = check_arg_numeric("count");
- lp_smbcli_options(lp_ctx, &options);
- lp_smbcli_session_options(lp_ctx, &session_options);
+ lpcfg_smbcli_options(lp_ctx, &options);
+ lpcfg_smbcli_session_options(lp_ctx, &session_options);
/* Allocate IO buffer. We need more than the max IO size because we
* could accumulate a remainder if ibs and obs don't match.
DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
(unsigned long long)iomax, options.max_xmit));
- if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if",
- lp_smb_ports(lp_ctx), &options,
- lp_socket_options(lp_ctx),
+ if (!(ifile = open_file(lpcfg_resolve_context(lp_ctx), ev, "if",
+ lpcfg_smb_ports(lp_ctx), &options,
+ lpcfg_socket_options(lp_ctx),
&session_options,
- lp_gensec_settings(lp_ctx, lp_ctx)))) {
+ lpcfg_gensec_settings(lp_ctx, lp_ctx)))) {
return(FILESYS_EXIT_CODE);
}
- if (!(ofile = open_file(lp_resolve_context(lp_ctx), ev, "of",
- lp_smb_ports(lp_ctx), &options,
- lp_socket_options(lp_ctx),
+ if (!(ofile = open_file(lpcfg_resolve_context(lp_ctx), ev, "of",
+ lpcfg_smb_ports(lp_ctx), &options,
+ lpcfg_socket_options(lp_ctx),
&session_options,
- lp_gensec_settings(lp_ctx, lp_ctx)))) {
+ lpcfg_gensec_settings(lp_ctx, lp_ctx)))) {
return(FILESYS_EXIT_CODE);
}
poptFreeContext(pc);
- lp_smbcli_options(cmdline_lp_ctx, &smb_options);
- lp_smbcli_session_options(cmdline_lp_ctx, &smb_session_options);
+ lpcfg_smbcli_options(cmdline_lp_ctx, &smb_options);
+ lpcfg_smbcli_session_options(cmdline_lp_ctx, &smb_session_options);
ev_ctx = s4_event_context_init(talloc_autofree_context());
if (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;
}
if (message) {
- rc = do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost,
- lp_smb_ports(cmdline_lp_ctx), dest_ip,
+ rc = do_message_op(lpcfg_netbios_name(cmdline_lp_ctx), desthost,
+ lpcfg_smb_ports(cmdline_lp_ctx), dest_ip,
name_type, ev_ctx,
- lp_resolve_context(cmdline_lp_ctx),
+ lpcfg_resolve_context(cmdline_lp_ctx),
&smb_options,
- lp_socket_options(cmdline_lp_ctx));
+ lpcfg_socket_options(cmdline_lp_ctx));
return rc;
}
- if (!do_connect(ctx, ev_ctx, lp_resolve_context(cmdline_lp_ctx),
- desthost, lp_smb_ports(cmdline_lp_ctx), service,
- lp_socket_options(cmdline_lp_ctx),
+ if (!do_connect(ctx, ev_ctx, lpcfg_resolve_context(cmdline_lp_ctx),
+ desthost, lpcfg_smb_ports(cmdline_lp_ctx), service,
+ lpcfg_socket_options(cmdline_lp_ctx),
cmdline_credentials, &smb_options, &smb_session_options,
- lp_gensec_settings(ctx, cmdline_lp_ctx)))
+ lpcfg_gensec_settings(ctx, cmdline_lp_ctx)))
return 1;
if (base_directory) {
return count;
}
-NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, struct ldb_message *msg,
+NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, struct ldb_message *msg,
struct samr_Password **lm_pwd, struct samr_Password **nt_pwd)
{
struct samr_Password *lmPwdHash, *ntPwdHash;
/* Ensure that if we have turned off LM
* authentication, that we never use the LM hash, even
* if we store it */
- if (lp_lanman_auth(lp_ctx)) {
+ if (lpcfg_lanman_auth(lp_ctx)) {
unsigned int num_lm;
num_lm = samdb_result_hashes(mem_ctx, msg, "dBCSPwd", &lmPwdHash);
if (num_lm == 0) {
int fd;
unsigned int i;
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);
- 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 */
TALLOC_FREE(service->confupdate.subreq);
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) {
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) {
path_static = private_path(tmp_ctx, service->task->lp_ctx, "named.conf.update.static");
}
*/
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 *spn_update_command = lp_spn_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 = lpcfg_spn_update_command(service->task->lp_ctx);
/* kill any existing child */
TALLOC_FREE(service->nameupdate.subreq);
NTSTATUS status;
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 */
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 */
- 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_rebuild(service);
uint32_t tombstoneLifetime;
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)) {
return NT_STATUS_OK;
}
r1->other_info = talloc_zero(reps, struct repsFromTo1OtherInfo);
r1->other_info->dns_name = talloc_asprintf(r1->other_info, "%s._msdcs.%s",
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_invocation_id = invocation_id;
r1->replica_flags =
struct kccsrv_service *service;
uint32_t periodic_startup_interval;
- switch (lp_server_role(task->lp_ctx)) {
+ switch (lpcfg_server_role(task->lp_ctx)) {
case ROLE_STANDALONE:
task_server_terminate(task, "kccsrv: no KCC required in standalone configuration", false);
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 */
- 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 */
status = kccsrv_periodic_schedule(service, periodic_startup_interval);
ntds_dns_name = talloc_asprintf(r, "%s._msdcs.%s",
ntds_guid_str,
- lp_dnsdomain(service->task->lp_ctx));
+ lpcfg_dnsdomain(service->task->lp_ctx));
if (tevent_req_nomem(ntds_dns_name, req)) {
return;
}
sdsa->repsFrom1->other_info->dns_name =
talloc_asprintf(sdsa->repsFrom1->other_info, "%s._msdcs.%s",
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) {
talloc_free(sdsa);
return WERR_NOMEM;
bool am_rodc;
int ret;
- switch (lp_server_role(task->lp_ctx)) {
+ switch (lpcfg_server_role(task->lp_ctx)) {
case ROLE_STANDALONE:
task_server_terminate(task, "dreplsrv: no DSDB replication required in standalone configuration",
false);
return;
}
- periodic_startup_interval = lp_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 */
+ periodic_startup_interval = lpcfg_parm_int(task->lp_ctx, NULL, "dreplsrv", "periodic_startup_interval", 15); /* 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);
if (!W_ERROR_IS_OK(status)) {
/* if we are a RODC then we do not send DSReplicaSync*/
ret = samdb_rodc(service->samdb, &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 */
status = dreplsrv_notify_schedule(service, service->notify.interval);
if (!W_ERROR_IS_OK(status)) {
}
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);
ldb_module_set_private(module, data);
}
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);
ldb_module_set_private(module, data);
data->partitions[i]->ctrl->dn) != 0)) {
char *ref = talloc_asprintf(ac,
"ldap://%s/%s%s",
- lp_dnsdomain(lp_ctx),
+ lpcfg_dnsdomain(lp_ctx),
ldb_dn_get_linearized(data->partitions[i]->ctrl->dn),
req->op.search.scope == LDB_SCOPE_ONELEVEL ? "??base" : "");
return ret;
}
- if (lp_lanman_auth(lp_ctx)) {
+ if (lpcfg_lanman_auth(lp_ctx)) {
ret = setup_lm_fields(io);
if (ret != LDB_SUCCESS) {
return ret;
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);
memcpy(io->n.lm_hash->hash, lm_hash->data, MIN(lm_hash->length,
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);
memcpy(io->og.lm_hash->hash, old_lm_hash->data, MIN(old_lm_hash->length,
sizeof(io->og.lm_hash->hash)));
lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
struct loadparm_context);
- ac->status->domain_data.dns_domain = lp_dnsdomain(lp_ctx);
- ac->status->domain_data.realm = lp_realm(lp_ctx);
- ac->status->domain_data.netbios_domain = lp_sam_name(lp_ctx);
+ ac->status->domain_data.dns_domain = lpcfg_dnsdomain(lp_ctx);
+ ac->status->domain_data.realm = lpcfg_realm(lp_ctx);
+ ac->status->domain_data.netbios_domain = lpcfg_sam_name(lp_ctx);
ac->status->reject_reason = SAM_PWD_CHANGE_NO_ERROR;
referral = talloc_asprintf(req,
"ldap://%s/%s",
- lp_dnsdomain(lp_ctx),
+ lpcfg_dnsdomain(lp_ctx),
ldb_dn_get_linearized(msg->dn));
ret = ldb_module_send_referral(req, referral);
return ldb_module_done(req, NULL, NULL, ret);
(struct loadparm_context *)ldb_get_opaque(ldb, "loadparm");
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));
if (!msg) {
DEBUG(3,(__location__ ": Failed to create messaging context\n"));
DSDB_FLAG_NEXT_MODULE |
DSDB_SEARCH_SEARCH_ALL_PARTITIONS,
"(&(objectClass=sambaDomain)(sambaDomainName=%s))",
- lp_sam_name(ldb_get_opaque(ldb, "loadparm")));
+ lpcfg_sam_name(ldb_get_opaque(ldb, "loadparm")));
if (ret != LDB_SUCCESS) {
ldb_asprintf_errstring(ldb,
__location__
}
if ( ! ac->sid) {
- sid_generator = lp_sid_generator(lp_ctx);
+ sid_generator = lpcfg_sid_generator(lp_ctx);
if (sid_generator == SID_GENERATOR_INTERNAL) {
ret = samldb_add_step(ac, samldb_allocate_sid);
if (ret != LDB_SUCCESS) return ret;
that we always get the same pointer in ldb_wrap_connect()
*/
struct cli_credentials *samdb_credentials(struct tevent_context *event_ctx,
- struct loadparm_context *lp_ctx)
+ struct loadparm_context *lp_ctx)
{
static struct cli_credentials *static_credentials;
struct cli_credentials *cred;
struct auth_session_info *session_info)
{
struct ldb_context *ldb;
- ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx,
- lp_sam_url(lp_ctx), session_info,
- samdb_credentials(ev_ctx, lp_ctx),
+ ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx,
+ lpcfg_sam_url(lp_ctx), session_info,
+ samdb_credentials(ev_ctx, lp_ctx),
0);
if (!ldb) {
return NULL;
struct tevent_context *ev_ctx,
struct loadparm_context *lp_ctx)
{
- return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, "privilege.ldb",
+ return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, "privilege.ldb",
NULL, NULL, 0);
}
unsigned int i;
krb5_error_code ret = 0;
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;
NTTIME acct_expiry;
* their probably patheticly insecure password) */
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)) {
entry_ex->entry.flags.server = 0;
}
&& principal->name.name_string.len == 2
&& (strcmp(principal->name.name_string.val[0], "kadmin") == 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.client = 0;
{
struct loadparm_context *lp_ctx = kdc_db_ctx->lp_ctx;
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;
struct samr_Password password_hash;
const struct ldb_val *password_val;
/* krbtgt case. Either us or a trusted realm */
- if (lp_is_my_domain_or_realm(lp_ctx, principal->realm)
- && lp_is_my_domain_or_realm(lp_ctx, principal->name.name_string.val[1])) {
+ if (lpcfg_is_my_domain_or_realm(lp_ctx, principal->realm)
+ && lpcfg_is_my_domain_or_realm(lp_ctx, principal->name.name_string.val[1])) {
/* us */
/* Cludge, cludge cludge. If the realm part of krbtgt/realm,
* is in our db, then direct the caller at our primary
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) {
ret = ENOMEM;
krb5_set_error_message(context, ret, "strupper_talloc: out of memory");
/* 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 */
direction = INBOUND;
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 */
direction = OUTBOUND;
realm = principal->realm;
model_ops,
&kdc_tcp_stream_ops,
"ip", address, &port,
- lp_socket_options(kdc->task->lp_ctx),
+ lpcfg_socket_options(kdc->task->lp_ctx),
kdc_socket);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to bind to %s:%u TCP - %s\n",
for (i=0; i<num_interfaces; i++) {
const char *address = talloc_strdup(tmp_ctx, iface_n_ip(ifaces, i));
- uint16_t kdc_port = lp_krb5_port(lp_ctx);
- uint16_t kpasswd_port = lp_kpasswd_port(lp_ctx);
+ uint16_t kdc_port = lpcfg_krb5_port(lp_ctx);
+ uint16_t kpasswd_port = lpcfg_kpasswd_port(lp_ctx);
if (kdc_port) {
status = kdc_add_socket(kdc, model_ops,
}
ret = krb5_make_principal(kdc->smb_krb5_context->krb5_context, &principal,
- lp_realm(kdc->task->lp_ctx),
- "krbtgt", lp_realm(kdc->task->lp_ctx),
+ lpcfg_realm(kdc->task->lp_ctx),
+ "krbtgt", lpcfg_realm(kdc->task->lp_ctx),
NULL);
if (ret != 0) {
krb5_error_code ret;
struct interface *ifaces;
- switch (lp_server_role(task->lp_ctx)) {
+ switch (lpcfg_server_role(task->lp_ctx)) {
case ROLE_STANDALONE:
task_server_terminate(task, "kdc: no KDC required in standalone configuration", false);
return;
break;
}
- load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
+ load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
if (iface_count(ifaces) == 0) {
task_server_terminate(task, "kdc: no network interfaces configured", false);
case KRB5_KPASSWD_VERS_CHANGEPW:
{
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,
(const char *)input->data,
input->length,
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,
(const char *)chpw.newpasswd.data,
chpw.newpasswd.length,
}
/* 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) {
- lp_load(ctx->db_ctx->lp_ctx, s4_conf_file);
+ lpcfg_load(ctx->db_ctx->lp_ctx, s4_conf_file);
} 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);
}
nt_status = authsam_make_server_info(mem_ctx, p->kdc_db_ctx->samdb,
- lp_netbios_name(p->kdc_db_ctx->lp_ctx),
- lp_sam_name(p->kdc_db_ctx->lp_ctx),
+ lpcfg_netbios_name(p->kdc_db_ctx->lp_ctx),
+ lpcfg_sam_name(p->kdc_db_ctx->lp_ctx),
p->realm_dn,
p->msg,
data_blob(NULL, 0),
conn->ldb = ldb_wrap_connect(conn,
conn->connection->event.ctx,
conn->lp_ctx,
- lp_sam_url(conn->lp_ctx),
+ lpcfg_sam_url(conn->lp_ctx),
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);
if (conn->ldb == NULL) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
= gensec_use_kerberos_mechs(conn, backends, conn->server_credentials);
unsigned int i, j = 0;
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;
if (ops[i]->sasl_name && ops[i]->server_start) {
add a socket address to the list of events, one event per port
*/
static NTSTATUS add_socket(struct tevent_context *event_context,
- struct loadparm_context *lp_ctx,
+ struct loadparm_context *lp_ctx,
const struct model_ops *model_ops,
const char *address, struct ldapsrv_service *ldap_service)
{
status = stream_setup_socket(event_context, lp_ctx,
model_ops, &ldap_stream_nonpriv_ops,
"ipv4", address, &port,
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
ldap_service);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
if (tls_support(ldap_service->tls_params)) {
/* add ldaps server */
port = 636;
- status = stream_setup_socket(event_context, lp_ctx,
+ status = stream_setup_socket(event_context, lp_ctx,
model_ops,
&ldap_stream_nonpriv_ops,
"ipv4", address, &port,
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
ldap_service);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
model_ops,
&ldap_stream_nonpriv_ops,
"ipv4", address, &port,
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
ldap_service);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("ldapsrv failed to bind to %s:%u - %s\n",
NTSTATUS status;
const struct model_ops *model_ops;
- switch (lp_server_role(task->lp_ctx)) {
+ switch (lpcfg_server_role(task->lp_ctx)) {
case ROLE_STANDALONE:
task_server_terminate(task, "ldap_server: no LDAP server required in standalone configuration",
false);
ldap_service->tls_params = tls_initialise(ldap_service, task->lp_ctx);
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;
int num_interfaces;
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);
/* We have been given an interfaces line, and been
if (!NT_STATUS_IS_OK(status)) goto failed;
}
} else {
- status = add_socket(task->event_ctx, task->lp_ctx, model_ops,
- lp_socket_address(task->lp_ctx), ldap_service);
+ status = add_socket(task->event_ctx, task->lp_ctx, model_ops,
+ lpcfg_socket_address(task->lp_ctx), ldap_service);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
status = stream_setup_socket(task->event_ctx, task->lp_ctx,
model_ops, &ldap_stream_nonpriv_ops,
"unix", ldapi_path, NULL,
- lp_socket_options(task->lp_ctx),
+ lpcfg_socket_options(task->lp_ctx),
ldap_service);
talloc_free(ldapi_path);
if (!NT_STATUS_IS_OK(status)) {
status = stream_setup_socket(task->event_ctx, task->lp_ctx,
model_ops, &ldap_stream_priv_ops,
"unix", ldapi_path, NULL,
- lp_socket_options(task->lp_ctx),
+ lpcfg_socket_options(task->lp_ctx),
ldap_service);
talloc_free(ldapi_path);
if (!NT_STATUS_IS_OK(status)) {
const char *pname;
if (reason == POPT_CALLBACK_REASON_POST) {
- if (lp_configfile(cmdline_lp_ctx) == NULL) {
- lp_load_default(cmdline_lp_ctx);
+ if (lpcfg_configfile(cmdline_lp_ctx) == NULL) {
+ lpcfg_load_default(cmdline_lp_ctx);
}
/* Hook any 'every Samba program must do this, after
* the smb.conf is setup' functions here */
break;
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);
exit(1);
}
break;
case 'd':
- lp_set_cmdline(cmdline_lp_ctx, "log level", arg);
+ lpcfg_set_cmdline(cmdline_lp_ctx, "log level", arg);
break;
case OPT_DEBUG_STDERR:
case 's':
if (arg) {
- lp_load(cmdline_lp_ctx, arg);
+ lpcfg_load(cmdline_lp_ctx, arg);
}
break;
case 'l':
if (arg) {
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);
}
break;
switch(opt->val) {
case 'O':
if (arg) {
- lp_set_cmdline(lp_ctx, "socket options", arg);
+ lpcfg_set_cmdline(lp_ctx, "socket options", arg);
}
break;
case 'W':
- lp_set_cmdline(lp_ctx, "workgroup", arg);
+ lpcfg_set_cmdline(lp_ctx, "workgroup", arg);
break;
case 'r':
- lp_set_cmdline(lp_ctx, "realm", arg);
+ lpcfg_set_cmdline(lp_ctx, "realm", arg);
break;
case 'n':
- lp_set_cmdline(lp_ctx, "netbios name", arg);
+ lpcfg_set_cmdline(lp_ctx, "netbios name", arg);
break;
case 'i':
- lp_set_cmdline(lp_ctx, "netbios scope", arg);
+ lpcfg_set_cmdline(lp_ctx, "netbios scope", arg);
break;
case 'm':
- lp_set_cmdline(lp_ctx, "client max protocol", arg);
+ lpcfg_set_cmdline(lp_ctx, "client max protocol", arg);
break;
case 'R':
- lp_set_cmdline(lp_ctx, "name resolve order", arg);
+ lpcfg_set_cmdline(lp_ctx, "name resolve order", arg);
break;
case 'S':
- lp_set_cmdline(lp_ctx, "client signing", arg);
+ lpcfg_set_cmdline(lp_ctx, "client signing", arg);
break;
}
if (server == NULL) {
return dcerpc_pipe_connect(ctx->event_ctx, p, "ncalrpc",
&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);
bd->flags |= DCERPC_DEBUG_PRINT_BOTH;
status = dcerpc_pipe_connect_b(ctx->event_ctx, p, bd,
&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;
}
ldb_set_modules_dir(ldb,
talloc_asprintf(ldb,
"%s/ldb",
- lp_modulesdir(lp_ctx)));
+ lpcfg_modulesdir(lp_ctx)));
if (session_info) {
if (ldb_set_opaque(ldb, "sessionInfo", session_info)) {
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);
}
}
/* 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;
}
DLIST_ADD(ldb_wrap_list, w);
/* 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);
if (schema) {
dsdb_make_schema_global(ldb, schema);
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) {
PyErr_SetString(PyExc_TypeError, "Expected loadparm object");
return NULL;
ev = s4_event_context_init(ret->mem_ctx);
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));
} else {
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
ev = s4_event_context_init(ret->mem_ctx);
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));
} else {
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
*_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;
torture_assert(tctx, data->msg_ctx1 =
messaging_init(tctx,
- lp_messaging_path(tctx, tctx->lp_ctx),
+ lpcfg_messaging_path(tctx, tctx->lp_ctx),
cluster_id(0, MSG_ID1),
data->ev),
"Failed to init first messaging context");
torture_assert(tctx, data->msg_ctx2 =
messaging_init(tctx,
- lp_messaging_path(tctx, tctx->lp_ctx),
+ lpcfg_messaging_path(tctx, tctx->lp_ctx),
cluster_id(0, MSG_ID2),
data->ev),
"Failed to init second messaging context");
int timelimit = torture_setting_int(tctx, "timelimit", 10);
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;
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);
torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
messaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit);
msg_client_ctx = messaging_init(tctx,
- lp_messaging_path(tctx, tctx->lp_ctx),
+ lpcfg_messaging_path(tctx, tctx->lp_ctx),
cluster_id(0, 2),
ev);
gp_ctx->cli = smbcli_state_init(gp_ctx);
- lp_smbcli_options(gp_ctx->lp_ctx, &options);
- lp_smbcli_session_options(gp_ctx->lp_ctx, &session_options);
+ lpcfg_smbcli_options(gp_ctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(gp_ctx->lp_ctx, &session_options);
return smbcli_full_connection(gp_ctx,
&gp_ctx->cli,
gp_ctx->active_dc.name,
- lp_smb_ports(gp_ctx->lp_ctx),
+ lpcfg_smb_ports(gp_ctx->lp_ctx),
"sysvol",
NULL,
- lp_socket_options(gp_ctx->lp_ctx),
+ lpcfg_socket_options(gp_ctx->lp_ctx),
gp_ctx->credentials,
- lp_resolve_context(gp_ctx->lp_ctx),
+ lpcfg_resolve_context(gp_ctx->lp_ctx),
gp_ctx->ev_ctx,
&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;
}
io = talloc_zero(mem_ctx, struct libnet_LookupDCs);
NT_STATUS_HAVE_NO_MEMORY(io);
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 */
rv = libnet_LookupDCs(net_ctx, mem_ctx, io);
gpo->display_name = talloc_strdup(gpo, display_name);
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);
/* Create the GPT */
&py_credentials))
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) {
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
return NULL;
&py_credentials, &py_lp_ctx))
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) {
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
return NULL;
const char *location;
location = talloc_asprintf(ctx, "%s/%s.ldb",
- lp_private_dir(lp_ctx),
+ lpcfg_private_dir(lp_ctx),
name);
W_ERROR_HAVE_NO_MEMORY(location);
TALLOC_CTX *mem_ctx = tctx;
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);
torture_assert_ntstatus_ok(tctx, status, "creating DGRAM IP socket 1");
torture_assert_ntstatus_ok(tctx, status, "creating IP stream socket 1");
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,
iface_best_ip(ifaces, "127.0.0.1"), 0);
torture_assert(tctx, localhost, "Localhost not found");
struct tls_params *params;
int ret;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
- const char *keyfile = lp_tls_keyfile(tmp_ctx, lp_ctx);
- const char *certfile = lp_tls_certfile(tmp_ctx, lp_ctx);
- const char *cafile = lp_tls_cafile(tmp_ctx, lp_ctx);
- const char *crlfile = lp_tls_crlfile(tmp_ctx, lp_ctx);
- const char *dhpfile = lp_tls_dhpfile(tmp_ctx, lp_ctx);
+ const char *keyfile = lpcfg_tls_keyfile(tmp_ctx, lp_ctx);
+ const char *certfile = lpcfg_tls_certfile(tmp_ctx, lp_ctx);
+ const char *cafile = lpcfg_tls_cafile(tmp_ctx, lp_ctx);
+ const char *crlfile = lpcfg_tls_crlfile(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 *);
params = talloc(mem_ctx, struct tls_params);
if (params == 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;
talloc_free(tmp_ctx);
return params;
if (!file_exist(cafile)) {
char *hostname = talloc_asprintf(mem_ctx, "%s.%s",
- lp_netbios_name(lp_ctx),
- lp_dnsdomain(lp_ctx));
+ lpcfg_netbios_name(lp_ctx),
+ lpcfg_dnsdomain(lp_ctx));
if (hostname == NULL) {
goto init_failed;
}
status = gensec_client_start(conn, &conn->gensec,
conn->event.event_ctx,
- lp_gensec_settings(conn, lp_ctx));
+ lpcfg_gensec_settings(conn, lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Failed to start GENSEC engine (%s)\n", nt_errstr(status)));
goto failed;
* local host name as the target for gensec's
* DIGEST-MD5 mechanism */
conn->host = talloc_asprintf(conn, "%s.%s",
- lp_netbios_name(conn->lp_ctx),
- lp_dnsdomain(conn->lp_ctx));
+ lpcfg_netbios_name(conn->lp_ctx),
+ lpcfg_dnsdomain(conn->lp_ctx));
if (composite_nomem(conn->host, state->ctx)) {
return result;
}
}
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;
ctx->async.fn = ldap_connect_recv_tcp_conn;
talloc_steal(conn, conn->sock);
if (conn->ldaps) {
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) {
talloc_free(conn->sock);
bool resolve_context_add_bcast_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
{
struct interface *ifaces;
- load_interfaces(ctx, lp_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));
+ load_interfaces(ctx, lpcfg_interfaces(lp_ctx), &ifaces);
+ return resolve_context_add_bcast_method(ctx, ifaces, lpcfg_nbt_port(lp_ctx), lpcfg_parm_int(lp_ctx, NULL, "nbt", "timeout", 1));
}
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"));
}
#include "libcli/resolve/resolve.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;
struct resolve_context *ret = resolve_context_init(lp_ctx);
bool resolve_context_add_wins_method_lp(struct resolve_context *ctx, struct loadparm_context *lp_ctx)
{
struct interface *ifaces;
- load_interfaces(ctx, lp_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));
+ load_interfaces(ctx, lpcfg_interfaces(lp_ctx), &ifaces);
+ 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));
}
int num_dests;
const char **hostnames;
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 */
} in;
struct {
const char *wrepl_best_ip(struct loadparm_context *lp_ctx, const char *peer_ip)
{
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);
}
dcerpc_init(lp_ctx);
/* name resolution methods */
- ctx->resolve_ctx = lp_resolve_context(lp_ctx);
+ ctx->resolve_ctx = lpcfg_resolve_context(lp_ctx);
/* connected services' params */
ZERO_STRUCT(ctx->samr);
static int32_t get_dc_function_level(struct loadparm_context *lp_ctx)
{
/* 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);
}
ret = tsocket_address_inet_from_strings(s, "ip",
s->source_dsa.address,
- lp_cldap_port(s->libnet->lp_ctx),
+ lpcfg_cldap_port(s->libnet->lp_ctx),
&dest_address);
if (ret != 0) {
c->status = map_nt_error_from_unix(errno);
* configuration partition works fine, but it fails for
* 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))
{
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_str = "print,";
r->in.req.req1.options = DRSUAPI_DRS_ADD_REF | DRSUAPI_DRS_DEL_REF;
/* 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;
}
return NT_STATUS_NO_MEMORY;
}
- remote_ldb = ldb_wrap_connect(tmp_ctx, ctx->event_ctx, ctx->lp_ctx,
+ remote_ldb = ldb_wrap_connect(tmp_ctx, ctx->event_ctx, ctx->lp_ctx,
remote_ldb_url,
NULL, ctx->cred, 0);
if (!remote_ldb) {
connect_with_info->out.domain_name = talloc_strdup(tmp_ctx, r->in.domain_name);
} else {
/* 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.realm = talloc_strdup(tmp_ctx, lp_realm(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, lpcfg_realm(ctx->lp_ctx));
}
}
if (r->in.netbios_name != NULL) {
netbios_name = r->in.netbios_name;
} 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) {
r->out.error_string = NULL;
talloc_free(tmp_mem);
struct composite_context *c;
struct messaging_context *msg_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);
- c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx),
- lp_nbt_port(ctx->lp_ctx), io->in.domain_name,
+ c = finddcs_send(mem_ctx, lpcfg_netbios_name(ctx->lp_ctx),
+ lpcfg_nbt_port(ctx->lp_ctx), io->in.domain_name,
io->in.name_type, NULL, ctx->resolve_ctx,
ctx->event_ctx, msg_ctx);
return c;
if (strcasecmp_m(s->name, secret_name) != 0) {
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,
(void **)&secret_string, NULL, false)) {
r->out.error_string = talloc_asprintf(mem_ctx,
state->remote_ldb = ldb_wrap_connect(mem_ctx,
state->samsync_state->machine_net_ctx->event_ctx,
- state->samsync_state->machine_net_ctx->lp_ctx,
+ state->samsync_state->machine_net_ctx->lp_ctx,
ldap_url,
NULL, state->samsync_state->machine_net_ctx->cred,
0);
state->sam_ldb = samdb_connect(mem_ctx,
ctx->event_ctx,
- ctx->lp_ctx,
+ ctx->lp_ctx,
r->in.session_info);
if (!state->sam_ldb) {
return NT_STATUS_INTERNAL_DB_ERROR;
}
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)) {
libnet_r->out.error_string = NULL;
talloc_free(tmp_ctx);
r->in.dest_address = dest_addr;
r->in.netbios_name = libnet_r->in.netbios_name;
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);
if (!NT_STATUS_IS_OK(status)) {
ret = tsocket_address_inet_from_strings(s, "ip",
s->source_dsa.address,
- lp_cldap_port(s->libnet->lp_ctx),
+ lpcfg_cldap_port(s->libnet->lp_ctx),
&dest_address);
if (ret != 0) {
c->status = map_nt_error_from_unix(errno);
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++) {
struct ldb_ldif ldif;
fprintf(stdout, "#\n");
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++) {
struct ldb_ldif ldif;
fprintf(stdout, "#\n");
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));
NDR_PRINT_DEBUG(drsuapi_DsReplicaLinkedAttribute, &linked_attributes[i]);
dump_data(0,
if (r->in.netbios_name != NULL) {
netbios_name = r->in.netbios_name;
} 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) {
talloc_free(join);
r->out.error_string = NULL;
/* Now set these values into the smb.conf - we probably had
* empty or useless defaults here from whatever smb.conf we
* started with */
- lp_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, "realm", join->out.realm);
+ lpcfg_set_cmdline(s->lp_ctx, "workgroup", join->out.domain_name);
b.in.domain_dns_name = join->out.realm;
b.in.domain_netbios_name = join->out.domain_name;
b.in.callbacks.config_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);
if (!NT_STATUS_IS_OK(status)) {
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;
mem_ctx = talloc_new(NULL);
ret->ev = s4_event_context_init(NULL);
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) {
Py_DECREF(ret);
return NULL;
/* prepare smb connection parameters: we're connecting to IPC$ share on
remote rpc server */
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)
conn->in.called_name = "*SMBSERVER"; /* FIXME: This is invalid */
else
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_type = NULL;
- conn->in.workgroup = lp_workgroup(lp_ctx);
- conn->in.gensec_settings = lp_gensec_settings(conn, lp_ctx);
+ conn->in.workgroup = lpcfg_workgroup(lp_ctx);
+ conn->in.gensec_settings = lpcfg_gensec_settings(conn, lp_ctx);
- lp_smbcli_options(lp_ctx, &conn->in.options);
- lp_smbcli_session_options(lp_ctx, &conn->in.session_options);
+ lpcfg_smbcli_options(lp_ctx, &conn->in.options);
+ lpcfg_smbcli_session_options(lp_ctx, &conn->in.session_options);
/*
* provide proper credentials - user supplied, but allow a
cli_credentials_guess(s->io.creds, lp_ctx);
}
- lp_smbcli_options(lp_ctx, &options);
+ lpcfg_smbcli_options(lp_ctx, &options);
/* send smb2 connect request */
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$",
s->io.resolve_ctx,
s->io.creds,
c->event_ctx,
&options,
- lp_socket_options(lp_ctx),
- lp_gensec_settings(mem_ctx, lp_ctx)
+ lpcfg_socket_options(lp_ctx),
+ lpcfg_gensec_settings(mem_ctx, lp_ctx)
);
composite_continue(c, conn_req, continue_smb2_connect, c);
return c;
s->io = *io;
/* 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);
composite_continue(c, pipe_req, continue_pipe_open_ncalrpc, c);
return c;
pc.binding = s->binding;
pc.interface = s->table;
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 */
switch (s->binding->transport) {
if (composite_nomem(s->pipe, c)) return c;
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 */
s->binding = binding;
/* send bind auth request with received creds */
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,
NULL);
if (composite_nomem(auth_req, c)) return;
/* initiate a authenticated bind */
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_NTLMSSP,
dcerpc_auth_level(s->pipe->conn),
s->table->authservices->names[0]);
/* initiate a authenticated bind */
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_SPNEGO,
dcerpc_auth_level(s->pipe->conn),
s->table->authservices->names[0]);
/* try SPNEGO with fallback to NTLMSSP */
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_SPNEGO,
dcerpc_auth_level(conn),
s->table->authservices->names[0]);
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),
auth_type,
dcerpc_auth_level(conn),
s->table->authservices->names[0]);
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) {
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
talloc_free(mem_ctx);
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) {
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
talloc_free(mem_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)) {
DEBUG(2, ("Not a PDC, so not processing LOGON_PRIMARY_QUERY\n"));
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));
return;
}
pdc = &netlogon_response.data.get_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->domain_name = lp_workgroup(iface->nbtsrv->task->lp_ctx);
+ pdc->domain_name = lpcfg_workgroup(iface->nbtsrv->task->lp_ctx);
pdc->nt_version = 1;
pdc->lmnt_token = 0xFFFF;
pdc->lm20_token = 0xFFFF;
dgram_mailslot_netlogon_reply(reply_iface->dgmsock,
packet,
- lp_netbios_name(iface->nbtsrv->task->lp_ctx),
+ lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx),
netlogon->req.pdc.mailslot_name,
&netlogon_response);
}
dgram_mailslot_netlogon_reply(reply_iface->dgmsock,
packet,
- lp_netbios_name(iface->nbtsrv->task->lp_ctx),
+ lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx),
netlogon->req.logon.mailslot_name,
&netlogon_response);
}
logon = &reply.req.reply;
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->domain = lp_workgroup(iface->nbtsrv->task->lp_ctx);
+ logon->domain = lpcfg_workgroup(iface->nbtsrv->task->lp_ctx);
logon->nt_version = 1;
logon->lmnt_token = 0xFFFF;
logon->lm20_token = 0xFFFF;
dgram_mailslot_ntlogon_reply(reply_iface->dgmsock,
packet,
- lp_netbios_name(iface->nbtsrv->task->lp_ctx),
+ lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx),
ntlogon->req.logon.mailslot_name,
&reply);
}
bcast_addr = socket_address_from_strings(tmp_ctx, bcast_dgmsock->sock->backend_name,
iface->bcast_address,
- lp_dgram_port(iface->nbtsrv->task->lp_ctx));
+ lpcfg_dgram_port(iface->nbtsrv->task->lp_ctx));
if (!bcast_addr) {
talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;
if (!NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx);
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)));
return status;
}
}
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) {
talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;
if (!NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx);
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;
}
}
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) {
talloc_free(iface);
return NT_STATUS_NO_MEMORY;
status = socket_listen(bcast_nbtsock->sock, bcast_address, 0, 0);
if (!NT_STATUS_IS_OK(status)) {
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);
return status;
}
unicast_address = socket_address_from_strings(iface->nbtsock,
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);
if (!NT_STATUS_IS_OK(status)) {
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);
return status;
}
/* if we are allowing incoming packets from any address, then
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;
/* the primary address is the address we will return
primary_address = iface_n_ip(ifaces, 0);
} else {
primary_address = inet_ntoa(interpret_addr2(
- lp_netbios_name(lp_ctx)));
+ lpcfg_netbios_name(lp_ctx)));
}
primary_address = talloc_strdup(tmp_ctx, primary_address);
NT_STATUS_HAVE_NO_MEMORY(primary_address);
bcast = talloc_strdup(tmp_ctx, bcast);
netmask = talloc_strdup(tmp_ctx, iface_n_netmask(ifaces, i));
- status = nbtd_add_socket(nbtsrv, lp_ctx,
+ status = nbtd_add_socket(nbtsrv, lp_ctx,
address, address, bcast, netmask);
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);
NT_STATUS_NOT_OK_RETURN(status);
}
NTSTATUS status;
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) {
task_server_terminate(task, "nbtd: no network interfaces configured", false);
struct nbtd_server *nbtsrv = iface->nbtsrv;
/* 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;
}
if (!(packet->operation & NBT_FLAG_BROADCAST) &&
(packet->operation & NBT_FLAG_RECURSION_DESIRED) &&
(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);
return;
}
registration packets */
io.in.name = iname->name;
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.nb_flags = iname->nb_flags;
io.in.ttl = iname->ttl;
static void nbtd_start_refresh_timer(struct nbtd_iface_name *iname)
{
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);
uint16_t nb_flags)
{
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 composite_context *creq;
struct nbtd_server *nbtsrv = iface->nbtsrv;
iname->name.scope = NULL;
}
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->wins_server = NULL;
/* setup a broadcast name registration request */
io.in.name = iname->name;
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.nb_flags = nb_flags;
io.in.ttl = iname->ttl;
/* note that we don't initially mark the names "ACTIVE". They are
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, lp_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_CLIENT, nb_flags);
+ nbtd_register_name(nbtsrv, lpcfg_netbios_name(nbtsrv->task->lp_ctx), NBT_NAME_USER, 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]) {
nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_CLIENT, nb_flags);
nbtd_register_name(nbtsrv, aliases[0], NBT_NAME_SERVER, nb_flags);
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);
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);
}
- 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);
}
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;
nbtd_register_name(nbtsrv, "__SAMBA__", NBT_NAME_CLIENT, nb_flags);
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) {
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);
if (!owner) {
owner = "0.0.0.0";
static void nbtd_wins_start_refresh_timer(struct nbtd_iface_name *iname)
{
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);
/* setup a wins name refresh request */
io.in.name = iname->name;
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.nb_flags = iname->nb_flags;
io.in.ttl = iname->ttl;
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
/* none of the WINS servers responded - try again
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,
iname,
timeval_current_ofs(wins_retry_time, 0),
/* setup a wins name register request */
io.in.name = iname->name;
- io.in.wins_port = lp_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_port = lpcfg_nbt_port(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.nb_flags = iname->nb_flags;
io.in.ttl = iname->ttl;
talloc_free(h->ldb);
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;
}
- 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);
if (!h->ldb) goto failed;
h = talloc_zero(mem_ctx, struct winsdb_handle);
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;
}
- 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);
if (!h->ldb) goto failed;
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);
if (!h->local_owner) goto failed;
if (talloc_reference(s, src) == NULL) goto failed;
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.name = rec->name;
s->io.in.num_addresses = winsdb_addr_list_length(rec->addresses);
/* first sort the addresses depending on the matching to the client */
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) {
mask = "255.255.255.0";
}
* Value: 0 = deactivated, 1 = activated
*/
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;
name_1b = *name;
status = winsdb_lookup(winssrv->wins_db, name, packet, &rec);
if (!NT_STATUS_IS_OK(status)) {
- if (!lp_wins_dns_proxy(lp_ctx)) {
+ if (!lpcfg_wins_dns_proxy(lp_ctx)) {
goto notfound;
}
* Value: 0 = deactivated, 1 = activated
*/
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);
}
if (strcmp(rec->wins_owner, winssrv->wins_db->local_owner) != 0) {
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,
* this is off by default to match windows servers
uint32_t tmp;
const char *owner;
- if (!lp_wins_support(nbtsrv->task->lp_ctx)) {
+ if (!lpcfg_wins_support(nbtsrv->task->lp_ctx)) {
nbtsrv->winssrv = NULL;
return NT_STATUS_OK;
}
nbtsrv->winssrv = talloc_zero(nbtsrv, struct wins_server);
NT_STATUS_HAVE_NO_MEMORY(nbtsrv->winssrv);
- nbtsrv->winssrv->config.max_renew_interval = lp_max_wins_ttl(nbtsrv->task->lp_ctx);
- nbtsrv->winssrv->config.min_renew_interval = lp_min_wins_ttl(nbtsrv->task->lp_ctx);
- tmp = lp_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv", "tombstone_interval", 6*24*60*60);
+ nbtsrv->winssrv->config.max_renew_interval = lpcfg_max_wins_ttl(nbtsrv->task->lp_ctx);
+ nbtsrv->winssrv->config.min_renew_interval = lpcfg_min_wins_ttl(nbtsrv->task->lp_ctx);
+ tmp = lpcfg_parm_int(nbtsrv->task->lp_ctx, NULL, "wreplsrv", "tombstone_interval", 6*24*60*60);
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;
- 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) {
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);
}
if (state->current_address < state->io->in.num_addresses) {
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.address = state->release.in.dest_addr;
state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1);
* with 2 retries
*/
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.address = state->release.in.dest_addr;
state->release.in.broadcast = false;
s->req = req;
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.name = &req->in.name;
s->io.in.num_addresses = req->in.num_addrs;
const char *address;
- if (!directory_create_or_exist(lp_ntp_signd_socket_directory(task->lp_ctx), geteuid(), 0755)) {
+ if (!directory_create_or_exist(lpcfg_ntp_signd_socket_directory(task->lp_ctx), geteuid(), 0755)) {
char *error = talloc_asprintf(task, "Cannot create NTP signd pipe directory: %s",
- lp_ntp_signd_socket_directory(task->lp_ctx));
+ lpcfg_ntp_signd_socket_directory(task->lp_ctx));
task_server_terminate(task,
error, true);
return;
return;
}
- address = talloc_asprintf(ntp_signd, "%s/socket", lp_ntp_signd_socket_directory(task->lp_ctx));
+ address = talloc_asprintf(ntp_signd, "%s/socket", lpcfg_ntp_signd_socket_directory(task->lp_ctx));
status = stream_setup_socket(ntp_signd->task->event_ctx,
ntp_signd->task->lp_ctx,
model_ops,
&ntp_signd_stream_ops,
"unix", address, NULL,
- lp_socket_options(ntp_signd->task->lp_ctx),
+ lpcfg_socket_options(ntp_signd->task->lp_ctx),
ntp_signd);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to bind to %s - %s\n",
*/
static struct ldb_context *sptr_db_connect(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx, struct loadparm_context *lp_ctx)
{
- return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lp_spoolss_url(lp_ctx), system_session(lp_ctx),
+ return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lpcfg_spoolss_url(lp_ctx), system_session(lp_ctx),
NULL, 0);
}
union spoolss_PrinterData *r,
enum winreg_Type *type)
{
- struct dcerpc_server_info *server_info = lp_dcerpc_server_info(mem_ctx, server->ntptr->lp_ctx);
+ struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, server->ntptr->lp_ctx);
if (strcmp("W3SvcInstalled", value_name) == 0) {
*type = REG_DWORD;
r->value = 0;
r->binary = blob;
return WERR_OK;
} else if (strcmp("DNSMachineName", value_name) == 0) {
- const char *dnsdomain = lp_dnsdomain(server->ntptr->lp_ctx);
+ const char *dnsdomain = lpcfg_dnsdomain(server->ntptr->lp_ctx);
if (dnsdomain == NULL) return WERR_INVALID_PARAM;
*type = REG_SZ;
r->string = talloc_asprintf(mem_ctx, "%s.%s",
- lp_netbios_name(server->ntptr->lp_ctx),
+ lpcfg_netbios_name(server->ntptr->lp_ctx),
dnsdomain);
W_ERROR_HAVE_NO_MEMORY(r->string);
return WERR_OK;
/* connect to the server, using the smbd event context */
io.in.dest_host = host;
- io.in.dest_ports = lp_smb_ports(ntvfs->ctx->lp_ctx);
- io.in.socket_options = lp_socket_options(ntvfs->ctx->lp_ctx);
+ io.in.dest_ports = lpcfg_smb_ports(ntvfs->ctx->lp_ctx);
+ io.in.socket_options = lpcfg_socket_options(ntvfs->ctx->lp_ctx);
io.in.called_name = host;
io.in.credentials = credentials;
io.in.fallback_to_anonymous = false;
- io.in.workgroup = lp_workgroup(ntvfs->ctx->lp_ctx);
+ io.in.workgroup = lpcfg_workgroup(ntvfs->ctx->lp_ctx);
io.in.service = remote_share;
io.in.service_type = "?????";
- io.in.gensec_settings = lp_gensec_settings(p, ntvfs->ctx->lp_ctx);
- lp_smbcli_options(ntvfs->ctx->lp_ctx, &io.in.options);
- lp_smbcli_session_options(ntvfs->ctx->lp_ctx, &io.in.session_options);
+ io.in.gensec_settings = lpcfg_gensec_settings(p, ntvfs->ctx->lp_ctx);
+ lpcfg_smbcli_options(ntvfs->ctx->lp_ctx, &io.in.options);
+ lpcfg_smbcli_session_options(ntvfs->ctx->lp_ctx, &io.in.session_options);
if (!(ntvfs->ctx->client_caps & NTVFS_CLIENT_CAP_LEVEL_II_OPLOCKS)) {
io.in.options.use_level2_oplocks = false;
}
creq = smb_composite_connect_send(&io, p,
- lp_resolve_context(ntvfs->ctx->lp_ctx),
+ lpcfg_resolve_context(ntvfs->ctx->lp_ctx),
ntvfs->ctx->event_ctx);
status = smb_composite_connect_recv(creq, p);
NT_STATUS_NOT_OK_RETURN(status);
fs->generic.out.serial_number = 1;
fs->generic.out.fs_type = talloc_strdup(req, "NTFS");
fs->generic.out.volume_name = talloc_strdup(req,
- lp_servicename(req->tcon->service));
+ lpcfg_servicename(req->tcon->service));
return NT_STATUS_OK;
}
r->out.available = 0;
r->out.info = NULL;
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return nterr;
}
}
directory = talloc_asprintf(req, "%s/np",
- lp_ncalrpc_dir(ipriv->ntvfs->ctx->lp_ctx));
+ lpcfg_ncalrpc_dir(ipriv->ntvfs->ctx->lp_ctx));
NT_STATUS_HAVE_NO_MEMORY(directory);
state = talloc(req, struct ipc_open_state);
}
/* by default have a max of 512 entries in the cache. */
- ctx->cache_size = lp_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "cachesize", 512);
+ ctx->cache_size = lpcfg_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "cachesize", 512);
ctx->prefix_cache = talloc_array(ctx, char *, ctx->cache_size);
if (ctx->prefix_cache == NULL) {
memset(ctx->prefix_cache, 0, sizeof(char *) * ctx->cache_size);
memset(ctx->prefix_cache_hashes, 0, sizeof(uint32_t) * ctx->cache_size);
- ctx->mangle_prefix = lp_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "prefix", -1);
+ ctx->mangle_prefix = lpcfg_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "prefix", -1);
if (ctx->mangle_prefix < 0 || ctx->mangle_prefix > 6) {
ctx->mangle_prefix = DEFAULT_MANGLE_PREFIX;
}
pvfs->notify_context = notify_init(pvfs,
pvfs->ntvfs->ctx->server_id,
pvfs->ntvfs->ctx->msg_ctx,
- pvfs->ntvfs->ctx->lp_ctx,
+ pvfs->ntvfs->ctx->lp_ctx,
pvfs->ntvfs->ctx->event_ctx,
pvfs->ntvfs->ctx->config);
p = (char *)io->ioctl.out.blob.data;
SSVAL(p,0, 1 /* REWRITE: fsp->rap_print_jobid */);
- push_string(p+2, lp_netbios_name(ntvfs->ctx->lp_ctx), 15, STR_TERMINATE|STR_ASCII);
+ push_string(p+2, lpcfg_netbios_name(ntvfs->ctx->lp_ctx), 15, STR_TERMINATE|STR_ASCII);
push_string(p+18, ntvfs->ctx->config->name, 13, STR_TERMINATE|STR_ASCII);
return NT_STATUS_OK;
}
fs->generic.out.serial_number = 1;
fs->generic.out.fs_type = talloc_strdup(req, "NTFS");
fs->generic.out.volume_name = talloc_strdup(req,
- lp_servicename(req->tcon->service));
+ lpcfg_servicename(req->tcon->service));
return NT_STATUS_OK;
}
return NT_STATUS_INVALID_PARAMETER;
}
- lp_smbcli_options(ntvfs->ctx->lp_ctx, &options);
+ lpcfg_smbcli_options(ntvfs->ctx->lp_ctx, &options);
creq = smb2_connect_send(p, host,
- lp_parm_string_list(p, ntvfs->ctx->lp_ctx, NULL, "smb2", "ports", NULL),
+ lpcfg_parm_string_list(p, ntvfs->ctx->lp_ctx, NULL, "smb2", "ports", NULL),
remote_share,
- lp_resolve_context(ntvfs->ctx->lp_ctx),
+ lpcfg_resolve_context(ntvfs->ctx->lp_ctx),
credentials,
ntvfs->ctx->event_ctx, &options,
- lp_socket_options(ntvfs->ctx->lp_ctx),
- lp_gensec_settings(p, ntvfs->ctx->lp_ctx)
+ lpcfg_socket_options(ntvfs->ctx->lp_ctx),
+ lpcfg_gensec_settings(p, ntvfs->ctx->lp_ctx)
);
status = smb2_connect_recv(creq, p, &tree);
bool isglobal = strcmp(section->name, "global") == 0;
for (param = section->parameters->entries; param; param = param->next) {
if (isglobal)
- lp_do_global_parameter(lp_ctx, param->key,
+ lpcfg_do_global_parameter(lp_ctx, param->key,
param->value);
else {
struct loadparm_service *service =
- lp_service(lp_ctx, section->name);
+ lpcfg_service(lp_ctx, section->name);
if (service == NULL)
- service = lp_add_service(lp_ctx, lp_default_service(lp_ctx), section->name);
- lp_do_service_parameter(lp_ctx, service, param->key, param->value);
+ service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), section->name);
+ lpcfg_do_service_parameter(lp_ctx, service, param->key, param->value);
}
}
}
settings->targetdir));
parameters = PyDict_New();
- configfile = lp_configfile(lp_ctx);
+ configfile = lpcfg_configfile(lp_ctx);
if (configfile != NULL) {
PyDict_SetItemString(parameters, "smbconf",
PyString_FromString(configfile));
result->domaindn = talloc_strdup(mem_ctx, PyString_AsString(PyObject_GetAttrString(py_result, "domaindn")));
/* FIXME paths */
- result->lp_ctx = lp_from_py_object(result, PyObject_GetAttrString(py_result, "lp"));
+ result->lp_ctx = lpcfg_from_py_object(result, PyObject_GetAttrString(py_result, "lp"));
result->samdb = PyLdb_AsLdbContext(PyObject_GetAttrString(py_result, "samdb"));
return NT_STATUS_OK;
parameters = PyDict_New();
- setupdir = lp_setupdir(lp_ctx);
+ setupdir = lpcfg_setupdir(lp_ctx);
PyDict_SetItemString(parameters, "setup_dir",
PyString_FromString(setupdir));
if (override_prefixmap) {
strwicmp(service_name, GLOBAL_NAME2)) {
struct loadparm_service *service;
/* its a share parameter */
- service = lp_service(lp_ctx, service_name);
+ service = lpcfg_service(lp_ctx, service_name);
if (service == NULL) {
return NULL;
}
if (strchr(param_name, ':')) {
/* its a parametric option on a share */
- const char *type = talloc_strndup(lp_ctx, param_name,
+ const char *type = talloc_strndup(lp_ctx, param_name,
strcspn(param_name, ":"));
const char *option = strchr(param_name, ':') + 1;
const char *value;
if (type == NULL || option == NULL) {
return NULL;
}
- value = lp_get_parametric(lp_ctx, service, type, option);
+ value = lpcfg_get_parametric(lp_ctx, service, type, option);
if (value == NULL) {
return NULL;
}
return PyString_FromString(value);
}
- parm = lp_parm_struct(param_name);
+ parm = lpcfg_parm_struct(param_name);
if (parm == NULL || parm->pclass == P_GLOBAL) {
return NULL;
}
- parm_ptr = lp_parm_ptr(lp_ctx, service, parm);
+ parm_ptr = lpcfg_parm_ptr(lp_ctx, service, parm);
} else if (strchr(param_name, ':')) {
/* its a global parametric option */
- const char *type = talloc_strndup(lp_ctx,
+ const char *type = talloc_strndup(lp_ctx,
param_name, strcspn(param_name, ":"));
const char *option = strchr(param_name, ':') + 1;
const char *value;
if (type == NULL || option == NULL) {
return NULL;
}
- value = lp_get_parametric(lp_ctx, NULL, type, option);
+ value = lpcfg_get_parametric(lp_ctx, NULL, type, option);
if (value == NULL)
return NULL;
return PyString_FromString(value);
} else {
/* its a global parameter */
- parm = lp_parm_struct(param_name);
+ parm = lpcfg_parm_struct(param_name);
if (parm == NULL) {
return NULL;
}
- parm_ptr = lp_parm_ptr(lp_ctx, NULL, parm);
+ parm_ptr = lpcfg_parm_ptr(lp_ctx, NULL, parm);
}
if (parm == NULL || parm_ptr == NULL) {
if (!PyArg_ParseTuple(args, "s", &filename))
return NULL;
- ret = lp_load(PyLoadparmContext_AsLoadparmContext(self), filename);
+ ret = lpcfg_load(PyLoadparmContext_AsLoadparmContext(self), filename);
if (!ret) {
PyErr_Format(PyExc_RuntimeError, "Unable to load file %s", filename);
static PyObject *py_lp_ctx_load_default(py_talloc_Object *self)
{
bool ret;
- ret = lp_load_default(PyLoadparmContext_AsLoadparmContext(self));
+ ret = lpcfg_load_default(PyLoadparmContext_AsLoadparmContext(self));
if (!ret) {
PyErr_SetString(PyExc_RuntimeError, "Unable to load default file");
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- return PyBool_FromLong(lp_is_myname(PyLoadparmContext_AsLoadparmContext(self), name));
+ return PyBool_FromLong(lpcfg_is_myname(PyLoadparmContext_AsLoadparmContext(self), name));
}
static PyObject *py_lp_ctx_is_mydomain(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
- return PyBool_FromLong(lp_is_mydomain(PyLoadparmContext_AsLoadparmContext(self), name));
+ return PyBool_FromLong(lpcfg_is_mydomain(PyLoadparmContext_AsLoadparmContext(self), name));
}
static PyObject *py_lp_ctx_set(py_talloc_Object *self, PyObject *args)
if (!PyArg_ParseTuple(args, "ss", &name, &value))
return NULL;
- ret = lp_set_cmdline(PyLoadparmContext_AsLoadparmContext(self), name, value);
+ ret = lpcfg_set_cmdline(PyLoadparmContext_AsLoadparmContext(self), name, value);
if (!ret) {
PyErr_SetString(PyExc_RuntimeError, "Unable to set parameter");
return NULL;
struct loadparm_context *lp_ctx = PyLoadparmContext_AsLoadparmContext(self);
PyObject *ret;
int i;
- ret = PyList_New(lp_numservices(lp_ctx));
- for (i = 0; i < lp_numservices(lp_ctx); i++) {
- struct loadparm_service *service = lp_servicebynum(lp_ctx, i);
+ ret = PyList_New(lpcfg_numservices(lp_ctx));
+ for (i = 0; i < lpcfg_numservices(lp_ctx); i++) {
+ struct loadparm_service *service = lpcfg_servicebynum(lp_ctx, i);
if (service != NULL) {
- PyList_SetItem(ret, i, PyString_FromString(lp_servicename(service)));
+ PyList_SetItem(ret, i, PyString_FromString(lpcfg_servicename(service)));
}
}
return ret;
return NULL;
}
- lp_dump(lp_ctx, f, show_defaults, lp_numservices(lp_ctx));
+ lpcfg_dump(lp_ctx, f, show_defaults, lpcfg_numservices(lp_ctx));
Py_RETURN_NONE;
}
static PyObject *py_lp_ctx_default_service(py_talloc_Object *self, void *closure)
{
- return PyLoadparmService_FromService(lp_default_service(PyLoadparmContext_AsLoadparmContext(self)));
+ return PyLoadparmService_FromService(lpcfg_default_service(PyLoadparmContext_AsLoadparmContext(self)));
}
static PyObject *py_lp_ctx_config_file(py_talloc_Object *self, void *closure)
{
- const char *configfile = lp_configfile(PyLoadparmContext_AsLoadparmContext(self));
+ const char *configfile = lpcfg_configfile(PyLoadparmContext_AsLoadparmContext(self));
if (configfile == NULL)
Py_RETURN_NONE;
else
static Py_ssize_t py_lp_ctx_len(py_talloc_Object *self)
{
- return lp_numservices(PyLoadparmContext_AsLoadparmContext(self));
+ return lpcfg_numservices(PyLoadparmContext_AsLoadparmContext(self));
}
static PyObject *py_lp_ctx_getitem(py_talloc_Object *self, PyObject *name)
PyErr_SetString(PyExc_TypeError, "Only string subscripts are supported");
return NULL;
}
- service = lp_service(PyLoadparmContext_AsLoadparmContext(self), PyString_AsString(name));
+ service = lpcfg_service(PyLoadparmContext_AsLoadparmContext(self), PyString_AsString(name));
if (service == NULL) {
PyErr_SetString(PyExc_KeyError, "No such section");
return NULL;
default_service = PyLoadparmService_AsLoadparmService(py_default_service);
- lp_dump_one(f, show_defaults, service, default_service);
+ lpcfg_dump_one(f, show_defaults, service, default_service);
Py_RETURN_NONE;
}
#include "param/param.h"
-_PUBLIC_ struct loadparm_context *lp_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj);
+_PUBLIC_ struct loadparm_context *lpcfg_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj);
_PUBLIC_ struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx);
#endif /* _PYPARAM_H_ */
#define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_type(obj, struct loadparm_context)
-_PUBLIC_ struct loadparm_context *lp_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj)
+_PUBLIC_ struct loadparm_context *lpcfg_from_py_object(TALLOC_CTX *mem_ctx, PyObject *py_obj)
{
struct loadparm_context *lp_ctx;
if (PyString_Check(py_obj)) {
lp_ctx = loadparm_init(mem_ctx);
- if (!lp_load(lp_ctx, PyString_AsString(py_obj))) {
+ if (!lpcfg_load(lp_ctx, PyString_AsString(py_obj))) {
talloc_free(lp_ctx);
PyErr_Format(PyExc_RuntimeError, "Unable to load %s",
PyString_AsString(py_obj));
if (py_obj == Py_None) {
lp_ctx = loadparm_init(mem_ctx);
/* We're not checking that loading the file succeeded *on purpose */
- lp_load_default(lp_ctx);
+ lpcfg_load_default(lp_ctx);
return lp_ctx;
}
{
struct loadparm_context *ret;
ret = loadparm_init(mem_ctx);
- if (!lp_load_default(ret))
+ if (!lpcfg_load_default(ret))
return NULL;
return ret;
}
struct tevent_context *ev_ctx,
struct loadparm_context *lp_ctx)
{
- return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lp_secrets_url(lp_ctx),
+ return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, lpcfg_secrets_url(lp_ctx),
NULL, NULL, 0);
}
{
struct loadparm_service *s = talloc_get_type(scfg->opaque,
struct loadparm_service);
- struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
+ struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
struct loadparm_context);
char *parm, *val;
const char *ret;
*val = '\0';
val++;
- ret = lp_parm_string(lp_ctx, s, parm, val);
+ ret = lpcfg_parm_string(lp_ctx, s, parm, val);
if (!ret) {
ret = defval;
}
}
if (strcmp(opt_name, SHARE_PATH) == 0) {
- return lp_pathname(s, lp_default_service(lp_ctx));
+ return lpcfg_pathname(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_COMMENT) == 0) {
- return lp_comment(s, lp_default_service(lp_ctx));
+ return lpcfg_comment(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_VOLUME) == 0) {
- return volume_label(s, lp_default_service(lp_ctx));
+ return volume_label(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_TYPE) == 0) {
- if (lp_print_ok(s, lp_default_service(lp_ctx))) {
+ if (lpcfg_print_ok(s, lpcfg_default_service(lp_ctx))) {
return "PRINTER";
}
- if (strcmp("NTFS", lp_fstype(s, lp_default_service(lp_ctx))) == 0) {
+ if (strcmp("NTFS", lpcfg_fstype(s, lpcfg_default_service(lp_ctx))) == 0) {
return "DISK";
}
- return lp_fstype(s, lp_default_service(lp_ctx));
+ return lpcfg_fstype(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_PASSWORD) == 0) {
{
struct loadparm_service *s = talloc_get_type(scfg->opaque,
struct loadparm_service);
- struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
+ struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
struct loadparm_context);
char *parm, *val;
int ret;
*val = '\0';
val++;
- ret = lp_parm_int(lp_ctx, s, parm, val, defval);
+ ret = lpcfg_parm_int(lp_ctx, s, parm, val, defval);
if (!ret) {
ret = defval;
}
}
if (strcmp(opt_name, SHARE_CSC_POLICY) == 0) {
- return lp_csc_policy(s, lp_default_service(lp_ctx));
+ return lpcfg_csc_policy(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MAX_CONNECTIONS) == 0) {
- return lp_max_connections(s, lp_default_service(lp_ctx));
+ return lpcfg_max_connections(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_CREATE_MASK) == 0) {
- return lp_create_mask(s, lp_default_service(lp_ctx));
+ return lpcfg_create_mask(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_DIR_MASK) == 0) {
- return lp_dir_mask(s, lp_default_service(lp_ctx));
+ return lpcfg_dir_mask(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_FORCE_DIR_MODE) == 0) {
- return lp_force_dir_mode(s, lp_default_service(lp_ctx));
+ return lpcfg_force_dir_mode(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_FORCE_CREATE_MODE) == 0) {
- return lp_force_create_mode(s, lp_default_service(lp_ctx));
+ return lpcfg_force_create_mode(s, lpcfg_default_service(lp_ctx));
}
{
struct loadparm_service *s = talloc_get_type(scfg->opaque,
struct loadparm_service);
- struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
+ struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
struct loadparm_context);
char *parm, *val;
bool ret;
*val = '\0';
val++;
- ret = lp_parm_bool(lp_ctx, s, parm, val, defval);
+ ret = lpcfg_parm_bool(lp_ctx, s, parm, val, defval);
talloc_free(parm);
return ret;
}
}
if (strcmp(opt_name, SHARE_BROWSEABLE) == 0) {
- return lp_browseable(s, lp_default_service(lp_ctx));
+ return lpcfg_browseable(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_READONLY) == 0) {
- return lp_readonly(s, lp_default_service(lp_ctx));
+ return lpcfg_readonly(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MAP_SYSTEM) == 0) {
- return lp_map_system(s, lp_default_service(lp_ctx));
+ return lpcfg_map_system(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MAP_HIDDEN) == 0) {
- return lp_map_hidden(s, lp_default_service(lp_ctx));
+ return lpcfg_map_hidden(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MAP_ARCHIVE) == 0) {
- return lp_map_archive(s, lp_default_service(lp_ctx));
+ return lpcfg_map_archive(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_STRICT_LOCKING) == 0) {
- return lp_strict_locking(s, lp_default_service(lp_ctx));
+ return lpcfg_strict_locking(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_OPLOCKS) == 0) {
- return lp_oplocks(s, lp_default_service(lp_ctx));
+ return lpcfg_oplocks(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_STRICT_SYNC) == 0) {
- return lp_strict_sync(s, lp_default_service(lp_ctx));
+ return lpcfg_strict_sync(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_MSDFS_ROOT) == 0) {
- return lp_msdfs_root(s, lp_default_service(lp_ctx));
+ return lpcfg_msdfs_root(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_CI_FILESYSTEM) == 0) {
- return lp_ci_filesystem(s, lp_default_service(lp_ctx));
+ return lpcfg_ci_filesystem(s, lpcfg_default_service(lp_ctx));
}
DEBUG(0,("request for unknown share bool option '%s'\n",
{
struct loadparm_service *s = talloc_get_type(scfg->opaque,
struct loadparm_service);
- struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
+ struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data,
struct loadparm_context);
char *parm, *val;
const char **ret;
*val = '\0';
val++;
- ret = lp_parm_string_list(mem_ctx, lp_ctx, s, parm, val, ",;");
+ ret = lpcfg_parm_string_list(mem_ctx, lp_ctx, s, parm, val, ",;");
talloc_free(parm);
return ret;
}
if (strcmp(opt_name, SHARE_HOSTS_ALLOW) == 0) {
- return lp_hostsallow(s, lp_default_service(lp_ctx));
+ return lpcfg_hostsallow(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_HOSTS_DENY) == 0) {
- return lp_hostsdeny(s, lp_default_service(lp_ctx));
+ return lpcfg_hostsdeny(s, lpcfg_default_service(lp_ctx));
}
if (strcmp(opt_name, SHARE_NTVFS_HANDLER) == 0) {
- return lp_ntvfs_handler(s, lp_default_service(lp_ctx));
+ return lpcfg_ntvfs_handler(s, lpcfg_default_service(lp_ctx));
}
DEBUG(0,("request for unknown share list option '%s'\n",
int num_services;
const char **n;
- num_services = lp_numservices((struct loadparm_context *)ctx->priv_data);
+ num_services = lpcfg_numservices((struct loadparm_context *)ctx->priv_data);
n = talloc_array(mem_ctx, const char *, num_services);
if (!n) {
}
for (i = 0; i < num_services; i++) {
- n[i] = talloc_strdup(n, lp_servicename(lp_servicebynum((struct loadparm_context *)ctx->priv_data, i)));
+ n[i] = talloc_strdup(n, lpcfg_servicename(lpcfg_servicebynum((struct loadparm_context *)ctx->priv_data, i)));
if (!n[i]) {
DEBUG(0,("ERROR: Out of memory!\n"));
talloc_free(n);
struct share_config *s;
struct loadparm_service *service;
- service = lp_service((struct loadparm_context *)ctx->priv_data, name);
+ service = lpcfg_service((struct loadparm_context *)ctx->priv_data, name);
if (service == NULL) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
return NT_STATUS_NO_MEMORY;
}
- s->name = talloc_strdup(s, lp_servicename(service));
+ s->name = talloc_strdup(s, lpcfg_servicename(service));
if (!s->name) {
DEBUG(0,("ERROR: Out of memory!\n"));
talloc_free(s);
return NT_STATUS_NO_MEMORY;
}
- sdb = ldb_wrap_connect(*ctx, ev_ctx, lp_ctx,
+ sdb = ldb_wrap_connect(*ctx, ev_ctx, lp_ctx,
private_path(*ctx, lp_ctx, "share.ldb"),
system_session(lp_ctx),
NULL, 0);
static bool test_set_option(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "workgroup=werkgroep"), "lp_set_option failed");
- torture_assert_str_equal(tctx, "WERKGROEP", lp_workgroup(lp_ctx), "workgroup");
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "workgroup=werkgroep"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, "WERKGROEP", lpcfg_workgroup(lp_ctx), "workgroup");
return true;
}
static bool test_set_cmdline(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_cmdline(lp_ctx, "workgroup", "werkgroep"), "lp_set_cmdline failed");
- torture_assert(tctx, lp_do_global_parameter(lp_ctx, "workgroup", "barbla"), "lp_set_option failed");
- torture_assert_str_equal(tctx, "WERKGROEP", lp_workgroup(lp_ctx), "workgroup");
+ torture_assert(tctx, lpcfg_set_cmdline(lp_ctx, "workgroup", "werkgroep"), "lpcfg_set_cmdline failed");
+ torture_assert(tctx, lpcfg_do_global_parameter(lp_ctx, "workgroup", "barbla"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, "WERKGROEP", lpcfg_workgroup(lp_ctx), "workgroup");
return true;
}
static bool test_do_global_parameter(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_do_global_parameter(lp_ctx, "workgroup", "werkgroep42"),
- "lp_set_cmdline failed");
- torture_assert_str_equal(tctx, lp_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
+ torture_assert(tctx, lpcfg_do_global_parameter(lp_ctx, "workgroup", "werkgroep42"),
+ "lpcfg_set_cmdline failed");
+ torture_assert_str_equal(tctx, lpcfg_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
return true;
}
static bool test_do_global_parameter_var(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_do_global_parameter_var(lp_ctx, "workgroup", "werk%s%d", "groep", 42),
- "lp_set_cmdline failed");
- torture_assert_str_equal(tctx, lp_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
+ torture_assert(tctx, lpcfg_do_global_parameter_var(lp_ctx, "workgroup", "werk%s%d", "groep", 42),
+ "lpcfg_set_cmdline failed");
+ torture_assert_str_equal(tctx, lpcfg_workgroup(lp_ctx), "WERKGROEP42", "workgroup");
return true;
}
static bool test_set_option_invalid(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, !lp_set_option(lp_ctx, "workgroup"), "lp_set_option succeeded");
+ torture_assert(tctx, !lpcfg_set_option(lp_ctx, "workgroup"), "lpcfg_set_option succeeded");
return true;
}
static bool test_set_option_parametric(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=blaat"), "lp_set_option failed");
- torture_assert_str_equal(tctx, lp_parm_string(lp_ctx, NULL, "some", "thing"), "blaat",
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=blaat"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, lpcfg_parm_string(lp_ctx, NULL, "some", "thing"), "blaat",
"invalid parametric option");
return true;
}
static bool test_lp_parm_double(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=3.4"), "lp_set_option failed");
- torture_assert(tctx, lp_parm_double(lp_ctx, NULL, "some", "thing", 2.0) == 3.4,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=3.4"), "lpcfg_set_option failed");
+ torture_assert(tctx, lpcfg_parm_double(lp_ctx, NULL, "some", "thing", 2.0) == 3.4,
"invalid parametric option");
- torture_assert(tctx, lp_parm_double(lp_ctx, NULL, "some", "bla", 2.0) == 2.0,
+ torture_assert(tctx, lpcfg_parm_double(lp_ctx, NULL, "some", "bla", 2.0) == 2.0,
"invalid parametric option");
return true;
}
static bool test_lp_parm_bool(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=true"), "lp_set_option failed");
- torture_assert(tctx, lp_parm_bool(lp_ctx, NULL, "some", "thing", false) == true,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=true"), "lpcfg_set_option failed");
+ torture_assert(tctx, lpcfg_parm_bool(lp_ctx, NULL, "some", "thing", false) == true,
"invalid parametric option");
- torture_assert(tctx, lp_parm_bool(lp_ctx, NULL, "some", "bla", true) == true,
+ torture_assert(tctx, lpcfg_parm_bool(lp_ctx, NULL, "some", "bla", true) == true,
"invalid parametric option");
return true;
}
static bool test_lp_parm_int(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=34"), "lp_set_option failed");
- torture_assert_int_equal(tctx, lp_parm_int(lp_ctx, NULL, "some", "thing", 20), 34,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=34"), "lpcfg_set_option failed");
+ torture_assert_int_equal(tctx, lpcfg_parm_int(lp_ctx, NULL, "some", "thing", 20), 34,
"invalid parametric option");
- torture_assert_int_equal(tctx, lp_parm_int(lp_ctx, NULL, "some", "bla", 42), 42,
+ torture_assert_int_equal(tctx, lpcfg_parm_int(lp_ctx, NULL, "some", "bla", 42), 42,
"invalid parametric option");
return true;
}
static bool test_lp_parm_bytes(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- torture_assert(tctx, lp_set_option(lp_ctx, "some:thing=16K"), "lp_set_option failed");
- torture_assert_int_equal(tctx, lp_parm_bytes(lp_ctx, NULL, "some", "thing", 20), 16 * 1024,
+ torture_assert(tctx, lpcfg_set_option(lp_ctx, "some:thing=16K"), "lpcfg_set_option failed");
+ torture_assert_int_equal(tctx, lpcfg_parm_bytes(lp_ctx, NULL, "some", "thing", 20), 16 * 1024,
"invalid parametric option");
- torture_assert_int_equal(tctx, lp_parm_bytes(lp_ctx, NULL, "some", "bla", 42), 42,
+ torture_assert_int_equal(tctx, lpcfg_parm_bytes(lp_ctx, NULL, "some", "bla", 42), 42,
"invalid parametric option");
return true;
}
static bool test_lp_do_service_parameter(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- struct loadparm_service *service = lp_add_service(lp_ctx, lp_default_service(lp_ctx), "foo");
- torture_assert(tctx, lp_do_service_parameter(lp_ctx, service,
- "some:thing", "foo"), "lp_set_option failed");
- torture_assert_str_equal(tctx, lp_parm_string(lp_ctx, service, "some", "thing"), "foo",
+ struct loadparm_service *service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), "foo");
+ torture_assert(tctx, lpcfg_do_service_parameter(lp_ctx, service,
+ "some:thing", "foo"), "lpcfg_set_option failed");
+ torture_assert_str_equal(tctx, lpcfg_parm_string(lp_ctx, service, "some", "thing"), "foo",
"invalid parametric option");
return true;
}
static bool test_lp_service(struct torture_context *tctx)
{
struct loadparm_context *lp_ctx = loadparm_init(tctx);
- struct loadparm_service *service = lp_add_service(lp_ctx, lp_default_service(lp_ctx), "foo");
- torture_assert(tctx, service == lp_service(lp_ctx, "foo"), "invalid service");
+ struct loadparm_service *service = lpcfg_add_service(lp_ctx, lpcfg_default_service(lp_ctx), "foo");
+ torture_assert(tctx, service == lpcfg_service(lp_ctx, "foo"), "invalid service");
return true;
}
torture_suite_add_simple_test(suite, "set_lp_parm_int", test_lp_parm_int);
torture_suite_add_simple_test(suite, "set_lp_parm_bytes", test_lp_parm_bytes);
torture_suite_add_simple_test(suite, "service_parameter", test_lp_do_service_parameter);
- torture_suite_add_simple_test(suite, "lp_service", test_lp_service);
+ torture_suite_add_simple_test(suite, "lpcfg_service", test_lp_service);
torture_suite_add_simple_test(suite, "do_global_parameter_var", test_do_global_parameter_var);
torture_suite_add_simple_test(suite, "do_global_parameter", test_do_global_parameter);
*/
-bool lp_is_mydomain(struct loadparm_context *lp_ctx,
+bool lpcfg_is_mydomain(struct loadparm_context *lp_ctx,
const char *domain)
{
- return strequal(lp_workgroup(lp_ctx), domain);
+ return strequal(lpcfg_workgroup(lp_ctx), domain);
}
-bool lp_is_my_domain_or_realm(struct loadparm_context *lp_ctx,
+bool lpcfg_is_my_domain_or_realm(struct loadparm_context *lp_ctx,
const char *domain)
{
- return strequal(lp_workgroup(lp_ctx), domain) ||
- strequal(lp_realm(lp_ctx), domain);
+ return strequal(lpcfg_workgroup(lp_ctx), domain) ||
+ strequal(lpcfg_realm(lp_ctx), domain);
}
/**
see if a string matches either our primary or one of our secondary
netbios aliases. do a case insensitive match
*/
-bool lp_is_myname(struct loadparm_context *lp_ctx, const char *name)
+bool lpcfg_is_myname(struct loadparm_context *lp_ctx, const char *name)
{
const char **aliases;
int i;
- if (strcasecmp(name, lp_netbios_name(lp_ctx)) == 0) {
+ if (strcasecmp(name, lpcfg_netbios_name(lp_ctx)) == 0) {
return true;
}
- aliases = lp_netbios_aliases(lp_ctx);
+ aliases = lpcfg_netbios_aliases(lp_ctx);
for (i=0; aliases && aliases[i]; i++) {
if (strcasecmp(name, aliases[i]) == 0) {
return true;
return talloc_strdup(mem_ctx, name);
}
- dname = talloc_strdup(mem_ctx, lp_lockdir(lp_ctx));
+ dname = talloc_strdup(mem_ctx, lpcfg_lockdir(lp_ctx));
trim_string(dname,"","/");
if (!directory_exist(dname)) {
const char *name)
{
char *fname, *config_dir, *p;
- config_dir = talloc_strdup(mem_ctx, lp_configfile(lp_ctx));
+ config_dir = talloc_strdup(mem_ctx, lpcfg_configfile(lp_ctx));
if (config_dir == NULL) {
config_dir = talloc_strdup(mem_ctx, lp_default_path());
}
if (name[0] == 0 || name[0] == '/' || strstr(name, ":/")) {
return talloc_strdup(mem_ctx, name);
}
- fname = talloc_asprintf(mem_ctx, "%s/%s", lp_private_dir(lp_ctx), name);
+ fname = talloc_asprintf(mem_ctx, "%s/%s", lpcfg_private_dir(lp_ctx), name);
return fname;
}
path itself
*/
char *smbd_tmp_path(TALLOC_CTX *mem_ctx,
- struct loadparm_context *lp_ctx,
+ struct loadparm_context *lp_ctx,
const char *name)
{
char *fname, *dname;
{
const char *env_moduledir = getenv("LD_SAMBA_MODULE_PATH");
return talloc_asprintf(mem_ctx, "%s/%s",
- env_moduledir?env_moduledir:lp_modulesdir(lp_ctx),
+ env_moduledir?env_moduledir:lpcfg_modulesdir(lp_ctx),
name);
}
return ret;
}
-const char *lp_messaging_path(TALLOC_CTX *mem_ctx,
+const char *lpcfg_messaging_path(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx)
{
return smbd_tmp_path(mem_ctx, lp_ctx, "messaging");
struct loadparm_context *lp_ctx,
struct smb_iconv_convenience *old_ic)
{
- return smb_iconv_convenience_reinit(mem_ctx, lp_dos_charset(lp_ctx),
- lp_unix_charset(lp_ctx),
- lp_parm_bool(lp_ctx, NULL, "iconv", "native", true),
+ return smb_iconv_convenience_reinit(mem_ctx, lpcfg_dos_charset(lp_ctx),
+ lpcfg_unix_charset(lp_ctx),
+ lpcfg_parm_bool(lp_ctx, NULL, "iconv", "native", true),
old_ic);
}
-const char *lp_sam_name(struct loadparm_context *lp_ctx)
+const char *lpcfg_sam_name(struct loadparm_context *lp_ctx)
{
- switch (lp_server_role(lp_ctx)) {
+ switch (lpcfg_server_role(lp_ctx)) {
case ROLE_DOMAIN_CONTROLLER:
- return lp_workgroup(lp_ctx);
+ return lpcfg_workgroup(lp_ctx);
default:
- return lp_netbios_name(lp_ctx);
+ return lpcfg_netbios_name(lp_ctx);
}
}
{
enum srvsvc_PlatformId id;
- id = lp_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT);
+ id = lpcfg_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT);
return id;
}
/* if there's no string return our NETBIOS name */
if (!p) {
- return talloc_strdup(mem_ctx, lp_netbios_name(dce_ctx->lp_ctx));
+ return talloc_strdup(mem_ctx, lpcfg_netbios_name(dce_ctx->lp_ctx));
}
/* if there're '\\\\' in front remove them otherwise just pass the string */
default_server_announce |= SV_TYPE_SERVER;
default_server_announce |= SV_TYPE_SERVER_UNIX;
- switch (lp_announce_as(dce_ctx->lp_ctx)) {
+ switch (lpcfg_announce_as(dce_ctx->lp_ctx)) {
case ANNOUNCE_AS_NT_SERVER:
default_server_announce |= SV_TYPE_SERVER_NT;
/* fall through... */
break;
}
- switch (lp_server_role(dce_ctx->lp_ctx)) {
+ switch (lpcfg_server_role(dce_ctx->lp_ctx)) {
case ROLE_DOMAIN_MEMBER:
default_server_announce |= SV_TYPE_DOMAIN_MEMBER;
break;
default:
break;
}
- if (lp_time_server(dce_ctx->lp_ctx))
+ if (lpcfg_time_server(dce_ctx->lp_ctx))
default_server_announce |= SV_TYPE_TIME_SOURCE;
- if (lp_host_msdfs(dce_ctx->lp_ctx))
+ if (lpcfg_host_msdfs(dce_ctx->lp_ctx))
default_server_announce |= SV_TYPE_DFS_SERVER;
p->endpoint = ep;
p->contexts = NULL;
p->call_list = NULL;
- p->packet_log_dir = lp_lockdir(dce_ctx->lp_ctx);
+ p->packet_log_dir = lpcfg_lockdir(dce_ctx->lp_ctx);
p->incoming_fragmented_call_list = NULL;
p->pending_call_list = NULL;
p->cli_max_recv_frag = 0;
NTSTATUS status;
/* setup a bind_ack */
- dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
+ dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
pkt.auth_length = 0;
pkt.call_id = call->pkt.call_id;
pkt.ptype = DCERPC_PKT_FAULT;
NTSTATUS status;
/* setup a bind_nak */
- dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
+ dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
pkt.auth_length = 0;
pkt.call_id = call->pkt.call_id;
pkt.ptype = DCERPC_PKT_BIND_NAK;
if provided, check the assoc_group is valid
*/
if (call->pkt.u.bind.assoc_group_id != 0 &&
- lp_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","assoc group checking", true) &&
+ lpcfg_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","assoc group checking", true) &&
dcesrv_assoc_group_find(call->conn->dce_ctx, call->pkt.u.bind.assoc_group_id) == NULL) {
return dcesrv_bind_nak(call, 0);
}
}
if ((call->pkt.pfc_flags & DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN) &&
- lp_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","header signing", false)) {
+ lpcfg_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","header signing", false)) {
call->conn->state_flags |= DCESRV_CALL_STATE_FLAG_HEADER_SIGNING;
extra_flags |= DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN;
}
}
/* setup a bind_ack */
- dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
+ dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
pkt.auth_length = 0;
pkt.call_id = call->pkt.call_id;
pkt.ptype = DCERPC_PKT_BIND_ACK;
if (result == 0 &&
call->pkt.u.alter.assoc_group_id != 0 &&
- lp_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","assoc group checking", true) &&
+ lpcfg_parm_bool(call->conn->dce_ctx->lp_ctx, NULL, "dcesrv","assoc group checking", true) &&
call->pkt.u.alter.assoc_group_id != call->context->assoc_group->id) {
DEBUG(0,(__location__ ": Failed attempt to use new assoc_group in alter context (0x%08x 0x%08x)\n",
call->context->assoc_group->id, call->pkt.u.alter.assoc_group_id));
}
/* setup a alter_resp */
- dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
+ dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
pkt.auth_length = 0;
pkt.call_id = call->pkt.call_id;
pkt.ptype = DCERPC_PKT_ALTER_RESP;
pointers */
push->ptr_count = call->ndr_pull->ptr_count;
- if (lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx)) {
+ if (lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx)) {
push->flags |= LIBNDR_FLAG_BIGENDIAN;
}
length = MIN(chunk_size, stub.length);
/* form the dcerpc response packet */
- dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
+ dcesrv_init_hdr(&pkt, lpcfg_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
pkt.auth_length = 0;
pkt.call_id = call->pkt.call_id;
pkt.ptype = DCERPC_PKT_RESPONSE;
status = samba_server_gensec_start(dce_conn, call->event_ctx,
call->msg_ctx,
- call->conn->dce_ctx->lp_ctx,
+ call->conn->dce_ctx->lp_ctx,
server_credentials,
NULL,
&auth->gensec_security);
ntds_guid_str = GUID_string(res, &ntds_guid);
- dom_string = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
+ dom_string = lpcfg_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
/* get the dNSHostName and cn */
ret = ldb_search(b_state->sam_ctx, mem_ctx, &res2,
* connect to the samdb
*/
b_state->sam_ctx = samdb_connect(b_state, dce_call->event_ctx,
- dce_call->conn->dce_ctx->lp_ctx, auth_info);
+ dce_call->conn->dce_ctx->lp_ctx, auth_info);
if (!b_state->sam_ctx) {
return WERR_FOOBAR;
}
{
enum security_user_level level;
- if (!lp_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL,
+ if (!lpcfg_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL,
"drs", "disable_sec_check", false)) {
level = security_session_user_level(dce_call->conn->auth_state.session_info, NULL);
if (level < SECURITY_ADMINISTRATOR) {
{
enum security_user_level level;
- if (lp_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL,
+ if (lpcfg_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL,
"drs", "disable_sec_check", false)) {
return WERR_OK;
}
enum ldb_scope scope = LDB_SCOPE_SUBTREE;
const char *extra_filter;
- extra_filter = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "object filter");
+ extra_filter = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "object filter");
getnc_state->min_usn = req8->highwatermark.highest_usn;
/* use this to force single objects at a time, which is useful
* for working out what object is giving problems
*/
- max_objects = lp_parm_int(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "max object sync", 1000);
+ max_objects = lpcfg_parm_int(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "max object sync", 1000);
if (req8->max_object_count < max_objects) {
max_objects = req8->max_object_count;
}
/*
* TODO: work out how the maximum should be calculated
*/
- max_links = lp_parm_int(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "max link sync", 1500);
+ max_links = lpcfg_parm_int(dce_call->conn->dce_ctx->lp_ctx, NULL, "drs", "max link sync", 1500);
for(i=getnc_state->num_sent;
i<getnc_state->site_res->count &&
ureq.naming_context = ncRoot;
ureq.dest_dsa_dns_name = talloc_asprintf(mem_ctx, "%s._msdcs.%s",
GUID_string(mem_ctx, &req8->destination_dsa_guid),
- lp_realm(dce_call->conn->dce_ctx->lp_ctx));
+ lpcfg_realm(dce_call->conn->dce_ctx->lp_ctx));
if (!ureq.dest_dsa_dns_name) {
return WERR_NOMEM;
}
ZERO_STRUCT(domain_guid);
- switch (lp_server_role(dce_call->conn->dce_ctx->lp_ctx)) {
+ switch (lpcfg_server_role(dce_call->conn->dce_ctx->lp_ctx)) {
case ROLE_STANDALONE:
role = DS_ROLE_STANDALONE_SERVER;
break;
break;
}
- switch (lp_server_role(dce_call->conn->dce_ctx->lp_ctx)) {
+ switch (lpcfg_server_role(dce_call->conn->dce_ctx->lp_ctx)) {
case ROLE_STANDALONE:
- domain = talloc_strdup(mem_ctx, lp_workgroup(dce_call->conn->dce_ctx->lp_ctx));
+ domain = talloc_strdup(mem_ctx, lpcfg_workgroup(dce_call->conn->dce_ctx->lp_ctx));
W_ERROR_HAVE_NO_MEMORY(domain);
break;
case ROLE_DOMAIN_MEMBER:
- domain = talloc_strdup(mem_ctx, lp_workgroup(dce_call->conn->dce_ctx->lp_ctx));
+ domain = talloc_strdup(mem_ctx, lpcfg_workgroup(dce_call->conn->dce_ctx->lp_ctx));
W_ERROR_HAVE_NO_MEMORY(domain);
/* TODO: what is with dns_domain and forest and guid? */
break;
name = &r->in.name.string[2];
/* We need to connect to the database as system, as this is one of the rare RPC calls that must read the secrets (and this is denied otherwise) */
secret_state->sam_ldb = talloc_reference(secret_state,
- samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, system_session(dce_call->conn->dce_ctx->lp_ctx)));
+ samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, system_session(dce_call->conn->dce_ctx->lp_ctx)));
secret_state->global = true;
if (strlen(name) < 1) {
name = &r->in.name.string[2];
/* We need to connect to the database as system, as this is one of the rare RPC calls that must read the secrets (and this is denied otherwise) */
secret_state->sam_ldb = talloc_reference(secret_state,
- samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, system_session(dce_call->conn->dce_ctx->lp_ctx)));
+ samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, system_session(dce_call->conn->dce_ctx->lp_ctx)));
secret_state->global = true;
if (strlen(name) < 1) {
}
/* make sure the sam database is accessible */
- state->sam_ldb = samdb_connect(state, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info);
+ state->sam_ldb = samdb_connect(state, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info);
if (state->sam_ldb == NULL) {
return NT_STATUS_INVALID_SYSTEM_SERVICE;
}
talloc_free(dom_res);
- state->domain_name = lp_sam_name(dce_call->conn->dce_ctx->lp_ctx);
+ state->domain_name = lpcfg_sam_name(dce_call->conn->dce_ctx->lp_ctx);
state->domain_dns = ldb_dn_canonical_string(state, state->domain_dn);
if (!state->domain_dns) {
r->out.sids->sids[i].sid_index = 0xFFFFFFFF;
r->out.sids->sids[i].flags = 0;
- status2 = dcesrv_lsa_lookup_name(dce_call->event_ctx, lp_ctx, policy_state, mem_ctx, name,
+ status2 = dcesrv_lsa_lookup_name(dce_call->event_ctx, lp_ctx, policy_state, mem_ctx, name,
&authority_name, &sid, &rtype, &rid);
if (!NT_STATUS_IS_OK(status2) || sid->num_auths == 0) {
continue;
r->out.sids->sids[i].sid_index = 0xFFFFFFFF;
r->out.sids->sids[i].unknown = 0;
- status2 = dcesrv_lsa_lookup_name(dce_call->event_ctx, lp_ctx, state, mem_ctx, name,
+ status2 = dcesrv_lsa_lookup_name(dce_call->event_ctx, lp_ctx, state, mem_ctx, name,
&authority_name, &sid, &rtype, &rid);
if (!NT_STATUS_IS_OK(status2)) {
continue;
creds->sid = samdb_result_dom_sid(creds, msgs[0], "objectSid");
nt_status = schannel_save_creds_state(mem_ctx,
- lp_private_dir(dce_call->conn->dce_ctx->lp_ctx),
+ lpcfg_private_dir(dce_call->conn->dce_ctx->lp_ctx),
creds);
return nt_status;
{
NTSTATUS nt_status;
struct dcerpc_auth *auth_info = dce_call->conn->auth_state.auth_info;
- bool schannel_global_required = false; /* Should be lp_schannel_server() == true */
+ bool schannel_global_required = false; /* Should be lpcfg_schannel_server() == true */
if (schannel_global_required) {
nt_status = schannel_check_required(auth_info,
}
nt_status = schannel_check_creds_state(mem_ctx,
- lp_private_dir(dce_call->conn->dce_ctx->lp_ctx),
+ lpcfg_private_dir(dce_call->conn->dce_ctx->lp_ctx),
computer_name,
received_authenticator,
return_authenticator,
sam6->sidcount = sam3->sidcount;
sam6->sids = sam3->sids;
- sam6->dns_domainname.string = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
+ sam6->dns_domainname.string = lpcfg_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
sam6->principle.string = talloc_asprintf(mem_ctx, "%s@%s",
sam->account_name.string, sam6->dns_domainname.string);
NT_STATUS_HAVE_NO_MEMORY(sam6->principle.string);
struct netlogon_creds_CredentialState *creds;
nt_status = schannel_get_creds_state(mem_ctx,
- lp_private_dir(dce_call->conn->dce_ctx->lp_ctx),
+ lpcfg_private_dir(dce_call->conn->dce_ctx->lp_ctx),
r->in.computer_name, &creds);
if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;
* - check all r->in.* parameters (server_unc is ignored by w2k3!)
*/
dcname = talloc_asprintf(mem_ctx, "\\\\%s",
- lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx));
+ lpcfg_netbios_name(dce_call->conn->dce_ctx->lp_ctx));
W_ERROR_HAVE_NO_MEMORY(dcname);
*r->out.dcname = dcname;
if ((r->in.domainname == NULL) || (r->in.domainname[0] == '\0')) {
/* if the domainname parameter wasn't set assume our domain */
- r->in.domainname = lp_workgroup(lp_ctx);
+ r->in.domainname = lpcfg_workgroup(lp_ctx);
}
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
return WERR_DS_UNAVAILABLE;
}
- if (strcasecmp(r->in.domainname, lp_workgroup(lp_ctx)) == 0) {
+ if (strcasecmp(r->in.domainname, lpcfg_workgroup(lp_ctx)) == 0) {
/* well we asked for a DC of our own domain */
if (samdb_is_pdc(sam_ctx)) {
/* we are the PDC of the specified domain */
}
*r->out.dcname = talloc_asprintf(mem_ctx, "\\%s",
- lp_netbios_name(lp_ctx));
+ lpcfg_netbios_name(lp_ctx));
W_ERROR_HAVE_NO_MEMORY(*r->out.dcname);
return WERR_OK;
}
if (is_local) {
- info->domainname.string = lp_workgroup(lp_ctx);
- info->dns_domainname.string = lp_dnsdomain(lp_ctx);
+ info->domainname.string = lpcfg_workgroup(lp_ctx);
+ info->dns_domainname.string = lpcfg_dnsdomain(lp_ctx);
info->domain_guid = samdb_result_guid(res, "objectGUID");
info->domain_sid = samdb_result_dom_sid(mem_ctx, res, "objectSid");
} else {
struct ldb_message **dom_res;
const char * const dom_attrs[] = { "objectSid", "objectGUID", NULL };
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
- const char *dnsdomain = lp_dnsdomain(lp_ctx);
+ const char *dnsdomain = lpcfg_dnsdomain(lp_ctx);
const char *p;
WERROR werr;
trusts->count);
W_ERROR_HAVE_NO_MEMORY(trusts->array);
- trusts->array[n].netbios_name = lp_workgroup(lp_ctx);
- trusts->array[n].dns_name = lp_dnsdomain(lp_ctx);
+ trusts->array[n].netbios_name = lpcfg_workgroup(lp_ctx);
+ trusts->array[n].dns_name = lpcfg_dnsdomain(lp_ctx);
trusts->array[n].trust_flags =
NETR_TRUST_FLAG_NATIVE |
NETR_TRUST_FLAG_TREEROOT |
domain_info = &e->forest_trust_data.domain_info;
domain_info->domain_sid = samdb_result_dom_sid(info, dom_res[0],
"objectSid");
- domain_info->dns_domain_name.string = lp_dnsdomain(lp_ctx);
- domain_info->netbios_domain_name.string = lp_workgroup(lp_ctx);
+ domain_info->dns_domain_name.string = lpcfg_dnsdomain(lp_ctx);
+ domain_info->netbios_domain_name.string = lpcfg_workgroup(lp_ctx);
info->entries[1] = e;
NTSTATUS status;
const struct ndr_interface_table *table;
struct dcesrv_remote_private *priv;
- const char *binding = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "binding");
+ const char *binding = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "binding");
const char *user, *pass, *domain;
struct cli_credentials *credentials;
bool must_free_credentials = true;
struct dcerpc_binding *b;
struct composite_context *pipe_conn_req;
- machine_account = lp_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "use_machine_account", false);
+ machine_account = lpcfg_parm_bool(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "use_machine_account", false);
priv = talloc(dce_call->conn, struct dcesrv_remote_private);
if (!priv) {
return NT_STATUS_INVALID_PARAMETER;
}
- user = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "user");
- pass = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "password");
- domain = lp_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dceprc_remote", "domain");
+ user = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "user");
+ pass = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dcerpc_remote", "password");
+ domain = lpcfg_parm_string(dce_call->conn->dce_ctx->lp_ctx, NULL, "dceprc_remote", "domain");
table = ndr_table_by_uuid(&iface->syntax_id.uuid); /* FIXME: What about if_version ? */
if (!table) {
static NTSTATUS remote_op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
{
unsigned int i;
- const char **ifaces = (const char **)str_list_make(dce_ctx, lp_parm_string(dce_ctx->lp_ctx, NULL, "dcerpc_remote", "interfaces"),NULL);
+ const char **ifaces = (const char **)str_list_make(dce_ctx, lpcfg_parm_string(dce_ctx->lp_ctx, NULL, "dcerpc_remote", "interfaces"),NULL);
if (!ifaces) {
DEBUG(3,("remote_op_init_server: no interfaces configured\n"));
}
/* make sure the sam database is accessible */
- c_state->sam_ctx = samdb_connect(c_state, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info);
+ c_state->sam_ctx = samdb_connect(c_state, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, dce_call->conn->auth_state.session_info);
if (c_state->sam_ctx == NULL) {
talloc_free(c_state);
return NT_STATUS_INVALID_SYSTEM_SERVICE;
ret = gendb_search(c_state->sam_ctx,
mem_ctx, NULL, &dom_msgs, dom_attrs,
"(objectClass=builtinDomain)");
- } else if (strcasecmp_m(r->in.domain_name->string, lp_sam_name(dce_call->conn->dce_ctx->lp_ctx)) == 0) {
+ } else if (strcasecmp_m(r->in.domain_name->string, lpcfg_sam_name(dce_call->conn->dce_ctx->lp_ctx)) == 0) {
ret = gendb_search_dn(c_state->sam_ctx,
mem_ctx, ldb_get_default_basedn(c_state->sam_ctx),
&dom_msgs, dom_attrs);
for (i=0;i<2-start_i;i++) {
array->entries[i].idx = start_i + i;
if (i == 0) {
- array->entries[i].name.string = lp_sam_name(dce_call->conn->dce_ctx->lp_ctx);
+ array->entries[i].name.string = lpcfg_sam_name(dce_call->conn->dce_ctx->lp_ctx);
} else {
array->entries[i].name.string = "BUILTIN";
}
d_state->domain_name = "BUILTIN";
} else {
d_state->builtin = false;
- d_state->domain_name = lp_sam_name(dce_call->conn->dce_ctx->lp_ctx);
+ d_state->domain_name = lpcfg_sam_name(dce_call->conn->dce_ctx->lp_ctx);
}
ret = gendb_search(c_state->sam_ctx,
}
d_state->domain_dn = talloc_steal(d_state, dom_msgs[0]->dn);
- d_state->role = lp_server_role(dce_call->conn->dce_ctx->lp_ctx);
+ d_state->role = lpcfg_server_role(dce_call->conn->dce_ctx->lp_ctx);
d_state->connect_state = talloc_reference(d_state, c_state);
d_state->sam_ctx = c_state->sam_ctx;
d_state->access_mask = r->in.access_mask;
info->primary.string = samdb_result_fsmo_name(state->sam_ctx, mem_ctx, dom_msgs[0], "fSMORoleOwner");
if (!info->primary.string) {
- info->primary.string = lp_netbios_name(state->lp_ctx);
+ info->primary.string = lpcfg_netbios_name(state->lp_ctx);
}
info->force_logoff_time = ldb_msg_find_attr_as_uint64(dom_msgs[0], "forceLogoff",
dom_msgs[0], "fSMORoleOwner");
if (!info->primary.string) {
- info->primary.string = lp_netbios_name(state->lp_ctx);
+ info->primary.string = lpcfg_netbios_name(state->lp_ctx);
}
return NT_STATUS_OK;
}
/* this call can only work with lanman auth */
- if (!lp_lanman_auth(dce_call->conn->dce_ctx->lp_ctx)) {
+ if (!lpcfg_lanman_auth(dce_call->conn->dce_ctx->lp_ctx)) {
return NT_STATUS_WRONG_PASSWORD;
}
return NT_STATUS_WRONG_PASSWORD;
}
- if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
+ if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
CH_DOS, CH_UNIX,
(const char *)new_password.data,
new_password.length,
return NT_STATUS_WRONG_PASSWORD;
}
- if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
+ if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
CH_DOS, CH_UTF16,
(const char *)new_password.data,
new_password.length,
user_dn = res[0]->dn;
- status = samdb_result_passwords(mem_ctx, dce_call->conn->dce_ctx->lp_ctx,
+ status = samdb_result_passwords(mem_ctx, dce_call->conn->dce_ctx->lp_ctx,
res[0], &lm_pwd, &nt_pwd);
if (!NT_STATUS_IS_OK(status) ) {
goto failed;
* this) */
if (lm_pwd && r->in.lm_verifier != NULL) {
char *new_pass;
- if (!convert_string_talloc_convenience(mem_ctx, lp_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
+ if (!convert_string_talloc_convenience(mem_ctx, lpcfg_iconv_convenience(dce_call->conn->dce_ctx->lp_ctx),
CH_UTF16, CH_UNIX,
(const char *)new_password.data,
new_password.length,
status = stream_setup_socket(event_ctx, lp_ctx,
model_ops, &dcesrv_stream_ops,
"unix", e->ep_description->endpoint, &port,
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
dcesrv_sock);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("service_setup_stream_socket(path=%s) failed - %s\n",
e->ep_description->endpoint = talloc_strdup(dce_ctx, "DEFAULT");
}
- full_path = talloc_asprintf(dce_ctx, "%s/%s", lp_ncalrpc_dir(lp_ctx),
+ full_path = talloc_asprintf(dce_ctx, "%s/%s", lpcfg_ncalrpc_dir(lp_ctx),
e->ep_description->endpoint);
dcesrv_sock = talloc(event_ctx, struct dcesrv_socket_context);
status = stream_setup_socket(event_ctx, lp_ctx,
model_ops, &dcesrv_stream_ops,
"unix", full_path, &port,
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
dcesrv_sock);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("service_setup_stream_socket(identifier=%s,path=%s) failed - %s\n",
status = stream_setup_socket(event_ctx, dce_ctx->lp_ctx,
model_ops, &dcesrv_stream_ops,
"ipv4", address, &port,
- lp_socket_options(dce_ctx->lp_ctx),
+ lpcfg_socket_options(dce_ctx->lp_ctx),
dcesrv_sock);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("service_setup_stream_socket(address=%s,port=%u) failed - %s\n",
NTSTATUS status;
/* Add TCP/IP sockets */
- if (lp_interfaces(lp_ctx) && lp_bind_interfaces_only(lp_ctx)) {
+ if (lpcfg_interfaces(lp_ctx) && lpcfg_bind_interfaces_only(lp_ctx)) {
int num_interfaces;
int i;
struct interface *ifaces;
- load_interfaces(dce_ctx, lp_interfaces(lp_ctx), &ifaces);
+ load_interfaces(dce_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
num_interfaces = iface_count(ifaces);
for(i = 0; i < num_interfaces; i++) {
}
} else {
status = add_socket_rpc_tcp_iface(dce_ctx, e, event_ctx, model_ops,
- lp_socket_address(lp_ctx));
+ lpcfg_socket_address(lp_ctx));
NT_STATUS_NOT_OK_RETURN(status);
}
status = dcesrv_init_context(task->event_ctx,
task->lp_ctx,
- lp_dcerpc_endpoint_servers(task->lp_ctx),
+ lpcfg_dcerpc_endpoint_servers(task->lp_ctx),
&dce_ctx);
if (!NT_STATUS_IS_OK(status)) goto failed;
/* Make sure the directory for NCALRPC exists */
- if (!directory_exist(lp_ncalrpc_dir(task->lp_ctx))) {
- mkdir(lp_ncalrpc_dir(task->lp_ctx), 0755);
+ if (!directory_exist(lpcfg_ncalrpc_dir(task->lp_ctx))) {
+ mkdir(lpcfg_ncalrpc_dir(task->lp_ctx), 0755);
}
for (e=dce_ctx->endpoint_list;e;e=e->next) {
server_name += 2;
/* NETBIOS NAME is ok */
- ret = strequal(lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx), server_name);
+ ret = strequal(lpcfg_netbios_name(dce_call->conn->dce_ctx->lp_ctx), server_name);
if (ret) return WERR_OK;
- aliases = lp_netbios_aliases(dce_call->conn->dce_ctx->lp_ctx);
+ aliases = lpcfg_netbios_aliases(dce_call->conn->dce_ctx->lp_ctx);
for (i=0; aliases && aliases[i]; i++) {
if (strequal(aliases[i], server_name)) {
/* DNS NAME is ok
* TODO: we need to check if aliases are also ok
*/
- dnsdomain = lp_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
+ dnsdomain = lpcfg_dnsdomain(dce_call->conn->dce_ctx->lp_ctx);
if (dnsdomain != NULL) {
char *str;
str = talloc_asprintf(mem_ctx, "%s.%s",
- lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx),
+ lpcfg_netbios_name(dce_call->conn->dce_ctx->lp_ctx),
dnsdomain);
W_ERROR_HAVE_NO_MEMORY(str);
struct ntptr_context *ntptr;
status = ntptr_init_context(dce_call->context, dce_call->conn->event_ctx, dce_call->conn->dce_ctx->lp_ctx,
- lp_ntptr_providor(dce_call->conn->dce_ctx->lp_ctx), &ntptr);
+ lpcfg_ntptr_providor(dce_call->conn->dce_ctx->lp_ctx), &ntptr);
NT_STATUS_NOT_OK_RETURN(status);
dce_call->context->private_data = ntptr;
}
ZERO_STRUCT(rop);
- rop.in.server_name = lp_netbios_name(dce_call->conn->dce_ctx->lp_ctx);
+ rop.in.server_name = lpcfg_netbios_name(dce_call->conn->dce_ctx->lp_ctx);
W_ERROR_HAVE_NO_MEMORY(rop.in.server_name);
rop.in.printer_local = 0;
rop.in.type = REG_NONE;
unsigned int count = 8;
unsigned int i;
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
unsigned int count = 10;
unsigned int i;
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
/* TODO: - paging of results
*/
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
return WERR_INVALID_PARAM;
}
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
return WERR_INVALID_PARAM;
}
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
}
all_string_sub(device, "\\", "/", 0);
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
struct srvsvc_NetSrvGetInfo *r)
{
struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx;
- struct dcerpc_server_info *server_info = lp_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx);
+ struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx);
ZERO_STRUCTP(r->out.info);
info101->version_major = server_info->version_major;
info101->version_minor = server_info->version_minor;
info101->server_type = dcesrv_common_get_server_type(mem_ctx, dce_call->event_ctx, dce_ctx);
- info101->comment = talloc_strdup(mem_ctx, lp_serverstring(dce_ctx->lp_ctx));
+ info101->comment = talloc_strdup(mem_ctx, lpcfg_serverstring(dce_ctx->lp_ctx));
W_ERROR_HAVE_NO_MEMORY(info101->comment);
r->out.info->info101 = info101;
info102->version_major = server_info->version_major;
info102->version_minor = server_info->version_minor;
info102->server_type = dcesrv_common_get_server_type(mem_ctx, dce_call->event_ctx, dce_ctx);
- info102->comment = talloc_strdup(mem_ctx, lp_serverstring(dce_ctx->lp_ctx));
+ info102->comment = talloc_strdup(mem_ctx, lpcfg_serverstring(dce_ctx->lp_ctx));
W_ERROR_HAVE_NO_MEMORY(info102->comment);
info102->users = dcesrv_common_get_users(mem_ctx, dce_ctx);
/* TODO: - paging of results
*/
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
NTSTATUS nterr;
struct share_context *sctx;
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
const struct tsocket_address *local_address;
const struct tsocket_address *remote_address;
- status = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
+ status = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
struct wkssvc_NetWkstaGetInfo *r)
{
struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx;
- struct dcerpc_server_info *server_info = lp_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx);
+ struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx);
/* NOTE: win2k3 ignores r->in.server_name completly so we do --metze */
tmp_ctx = talloc_new(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) {
PyErr_SetString(PyExc_TypeError, "Expected loadparm object");
talloc_free(tmp_ctx);
return NULL;
}
- load_interfaces(tmp_ctx, lp_interfaces(lp_ctx), &ifaces);
+ load_interfaces(tmp_ctx, lpcfg_interfaces(lp_ctx), &ifaces);
count = iface_count(ifaces);
****************************************************************************/
static void reply_coreplus(struct smbsrv_request *req, uint16_t choice)
{
- uint16_t raw = (lp_readraw(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0);
+ uint16_t raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?2:0);
smbsrv_setup_reply(req, 13, 0);
****************************************************************************/
static void reply_lanman1(struct smbsrv_request *req, uint16_t choice)
{
- int raw = (lp_readraw(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0);
+ int raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?2:0);
int secword=0;
time_t t = req->request_time.tv_sec;
- req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(req->smb_conn->lp_ctx);
+ req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx);
- if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE)
+ if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE)
secword |= NEGOTIATE_SECURITY_USER_LEVEL;
if (req->smb_conn->negotiate.encrypted_passwords)
SSVAL(req->out.vwv, VWV(0), choice);
SSVAL(req->out.vwv, VWV(1), secword);
SSVAL(req->out.vwv, VWV(2), req->smb_conn->negotiate.max_recv);
- SSVAL(req->out.vwv, VWV(3), lp_maxmux(req->smb_conn->lp_ctx));
+ SSVAL(req->out.vwv, VWV(3), lpcfg_maxmux(req->smb_conn->lp_ctx));
SSVAL(req->out.vwv, VWV(4), 1);
SSVAL(req->out.vwv, VWV(5), raw);
SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id);
****************************************************************************/
static void reply_lanman2(struct smbsrv_request *req, uint16_t choice)
{
- int raw = (lp_readraw(req->smb_conn->lp_ctx)?1:0) | (lp_writeraw(req->smb_conn->lp_ctx)?2:0);
+ int raw = (lpcfg_readraw(req->smb_conn->lp_ctx)?1:0) | (lpcfg_writeraw(req->smb_conn->lp_ctx)?2:0);
int secword=0;
time_t t = req->request_time.tv_sec;
- req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(req->smb_conn->lp_ctx);
+ req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx);
- if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE)
+ if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE)
secword |= NEGOTIATE_SECURITY_USER_LEVEL;
if (req->smb_conn->negotiate.encrypted_passwords)
SSVAL(req->out.vwv, VWV(0), choice);
SSVAL(req->out.vwv, VWV(1), secword);
SSVAL(req->out.vwv, VWV(2), req->smb_conn->negotiate.max_recv);
- SSVAL(req->out.vwv, VWV(3), lp_maxmux(req->smb_conn->lp_ctx));
+ SSVAL(req->out.vwv, VWV(3), lpcfg_maxmux(req->smb_conn->lp_ctx));
SSVAL(req->out.vwv, VWV(4), 1);
SSVAL(req->out.vwv, VWV(5), raw);
SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id);
get_challenge(req->smb_conn, req->out.data);
}
- req_push_str(req, NULL, lp_workgroup(req->smb_conn->lp_ctx), -1, STR_TERMINATE);
+ req_push_str(req, NULL, lpcfg_workgroup(req->smb_conn->lp_ctx), -1, STR_TERMINATE);
if (req->smb_conn->signing.mandatory_signing) {
smbsrv_terminate_connection(req->smb_conn,
req->out.ptr += 8;
SCVAL(req->out.vwv+1, VWV(16), 8);
}
- req_push_str(req, NULL, lp_workgroup(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
- req_push_str(req, NULL, lp_netbios_name(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
+ req_push_str(req, NULL, lpcfg_workgroup(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
+ req_push_str(req, NULL, lpcfg_netbios_name(req->smb_conn->lp_ctx), -1, STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
DEBUG(3,("not using extended security (SPNEGO or NTLMSSP)\n"));
}
CAP_NT_FIND | CAP_LOCK_AND_READ |
CAP_LEVEL_II_OPLOCKS | CAP_NT_SMBS | CAP_RPC_REMOTE_APIS;
- req->smb_conn->negotiate.encrypted_passwords = lp_encrypted_passwords(req->smb_conn->lp_ctx);
+ req->smb_conn->negotiate.encrypted_passwords = lpcfg_encrypted_passwords(req->smb_conn->lp_ctx);
/* do spnego in user level security if the client
supports it and we can do encrypted passwords */
if (req->smb_conn->negotiate.encrypted_passwords &&
- (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) &&
- lp_use_spnego(req->smb_conn->lp_ctx) &&
+ (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) &&
+ lpcfg_use_spnego(req->smb_conn->lp_ctx) &&
(req->flags2 & FLAGS2_EXTENDED_SECURITY)) {
negotiate_spnego = true;
capabilities |= CAP_EXTENDED_SECURITY;
}
- if (lp_unix_extensions(req->smb_conn->lp_ctx)) {
+ if (lpcfg_unix_extensions(req->smb_conn->lp_ctx)) {
capabilities |= CAP_UNIX;
}
- if (lp_large_readwrite(req->smb_conn->lp_ctx)) {
+ if (lpcfg_large_readwrite(req->smb_conn->lp_ctx)) {
capabilities |= CAP_LARGE_READX | CAP_LARGE_WRITEX | CAP_W2K_SMBS;
}
capabilities |= CAP_LARGE_FILES;
}
- if (lp_readraw(req->smb_conn->lp_ctx) &&
- lp_writeraw(req->smb_conn->lp_ctx)) {
+ if (lpcfg_readraw(req->smb_conn->lp_ctx) &&
+ lpcfg_writeraw(req->smb_conn->lp_ctx)) {
capabilities |= CAP_RAW_MODE;
}
/* allow for disabling unicode */
- if (lp_unicode(req->smb_conn->lp_ctx)) {
+ if (lpcfg_unicode(req->smb_conn->lp_ctx)) {
capabilities |= CAP_UNICODE;
}
- if (lp_nt_status_support(req->smb_conn->lp_ctx)) {
+ if (lpcfg_nt_status_support(req->smb_conn->lp_ctx)) {
capabilities |= CAP_STATUS32;
}
- if (lp_host_msdfs(req->smb_conn->lp_ctx)) {
+ if (lpcfg_host_msdfs(req->smb_conn->lp_ctx)) {
capabilities |= CAP_DFS;
}
- if (lp_security(req->smb_conn->lp_ctx) != SEC_SHARE) {
+ if (lpcfg_security(req->smb_conn->lp_ctx) != SEC_SHARE) {
secword |= NEGOTIATE_SECURITY_USER_LEVEL;
}
this is the one and only SMB packet that is malformed in
the specification - all the command words after the secword
are offset by 1 byte */
- SSVAL(req->out.vwv+1, VWV(1), lp_maxmux(req->smb_conn->lp_ctx));
+ SSVAL(req->out.vwv+1, VWV(1), lpcfg_maxmux(req->smb_conn->lp_ctx));
SSVAL(req->out.vwv+1, VWV(2), 1); /* num vcs */
SIVAL(req->out.vwv+1, VWV(3), req->smb_conn->negotiate.max_recv);
SIVAL(req->out.vwv+1, VWV(5), 0x10000); /* raw size. full 64k */
for (protocol = 0; supported_protocols[protocol].proto_name; protocol++) {
int i;
- if (supported_protocols[protocol].protocol_level > lp_srv_maxprotocol(req->smb_conn->lp_ctx))
+ if (supported_protocols[protocol].protocol_level > lpcfg_srv_maxprotocol(req->smb_conn->lp_ctx))
continue;
- if (supported_protocols[protocol].protocol_level < lp_srv_minprotocol(req->smb_conn->lp_ctx))
+ if (supported_protocols[protocol].protocol_level < lpcfg_srv_minprotocol(req->smb_conn->lp_ctx))
continue;
for (i = 0; i < protos_count; i++) {
/* this is the size that w2k uses, and it appears to be important for
good performance */
- smb_conn->negotiate.max_recv = lp_max_xmit(lp_ctx);
+ smb_conn->negotiate.max_recv = lpcfg_max_xmit(lp_ctx);
smb_conn->negotiate.zone_offset = get_time_zone(time(NULL));
- smb_conn->config.security = lp_security(lp_ctx);
- smb_conn->config.nt_status_support = lp_nt_status_support(lp_ctx);
+ smb_conn->config.security = lpcfg_security(lp_ctx);
+ smb_conn->config.nt_status_support = lpcfg_nt_status_support(lp_ctx);
status = smbsrv_init_sessions(smb_conn, UINT16_MAX);
NT_STATUS_NOT_OK_RETURN(status);
con->tconx.out.tid = req->tcon->tid;
con->tconx.out.options = SMB_SUPPORT_SEARCH_BITS | (share_int_option(req->tcon->ntvfs->config, SHARE_CSC_POLICY, SHARE_CSC_POLICY_DEFAULT) << 2);
- if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lp_host_msdfs(req->smb_conn->lp_ctx)) {
+ if (share_bool_option(req->tcon->ntvfs->config, SHARE_MSDFS_ROOT, SHARE_MSDFS_ROOT_DEFAULT) && lpcfg_host_msdfs(req->smb_conn->lp_ctx)) {
con->tconx.out.options |= SMB_SHARE_IN_DFS;
}
(*os) = talloc_asprintf(req, "Unix");
(*lanman) = talloc_asprintf(req, "Samba %s", SAMBA_VERSION_STRING);
(*domain) = talloc_asprintf(req, "%s",
- lp_workgroup(req->smb_conn->lp_ctx));
+ lpcfg_workgroup(req->smb_conn->lp_ctx));
}
static void smbsrv_sesssetup_backend_send(struct smbsrv_request *req,
return false;
}
- switch (lp_server_signing(smb_conn->lp_ctx)) {
+ switch (lpcfg_server_signing(smb_conn->lp_ctx)) {
case SMB_SIGNING_OFF:
smb_conn->signing.allow_smb_signing = false;
break;
* attacks on communications between us and the
* clients */
- if (lp_server_role(smb_conn->lp_ctx) == ROLE_DOMAIN_CONTROLLER) {
+ if (lpcfg_server_role(smb_conn->lp_ctx) == ROLE_DOMAIN_CONTROLLER) {
smb_conn->signing.allow_smb_signing = true;
smb_conn->signing.mandatory_signing = true;
} else {
DATA_BLOB outblob;
enum ndr_err_code ndr_err;
NTSTATUS status;
- const char *dns_domain = lp_dnsdomain(lp_ctx);
- const char *netbios_domain = lp_workgroup(lp_ctx);
+ const char *dns_domain = lpcfg_dnsdomain(lp_ctx);
+ const char *netbios_domain = lpcfg_workgroup(lp_ctx);
struct dfs_referral_resp resp;
struct dfs_referral_type *tab;
struct dfs_referral_type *referral;
uint32_t current_pos = 0;
TALLOC_CTX *context;
- if (lp_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) {
+ if (lpcfg_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) {
DEBUG(10 ,("Received a domain referral request on a non DC\n"));
return NT_STATUS_INVALID_PARAMETER;
}
unsigned int num_domain = 1;
enum ndr_err_code ndr_err;
const char *requesteddomain;
- const char *realm = lp_realm(lp_ctx);
- const char *domain = lp_workgroup(lp_ctx);
+ const char *realm = lpcfg_realm(lp_ctx);
+ const char *domain = lpcfg_workgroup(lp_ctx);
const char *site_name = NULL; /* Name of the site where the client is */
char *share = NULL;
bool found = false;
char *client_addr = NULL;
TALLOC_CTX *context;
- if (lp_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) {
+ if (lpcfg_server_role(lp_ctx) != ROLE_DOMAIN_CONTROLLER) {
return NT_STATUS_INVALID_PARAMETER;
}
NTSTATUS status;
lp_ctx = req->tcon->ntvfs->lp_ctx;
- if (!lp_host_msdfs(lp_ctx)) {
+ if (!lpcfg_host_msdfs(lp_ctx)) {
return NT_STATUS_NOT_IMPLEMENTED;
}
return dodomain_referral(op, &dfsreq, ldb, trans, lp_ctx);
}
- realm = lp_realm(lp_ctx);
- nbname = lp_netbios_name(lp_ctx);
+ realm = lpcfg_realm(lp_ctx);
+ nbname = lpcfg_netbios_name(lp_ctx);
fqdn = talloc_asprintf(context, "%s.%s", nbname, realm);
if ((strncasecmp(requestedname+1, nbname, strlen(nbname)) == 0) ||
boot_time = timeval_current(); /* TODO: fix me */
ZERO_STRUCT(io->out);
- switch (lp_server_signing(req->smb_conn->lp_ctx)) {
+ switch (lpcfg_server_signing(req->smb_conn->lp_ctx)) {
case SMB_SIGNING_OFF:
io->out.security_mode = 0;
break;
}
io->out.dialect_revision = dialect;
io->out.capabilities = 0;
- io->out.max_transact_size = lp_parm_ulong(req->smb_conn->lp_ctx, NULL,
+ io->out.max_transact_size = lpcfg_parm_ulong(req->smb_conn->lp_ctx, NULL,
"smb2", "max transaction size", 0x10000);
- io->out.max_read_size = lp_parm_ulong(req->smb_conn->lp_ctx, NULL,
+ io->out.max_read_size = lpcfg_parm_ulong(req->smb_conn->lp_ctx, NULL,
"smb2", "max read size", 0x10000);
- io->out.max_write_size = lp_parm_ulong(req->smb_conn->lp_ctx, NULL,
+ io->out.max_write_size = lpcfg_parm_ulong(req->smb_conn->lp_ctx, NULL,
"smb2", "max write size", 0x10000);
io->out.system_time = timeval_to_nttime(¤t_time);
io->out.server_start_time = timeval_to_nttime(&boot_time);
/* this is the size that w2k uses, and it appears to be important for
good performance */
- smb_conn->negotiate.max_recv = lp_max_xmit(smb_conn->lp_ctx);
+ smb_conn->negotiate.max_recv = lpcfg_max_xmit(smb_conn->lp_ctx);
smb_conn->negotiate.zone_offset = get_time_zone(time(NULL));
close(i);
}
- prog = lp_parm_string(conn->lp_ctx, NULL, "samba3", "smbd");
+ prog = lpcfg_parm_string(conn->lp_ctx, NULL, "samba3", "smbd");
if (prog == NULL) {
argv[0] = talloc_asprintf(conn, "%s/%s", dyn_BINDIR, "smbd3");
const struct model_ops *model_ops,
const char *address)
{
- const char **ports = lp_smb_ports(lp_ctx);
+ const char **ports = lpcfg_smb_ports(lp_ctx);
int i;
NTSTATUS status;
status = stream_setup_socket(event_context, lp_ctx,
model_ops, &samba3_smb_stream_ops,
"ip", address, &port,
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
NULL);
NT_STATUS_NOT_OK_RETURN(status);
}
task_server_set_title(task, "task[samba3_smb]");
- 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)) {
int num_interfaces;
int i;
struct interface *ifaces;
- load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
+ load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
num_interfaces = iface_count(ifaces);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
} else {
- /* Just bind to lp_socket_address() (usually 0.0.0.0) */
+ /* Just bind to lpcfg_socket_address() (usually 0.0.0.0) */
status = samba3_add_socket(task->event_ctx, task->lp_ctx,
model_ops,
- lp_socket_address(task->lp_ctx));
+ lpcfg_socket_address(task->lp_ctx));
if (!NT_STATUS_IS_OK(status)) goto failed;
}
packet_set_callback(smb_conn->packet, smbsrv_recv_smb_request);
return smbsrv_recv_smb_request(smb_conn, blob);
case SMB2_MAGIC:
- if (lp_srv_maxprotocol(smb_conn->lp_ctx) < PROTOCOL_SMB2) break;
+ if (lpcfg_srv_maxprotocol(smb_conn->lp_ctx) < PROTOCOL_SMB2) break;
status = smbsrv_init_smb2_connection(smb_conn);
NT_STATUS_NOT_OK_RETURN(status);
packet_set_callback(smb_conn->packet, smbsrv_recv_smb2_request);
irpc_add_name(conn->msg_ctx, "smb_server");
- if (!NT_STATUS_IS_OK(share_get_context_by_name(smb_conn, lp_share_backend(smb_conn->lp_ctx),
+ if (!NT_STATUS_IS_OK(share_get_context_by_name(smb_conn, lpcfg_share_backend(smb_conn->lp_ctx),
smb_conn->connection->event.ctx,
smb_conn->lp_ctx, &(smb_conn->share_context)))) {
smbsrv_terminate_connection(smb_conn, "share_init failed!");
const struct model_ops *model_ops,
const char *address)
{
- const char **ports = lp_smb_ports(lp_ctx);
+ const char **ports = lpcfg_smb_ports(lp_ctx);
int i;
NTSTATUS status;
for (i=0;ports[i];i++) {
uint16_t port = atoi(ports[i]);
if (port == 0) continue;
- status = stream_setup_socket(event_context, lp_ctx,
+ status = stream_setup_socket(event_context, lp_ctx,
model_ops, &smb_stream_ops,
"ipv4", address, &port,
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
NULL);
NT_STATUS_NOT_OK_RETURN(status);
}
task_server_set_title(task, "task[smbsrv]");
- 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)) {
int num_interfaces;
int i;
struct interface *ifaces;
- load_interfaces(task, lp_interfaces(task->lp_ctx), &ifaces);
+ load_interfaces(task, lpcfg_interfaces(task->lp_ctx), &ifaces);
num_interfaces = iface_count(ifaces);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
} else {
- /* Just bind to lp_socket_address() (usually 0.0.0.0) */
- status = smbsrv_add_socket(task->event_ctx, task->lp_ctx, task->model_ops,
- lp_socket_address(task->lp_ctx));
+ /* Just bind to lpcfg_socket_address() (usually 0.0.0.0) */
+ status = smbsrv_add_socket(task->event_ctx, task->lp_ctx, task->model_ops,
+ lpcfg_socket_address(task->lp_ctx));
if (!NT_STATUS_IS_OK(status)) goto failed;
}
/* function to create a task */
void (*new_task)(struct tevent_context *,
- struct loadparm_context *lp_ctx,
+ struct loadparm_context *lp_ctx,
const char *service_name,
void (*)(struct tevent_context *,
struct loadparm_context *, struct server_id,
void *);
/* function to terminate a connection or task */
- void (*terminate)(struct tevent_context *, struct loadparm_context *lp_ctx,
+ void (*terminate)(struct tevent_context *, struct loadparm_context *lp_ctx,
const char *reason);
/* function to set a title for the connection or task */
static void prefork_new_task(struct tevent_context *ev,
struct loadparm_context *lp_ctx,
const char *service_name,
- void (*new_task_fn)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *),
+ void (*new_task_fn)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *),
void *private_data)
{
pid_t pid;
/* setup this new connection: process will bind to it's sockets etc */
new_task_fn(ev2, lp_ctx, cluster_id(pid, 0), private_data);
- num_children = lp_parm_int(lp_ctx, NULL, "prefork children", service_name, 0);
+ num_children = lpcfg_parm_int(lp_ctx, NULL, "prefork children", service_name, 0);
if (num_children == 0) {
/* We don't want any kids hanging around for this one,
/* The cluster_id(0, fd) cannot collide with the incrementing
* task below, as the first component is 0, not 1 */
- new_conn(ev, lp_ctx, connected_socket,
+ new_conn(ev, lp_ctx, connected_socket,
cluster_id(0, socket_get_fd(connected_socket)), private_data);
}
called to startup a new task
*/
static void single_new_task(struct tevent_context *ev,
- struct loadparm_context *lp_ctx,
+ struct loadparm_context *lp_ctx,
const char *service_name,
void (*new_task)(struct tevent_context *, struct loadparm_context *, struct server_id, void *),
void *private_data)
/* called when a task goes down */
-static void single_terminate(struct tevent_context *ev, struct loadparm_context *lp_ctx, const char *reason)
+static void single_terminate(struct tevent_context *ev, struct loadparm_context *lp_ctx, const char *reason)
{
DEBUG(3,("single_terminate: reason[%s]\n",reason));
}
static void standard_new_task(struct tevent_context *ev,
struct loadparm_context *lp_ctx,
const char *service_name,
- void (*new_task)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *),
+ void (*new_task)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *),
void *private_data)
{
pid_t pid;
/* called when a task goes down */
-_NORETURN_ static void standard_terminate(struct tevent_context *ev, struct loadparm_context *lp_ctx,
+_NORETURN_ static void standard_terminate(struct tevent_context *ev, struct loadparm_context *lp_ctx,
const char *reason)
{
DEBUG(2,("standard_terminate: reason[%s]\n",reason));
called when a listening socket becomes readable
*/
static void thread_accept_connection(struct tevent_context *ev,
- struct loadparm_context *lp_ctx,
+ struct loadparm_context *lp_ctx,
struct socket_context *sock,
void (*new_conn)(struct tevent_context *,
struct loadparm_context *,
{
struct new_task_state *new_task = talloc_get_type(thread_parm, struct new_task_state);
- new_task->new_task(new_task->ev, new_task->lp_ctx, pthread_self(),
+ new_task->new_task(new_task->ev, new_task->lp_ctx, pthread_self(),
new_task->private_data);
/* run this connection from here */
}
/* called when a task goes down */
-static void thread_terminate(struct tevent_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason)
+static void thread_terminate(struct tevent_context *event_ctx, struct loadparm_context *lp_ctx, const char *reason)
{
DEBUG(10,("thread_terminate: reason[%s]\n",reason));
NTSTATUS status;
msg = messaging_init(talloc_autofree_context(),
- lp_messaging_path(event_ctx, lp_ctx),
+ lpcfg_messaging_path(event_ctx, lp_ctx),
cluster_id(0, SAMBA_PARENT_TASKID), event_ctx);
NT_STATUS_HAVE_NO_MEMORY(msg);
cleanup_tmp_files(cmdline_lp_ctx);
- if (!directory_exist(lp_lockdir(cmdline_lp_ctx))) {
- mkdir(lp_lockdir(cmdline_lp_ctx), 0755);
+ if (!directory_exist(lpcfg_lockdir(cmdline_lp_ctx))) {
+ mkdir(lpcfg_lockdir(cmdline_lp_ctx), 0755);
}
- pidfile_create(lp_piddir(cmdline_lp_ctx), binary_name);
+ pidfile_create(lpcfg_piddir(cmdline_lp_ctx), binary_name);
/* Do *not* remove this, until you have removed
* passdb/secrets.c, and proved that Samba still builds... */
return 1;
}
- if (lp_server_role(cmdline_lp_ctx) == ROLE_DOMAIN_CONTROLLER) {
- if (!open_schannel_session_store(talloc_autofree_context(), lp_private_dir(cmdline_lp_ctx))) {
+ if (lpcfg_server_role(cmdline_lp_ctx) == ROLE_DOMAIN_CONTROLLER) {
+ if (!open_schannel_session_store(talloc_autofree_context(), lpcfg_private_dir(cmdline_lp_ctx))) {
DEBUG(0,("ERROR: Samba cannot open schannel store for secured NETLOGON operations.\n"));
exit(1);
}
DEBUG(0,("%s: using '%s' process model\n", binary_name, model));
status = server_service_startup(event_ctx, cmdline_lp_ctx, model,
- lp_server_services(cmdline_lp_ctx));
+ lpcfg_server_services(cmdline_lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
return 1;
goto fail;
}
- dirname = talloc_asprintf(pipe_sock, "%s/np", lp_ncalrpc_dir(lp_ctx));
+ dirname = talloc_asprintf(pipe_sock, "%s/np", lpcfg_ncalrpc_dir(lp_ctx));
if (dirname == NULL) {
goto fail;
}
srv_conn->event.ctx = ev;
srv_conn->lp_ctx = lp_ctx;
- if (!socket_check_access(sock, "smbd", lp_hostsallow(NULL, lp_default_service(lp_ctx)), lp_hostsdeny(NULL, lp_default_service(lp_ctx)))) {
+ if (!socket_check_access(sock, "smbd", lpcfg_hostsallow(NULL, lpcfg_default_service(lp_ctx)), lpcfg_hostsdeny(NULL, lpcfg_default_service(lp_ctx)))) {
stream_terminate_connection(srv_conn, "denied by access rules");
return;
}
/* setup to receive internal messages on this connection */
srv_conn->msg_ctx = messaging_init(srv_conn,
- lp_messaging_path(srv_conn, lp_ctx),
+ lpcfg_messaging_path(srv_conn, lp_ctx),
srv_conn->server_id, ev);
if (!srv_conn->msg_ctx) {
stream_terminate_connection(srv_conn, "messaging_init() failed");
/* ask the process model to create us a process for this new
connection. When done, it calls stream_new_connection()
with the newly created socket */
- stream_socket->model_ops->accept_connection(ev, stream_socket->lp_ctx,
+ stream_socket->model_ops->accept_connection(ev, stream_socket->lp_ctx,
stream_socket->sock,
stream_new_connection, stream_socket);
}
task->lp_ctx = lp_ctx;
task->msg_ctx = messaging_init(task,
- lp_messaging_path(task, task->lp_ctx),
+ lpcfg_messaging_path(task, task->lp_ctx),
task->server_id,
task->event_ctx);
if (!task->msg_ctx) {
torture_assert_ntstatus_ok(tctx,
gensec_client_start(mem_ctx, &gensec_security,
- tctx->ev, lp_gensec_settings(tctx, tctx->lp_ctx)),
+ tctx->ev, lpcfg_gensec_settings(tctx, tctx->lp_ctx)),
"gensec client start");
gensec_set_credentials(gensec_security, cmdline_credentials);
torture_assert_ntstatus_ok(tctx,
gensec_client_start(mem_ctx, &gensec_security,
- tctx->ev, lp_gensec_settings(tctx, tctx->lp_ctx)),
+ tctx->ev, lpcfg_gensec_settings(tctx, tctx->lp_ctx)),
"Failed to start GENSEC for NTLMSSP");
gensec_set_credentials(gensec_security, cmdline_credentials);
}
/* We need an input, and this one requires no underlying database */
- nt_status = auth_anonymous_server_info(mem_ctx, lp_netbios_name(tctx->lp_ctx), &server_info);
+ nt_status = auth_anonymous_server_info(mem_ctx, lpcfg_netbios_name(tctx->lp_ctx), &server_info);
if (!NT_STATUS_IS_OK(nt_status)) {
krb5_free_keyblock_contents(smb_krb5_context->krb5_context,
const char *host = torture_setting_string(tctx, "host", NULL);
struct smbcli_options options;
- make_nbt_name_client(&calling, lp_netbios_name(tctx->lp_ctx));
+ make_nbt_name_client(&calling, lpcfg_netbios_name(tctx->lp_ctx));
nbt_choose_called_name(NULL, &called, host, NBT_NAME_SERVER);
goto failed;
}
- lp_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
- if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), tctx->ev,
- lp_resolve_context(tctx->lp_ctx), &options,
- lp_socket_options(tctx->lp_ctx))) {
+ if (!smbcli_socket_connect(cli, host, lpcfg_smb_ports(tctx->lp_ctx), tctx->ev,
+ lpcfg_resolve_context(tctx->lp_ctx), &options,
+ lpcfg_socket_options(tctx->lp_ctx))) {
torture_comment(tctx, "Failed to connect with %s\n", host);
goto failed;
}
for (i=0;i<100;i++) {
struct smbcli_request *req;
- req = smb_raw_negotiate_send(cli->transport, lp_unicode(tctx->lp_ctx), PROTOCOL_NT1);
+ req = smb_raw_negotiate_send(cli->transport, lpcfg_unicode(tctx->lp_ctx), PROTOCOL_NT1);
event_loop_once(cli->transport->socket->event.ctx);
if (req->state == SMBCLI_REQUEST_ERROR) {
if (i > 0) {
union smb_open io;
NTSTATUS status;
- nt_status_support = lp_nt_status_support(tctx->lp_ctx);
+ nt_status_support = lpcfg_nt_status_support(tctx->lp_ctx);
- if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) {
+ if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) {
torture_comment(tctx, "Could not set 'nt status support = yes'\n");
goto fail;
}
goto fail;
}
- if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", "no")) {
+ if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", "no")) {
torture_comment(tctx, "Could not set 'nt status support = yes'\n");
goto fail;
}
goto fail;
}
- if (!lp_set_cmdline(tctx->lp_ctx, "nt status support",
+ if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support",
nt_status_support ? "yes":"no")) {
torture_comment(tctx, "Could not reset 'nt status support = yes'");
goto fail;
}
SSVAL(ucs_name, i*2, 0);
- if (!convert_string_talloc_convenience(ucs_name, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) {
+ if (!convert_string_talloc_convenience(ucs_name, lpcfg_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) {
torture_comment(tctx, "Failed to convert UCS2 Name into unix - convert_string_talloc() failure\n");
talloc_free(ucs_name);
return NT_STATUS_NO_MEMORY;
unsigned int blocksize;
unsigned int writeratio;
int num_parallel_requests;
- } *lp_params;
+ } *lpcfg_params;
};
/*
- init params using lp_parm_xxx
+ init params using lpcfg_parm_xxx
return number of unclist entries
*/
static int init_benchrw_params(struct torture_context *tctx,
lpar->writeratio = torture_setting_int(tctx, "writeratio",5);
lpar->num_parallel_requests = torture_setting_int(
tctx, "parallel_requests", 5);
- lpar->workgroup = lp_workgroup(tctx->lp_ctx);
+ lpar->workgroup = lpcfg_workgroup(tctx->lp_ctx);
p = torture_setting_string(tctx, "unclist", NULL);
if (p) {
union smb_write wr;
/* randomize between writes and reads*/
- if (random() % state->lp_params->writeratio == 0) {
+ if (random() % state->lpcfg_params->writeratio == 0) {
torture_comment(tctx, "Callback WRITE file:%d (%d/%d)\n",
state->nr,state->completed,torture_numops);
wr.generic.level = RAW_WRITE_WRITEX ;
wr.writex.in.offset = 0;
wr.writex.in.wmode = 0 ;
wr.writex.in.remaining = 0;
- wr.writex.in.count = state->lp_params->blocksize;
+ wr.writex.in.count = state->lpcfg_params->blocksize;
wr.writex.in.data = state->buffer;
state->readcnt=0;
req = smb_raw_write_send(state->cli,&wr);
torture_comment(tctx,
"Callback READ file:%d (%d/%d) Offset:%d\n",
state->nr,state->completed,torture_numops,
- (state->readcnt*state->lp_params->blocksize));
+ (state->readcnt*state->lpcfg_params->blocksize));
rd.generic.level = RAW_READ_READX;
rd.readx.in.file.fnum = state->fnum ;
- rd.readx.in.offset = state->readcnt*state->lp_params->blocksize;
- rd.readx.in.mincnt = state->lp_params->blocksize;
+ rd.readx.in.offset = state->readcnt*state->lpcfg_params->blocksize;
+ rd.readx.in.mincnt = state->lpcfg_params->blocksize;
rd.readx.in.maxcnt = rd.readx.in.mincnt;
rd.readx.in.remaining = 0 ;
rd.readx.out.data = state->buffer;
rd.readx.in.read_for_execute = false;
- if(state->readcnt < state->lp_params->writeblocks){
+ if(state->readcnt < state->lpcfg_params->writeblocks){
state->readcnt++;
}else{
/*start reading from beginn of file*/
}
torture_comment(tctx, "Write initial test file:%d (%d/%d)\n",state->nr,
- (state->writecnt+1)*state->lp_params->blocksize,
- (state->lp_params->writeblocks*state->lp_params->blocksize));
+ (state->writecnt+1)*state->lpcfg_params->blocksize,
+ (state->lpcfg_params->writeblocks*state->lpcfg_params->blocksize));
wr.generic.level = RAW_WRITE_WRITEX ;
wr.writex.in.file.fnum = state->fnum ;
wr.writex.in.offset = state->writecnt *
- state->lp_params->blocksize;
+ state->lpcfg_params->blocksize;
wr.writex.in.wmode = 0 ;
- wr.writex.in.remaining = (state->lp_params->writeblocks *
- state->lp_params->blocksize)-
+ wr.writex.in.remaining = (state->lpcfg_params->writeblocks *
+ state->lpcfg_params->blocksize)-
((state->writecnt+1)*state->
- lp_params->blocksize);
- wr.writex.in.count = state->lp_params->blocksize;
+ lpcfg_params->blocksize);
+ wr.writex.in.count = state->lpcfg_params->blocksize;
wr.writex.in.data = state->buffer;
state->writecnt++;
- if(state->writecnt == state->lp_params->writeblocks){
+ if(state->writecnt == state->lpcfg_params->writeblocks){
state->mode=READ_WRITE_DATA;
}
req = smb_raw_write_send(state->cli,&wr);
open_parms->openx.in.timeout = 0;
open_parms->openx.in.fname = state->fname;
- writedata = talloc_size(tctx,state->lp_params->blocksize);
+ writedata = talloc_size(tctx,state->lpcfg_params->blocksize);
NT_STATUS_HAVE_NO_MEMORY(writedata);
- generate_random_buffer(writedata,state->lp_params->blocksize);
+ generate_random_buffer(writedata,state->lpcfg_params->blocksize);
state->buffer=writedata;
state->writecnt=1;
state->readcnt=0;
break;
case READ_WRITE_DATA:
while (state->num_parallel_requests
- < state->lp_params->num_parallel_requests) {
+ < state->lpcfg_params->num_parallel_requests) {
NTSTATUS status;
status = benchrw_readwrite(tctx,state);
if (!NT_STATUS_IS_OK(status)){
{
struct benchrw_state *state = con->async.private_data;
struct torture_context *tctx = state->tctx;
- int retry = state->lp_params->retry;
+ int retry = state->lpcfg_params->retry;
if (NT_STATUS_IS_OK(con->status)) {
state->cli=((struct smb_composite_connect*)
torture_comment(tctx, "Open Connection to %s/%s\n",host,share);
smb->in.dest_host=talloc_strdup(mem_ctx,host);
smb->in.service=talloc_strdup(mem_ctx,share);
- smb->in.dest_ports=lp_smb_ports(tctx->lp_ctx);
- smb->in.socket_options = lp_socket_options(tctx->lp_ctx);
+ smb->in.dest_ports=lpcfg_smb_ports(tctx->lp_ctx);
+ smb->in.socket_options = lpcfg_socket_options(tctx->lp_ctx);
smb->in.called_name = strupper_talloc(mem_ctx, host);
smb->in.service_type=NULL;
smb->in.credentials=cmdline_credentials;
smb->in.fallback_to_anonymous=false;
- smb->in.gensec_settings = lp_gensec_settings(mem_ctx, tctx->lp_ctx);
+ smb->in.gensec_settings = lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx);
smb->in.workgroup=workgroup;
- lp_smbcli_options(tctx->lp_ctx, &smb->in.options);
- lp_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &smb->in.options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options);
return smb_composite_connect_send(smb,mem_ctx,
- lp_resolve_context(tctx->lp_ctx),ev);
+ lpcfg_resolve_context(tctx->lp_ctx),ev);
}
bool run_benchrw(struct torture_context *tctx)
ev = tctx->ev;
state = talloc_array(tctx, struct benchrw_state *, torture_nprocs);
- /* init params using lp_parm_xxx */
+ /* init params using lpcfg_parm_xxx */
num_unc_names = init_benchrw_params(tctx,&lpparams);
/* init private data structs*/
state[i]->tctx = tctx;
state[i]->completed=0;
state[i]->num_parallel_requests=0;
- state[i]->lp_params=&lpparams;
+ state[i]->lpcfg_params=&lpparams;
state[i]->nr=i;
state[i]->dname=talloc_asprintf(tctx,"benchrw%d",i);
state[i]->fname=talloc_asprintf(tctx,"%s%s",
struct smbcli_session *session;
struct smbcli_session_options options;
- lp_smbcli_session_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
session = smbcli_session_init(cli->transport, cli, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setup.in.credentials = cli_credentials_init(session);
- setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
+ setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
cli_credentials_set_conf(setup.in.credentials, tctx->lp_ctx);
cli_credentials_set_domain(setup.in.credentials, "INVALID-DOMAIN", CRED_SPECIFIED);
NTSTATUS status;
struct smbcli_options smb_options;
struct smbcli_session_options smb_session_options;
- lp_smbcli_options(lp_ctx, &smb_options);
- lp_smbcli_session_options(lp_ctx, &smb_session_options);
+ lpcfg_smbcli_options(lp_ctx, &smb_options);
+ lpcfg_smbcli_session_options(lp_ctx, &smb_session_options);
printf("Connecting to \\\\%s\\%s as %s - instance %d\n",
servers[i].server_name, servers[i].share_name,
if (options.smb2) {
status = smb2_connect(NULL, servers[i].server_name,
- lp_smb_ports(lp_ctx),
+ lpcfg_smb_ports(lp_ctx),
servers[i].share_name,
- lp_resolve_context(lp_ctx),
+ lpcfg_resolve_context(lp_ctx),
servers[i].credentials,
&servers[i].smb2_tree[j],
ev, &smb_options,
- lp_socket_options(lp_ctx),
- lp_gensec_settings(lp_ctx, lp_ctx)
+ lpcfg_socket_options(lp_ctx),
+ lpcfg_gensec_settings(lp_ctx, lp_ctx)
);
} else {
status = smbcli_tree_full_connection(NULL,
&servers[i].smb_tree[j],
servers[i].server_name,
- lp_smb_ports(lp_ctx),
+ lpcfg_smb_ports(lp_ctx),
servers[i].share_name, "A:",
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
servers[i].credentials,
- lp_resolve_context(lp_ctx), ev,
+ lpcfg_resolve_context(lp_ctx), ev,
&smb_options,
&smb_session_options,
- lp_gensec_settings(lp_ctx, lp_ctx));
+ lpcfg_gensec_settings(lp_ctx, lp_ctx));
}
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to \\\\%s\\%s - %s\n",
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_UNCLIST:
- lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
break;
case 'U':
if (username_count == 2) {
ret = tsocket_address_inet_from_strings(tctx, "ip",
dest,
- lp_cldap_port(tctx->lp_ctx),
+ lpcfg_cldap_port(tctx->lp_ctx),
&dest_addr);
CHECK_VAL(ret, 0);
ret = tsocket_address_inet_from_strings(tctx, "ip",
dest,
- lp_cldap_port(tctx->lp_ctx),
+ lpcfg_cldap_port(tctx->lp_ctx),
&dest_addr);
CHECK_VAL(ret, 0);
ret = tsocket_address_inet_from_strings(tctx, "ip",
dest,
- lp_cldap_port(tctx->lp_ctx),
+ lpcfg_cldap_port(tctx->lp_ctx),
&dest_addr);
CHECK_VAL(ret, 0);
"rootDomainNamingContext" */
ZERO_STRUCT(search2);
search2.in.dest_address = dest;
- search2.in.dest_port = lp_cldap_port(tctx->lp_ctx);
+ search2.in.dest_port = lpcfg_cldap_port(tctx->lp_ctx);
search2.in.timeout = 10;
search2.in.retries = 3;
search2.in.filter = "(objectclass=*)";
ret = tsocket_address_inet_from_strings(tctx, "ip",
dest,
- lp_cldap_port(tctx->lp_ctx),
+ lpcfg_cldap_port(tctx->lp_ctx),
&dest_addr);
CHECK_VAL(ret, 0);
ret = tsocket_address_inet_from_strings(tctx, "ip",
address,
- lp_cldap_port(tctx->lp_ctx),
+ lpcfg_cldap_port(tctx->lp_ctx),
&dest_addr);
CHECK_VAL(ret, 0);
ret = tsocket_address_inet_from_strings(tctx, "ip",
address,
- lp_cldap_port(tctx->lp_ctx),
+ lpcfg_cldap_port(tctx->lp_ctx),
&dest_addr);
CHECK_VAL(ret, 0);
make_nbt_name_server(&name, torture_setting_string(torture, "host", NULL));
/* do an initial name resolution to find its IP */
- status = resolve_name(lp_resolve_context(torture->lp_ctx), &name, torture, &address, torture->ev);
+ status = resolve_name(lpcfg_resolve_context(torture->lp_ctx), &name, torture, &address, torture->ev);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to resolve %s - %s\n",
name.name, nt_errstr(status));
return false;
}
- name.string = lp_workgroup(torture->lp_ctx);
+ name.string = lpcfg_workgroup(torture->lp_ctx);
/*
* Testing synchronous version
}
b = p->binding_handle;
- name.string = lp_workgroup(torture->lp_ctx);
+ name.string = lpcfg_workgroup(torture->lp_ctx);
/*
* Testing synchronous version
torture_assert_ntstatus_ok(torture, status, "RPC connection");
b = p->binding_handle;
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
if (!test_domain_open(torture, b, &domain_name, mem_ctx, &h, &sid)) {
ret = false;
goto done;
torture_assert_ntstatus_ok(torture, torture_temp_dir(torture, "libnet_BecomeDC", &location),
"torture_temp_dir should return NT_STATUS_OK" );
- netbios_name = lp_parm_string(torture->lp_ctx, NULL, "become dc", "smbtorture dc");
+ netbios_name = lpcfg_parm_string(torture->lp_ctx, NULL, "become dc", "smbtorture dc");
if (!netbios_name || !netbios_name[0]) {
netbios_name = "smbtorturedc";
}
make_nbt_name_server(&name, torture_setting_string(torture, "host", NULL));
/* do an initial name resolution to find its IP */
- status = resolve_name(lp_resolve_context(torture->lp_ctx),
+ status = resolve_name(lpcfg_resolve_context(torture->lp_ctx),
&name, torture, &address, torture->ev);
torture_assert_ntstatus_ok(torture, status, talloc_asprintf(torture,
"Failed to resolve %s - %s\n",
"Failed to get loaded dsdb_schema\n");
/* Make sure we get this from the command line */
- if (lp_parm_bool(torture->lp_ctx, NULL, "become dc", "do not unjoin", false)) {
+ if (lpcfg_parm_bool(torture->lp_ctx, NULL, "become dc", "do not unjoin", false)) {
talloc_free(s);
return ret;
}
/* we're accessing domain controller so the domain name should be
passed (it's going to be resolved to dc name and address) instead
of specific server name. */
- domain_name = lp_workgroup(torture->lp_ctx);
+ domain_name = lpcfg_workgroup(torture->lp_ctx);
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
if (ctx == NULL) {
goto done;
}
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
if (!test_opendomain_lsa(torture, p->binding_handle, torture, &h, &domain_name, &access_mask)) {
torture_comment(torture, "failed to open domain on lsa service\n");
/* we're accessing domain controller so the domain name should be
passed (it's going to be resolved to dc name and address) instead
of specific server name. */
- domain_name = lp_workgroup(torture->lp_ctx);
+ domain_name = lpcfg_workgroup(torture->lp_ctx);
/*
* Testing synchronous version
goto done;
}
- domain_name.string = talloc_strdup(mem_ctx, lp_workgroup(torture->lp_ctx));
+ domain_name.string = talloc_strdup(mem_ctx, lpcfg_workgroup(torture->lp_ctx));
if (!test_opendomain_samr(torture, p->binding_handle, torture, &h, &domain_name, &access_mask, &sid)) {
torture_comment(torture, "failed to open domain on samr service\n");
return false;
}
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
if (!test_domain_open(torture, p->binding_handle, &domain_name, prep_mem_ctx, &h, NULL)) {
ret = false;
goto done;
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
ctx->cred = cmdline_credentials;
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
mem_ctx = talloc_init("torture group list");
ZERO_STRUCT(req);
ctx->cred = cmdline_credentials;
req.in.group_name = TEST_GROUPNAME;
- req.in.domain_name = lp_workgroup(torture->lp_ctx);
+ req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
req.out.error_string = NULL;
status = libnet_CreateGroup(ctx, mem_ctx, &req);
goto done;
}
- lookup->in.domain_name = lp_workgroup(torture->lp_ctx);
+ lookup->in.domain_name = lpcfg_workgroup(torture->lp_ctx);
lookup->in.name_type = NBT_NAME_PDC;
status = libnet_LookupDCs(ctx, mem_ctx, lookup);
if (mem_ctx == NULL) return false;
r.in.name = "Administrator";
- r.in.domain_name = lp_workgroup(torture->lp_ctx);
+ r.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
status = libnet_LookupName(ctx, mem_ctx, &r);
/* we're accessing domain controller so the domain name should be
passed (it's going to be resolved to dc name and address) instead
of specific server name. */
- domain_name = lp_workgroup(torture->lp_ctx);
+ domain_name = lpcfg_workgroup(torture->lp_ctx);
return torture_rpc_connect(torture, level, NULL, domain_name);
}
/* we're accessing domain controller so the domain name should be
passed (it's going to be resolved to dc name and address) instead
of specific server name. */
- domain_name = lp_workgroup(torture->lp_ctx);
+ domain_name = lpcfg_workgroup(torture->lp_ctx);
return torture_rpc_connect(torture, level, NULL, domain_name);
}
/* we're accessing domain controller so the domain name should be
passed (it's going to be resolved to dc name and address) instead
of specific server name. */
- domain_name = lp_workgroup(torture->lp_ctx);
+ domain_name = lpcfg_workgroup(torture->lp_ctx);
return torture_rpc_connect(torture, level, NULL, domain_name);
}
}
req.in.user_name = TEST_USERNAME;
- req.in.domain_name = lp_workgroup(torture->lp_ctx);
+ req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
req.out.error_string = NULL;
status = libnet_CreateUser(ctx, mem_ctx, &req);
prep_mem_ctx = talloc_init("prepare test_deleteuser");
req.in.user_name = TEST_USERNAME;
- req.in.domain_name = lp_workgroup(torture->lp_ctx);
+ req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
status = torture_rpc_connection(torture,
&p,
goto done;
}
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
if (!test_domain_open(torture, p->binding_handle, &domain_name, prep_mem_ctx, &h, NULL)) {
ret = false;
goto done;
name = talloc_strdup(prep_mem_ctx, TEST_USERNAME);
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
if (!test_domain_open(torture, b, &domain_name, prep_mem_ctx, &h, NULL)) {
ret = false;
goto done;
for (fld = USER_FIELD_FIRST; fld <= USER_FIELD_LAST; fld++) {
ZERO_STRUCT(req);
- req.in.domain_name = lp_workgroup(torture->lp_ctx);
+ req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
req.in.user_name = name;
set_test_changes(torture, torture, &req, 1, &name, fld);
}
ZERO_STRUCT(user_req);
- user_req.in.domain_name = lp_workgroup(torture->lp_ctx);
+ user_req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
user_req.in.data.user_name = name;
user_req.in.level = USER_INFO_BY_NAME;
}
b = p->binding_handle;
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
if (!test_domain_open(torture, b, &domain_name, prep_mem_ctx, &h, NULL)) {
ret = false;
goto done;
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
ctx->cred = cmdline_credentials;
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
mem_ctx = talloc_init("torture user list");
ZERO_STRUCT(req);
}
b = p->binding_handle;
- name.string = lp_workgroup(torture->lp_ctx);
+ name.string = lpcfg_workgroup(torture->lp_ctx);
/*
* Testing synchronous version
torture_assert_ntstatus_ok(torture, status, "RPC connect failed");
b = p->binding_handle;
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
if (!test_domain_open(torture, b, &domain_name, mem_ctx, &h, &sid)) {
ret = false;
goto done;
}
b = p->binding_handle;
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
if (!test_domain_open(torture, b, &domain_name, mem_ctx, &h, &sid)) {
ret = false;
goto done;
torture_assert_ntstatus_ok(torture, status, "RPC connect");
b = p->binding_handle;
- domain_name.string = lp_workgroup(torture->lp_ctx);
+ domain_name.string = lpcfg_workgroup(torture->lp_ctx);
name = talloc_strdup(mem_ctx, TEST_USERNAME);
if (!test_domain_open(torture, b, &domain_name, mem_ctx, &h, &sid)) {
torture_comment(torture, "Testing ldb speed for sidmap\n");
- ldb = ldb_wrap_connect(tmp_ctx, torture->ev, torture->lp_ctx, "tdb://test.ldb",
+ ldb = ldb_wrap_connect(tmp_ctx, torture->ev, torture->lp_ctx, "tdb://test.ldb",
NULL, NULL, LDB_FLG_NOSYNC);
if (!ldb) {
torture_result(torture, TORTURE_FAIL, "Failed to open test.ldb");
struct smbcli_options options;
struct smbcli_session_options session_options;
- lp_smbcli_options(lp_ctx, &options);
- lp_smbcli_session_options(lp_ctx, &session_options);
+ lpcfg_smbcli_options(lp_ctx, &options);
+ lpcfg_smbcli_session_options(lp_ctx, &session_options);
printf("connect_one(%s, %d, %d)\n", share, snum, conn);
char **unc_list = NULL;
int num_unc_names;
const char *p;
- p = lp_parm_string(lp_ctx, NULL, "torture", "unclist");
+ p = lpcfg_parm_string(lp_ctx, NULL, "torture", "unclist");
if (p) {
char *h, *s;
unc_list = file_lines_load(p, &num_unc_names, 0, NULL);
printf("\\\\%s\\%s\n", server, share);
status = smbcli_full_connection(NULL, &c,
server,
- lp_smb_ports(lp_ctx),
+ lpcfg_smb_ports(lp_ctx),
share, NULL,
- lp_socket_options(lp_ctx),
+ lpcfg_socket_options(lp_ctx),
servers[snum],
- lp_resolve_context(lp_ctx),
+ lpcfg_resolve_context(lp_ctx),
ev, &options, &session_options,
- lp_gensec_settings(mem_ctx, lp_ctx));
+ lpcfg_gensec_settings(mem_ctx, lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
sleep(2);
}
}
talloc_free(cli[server][conn]);
}
- cli[server][conn] = connect_one(ev, lp_ctx, mem_ctx, share[server],
+ cli[server][conn] = connect_one(ev, lp_ctx, mem_ctx, share[server],
server, conn);
if (!cli[server][conn]) {
DEBUG(0,("Failed to connect to %s\n", share[server]));
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_UNCLIST:
- lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
break;
case 'U':
if (username_count == 2) {
nt_status = smbcli_full_connection(NULL,
&c, myname, server_n, ports, share, NULL,
- username, lp_workgroup(), password, ev,
+ username, lpcfg_workgroup(), password, ev,
options, session_options, gensec_settings);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status)));
argv += 4;
lp_ctx = loadparm_init(mem_ctx);
- lp_load(lp_ctx, dyn_CONFIGFILE);
+ lpcfg_load(lp_ctx, dyn_CONFIGFILE);
if (getenv("USER")) {
username = talloc_strdup(mem_ctx, getenv("USER"));
ev = s4_event_context_init(mem_ctx);
locking_init(1);
- lp_smbcli_options(lp_ctx, &options);
- lp_smbcli_session_options(lp_ctx, &session_options);
+ lpcfg_smbcli_options(lp_ctx, &options);
+ lpcfg_smbcli_session_options(lp_ctx, &session_options);
test_locks(mem_ctx, share1, share2, nfspath1, nfspath2,
- lp_smb_ports(lp_ctx),
- &options, &session_options, lp_gensec_settings(lp_ctx), ev);
+ lpcfg_smb_ports(lp_ctx),
+ &options, &session_options, lpcfg_gensec_settings(lp_ctx), ev);
return(0);
}
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_UNCLIST:
- lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
break;
}
}
gensec_init(lp_ctx);
- lp_smbcli_options(lp_ctx, &options);
- lp_smbcli_session_options(lp_ctx, &session_options);
+ lpcfg_smbcli_options(lp_ctx, &options);
+ lpcfg_smbcli_session_options(lp_ctx, &session_options);
- cli = connect_one(lp_resolve_context(lp_ctx), ev, mem_ctx, share,
- lp_smb_ports(lp_ctx), lp_socket_options(lp_ctx),
+ cli = connect_one(lpcfg_resolve_context(lp_ctx), ev, mem_ctx, share,
+ lpcfg_smb_ports(lp_ctx), lpcfg_socket_options(lp_ctx),
&options, &session_options,
- lp_gensec_settings(mem_ctx, lp_ctx));
+ lpcfg_gensec_settings(mem_ctx, lp_ctx));
if (!cli) {
DEBUG(0,("Failed to connect to %s\n", share));
exit(1);
NTSTATUS status;
bool ret = true;
- name.name = lp_workgroup();
+ name.name = lpcfg_workgroup();
name.type = NBT_NAME_BROWSER;
name.scope = NULL;
struct interface *ifaces;
- name.name = lp_workgroup(tctx->lp_ctx);
+ name.name = lpcfg_workgroup(tctx->lp_ctx);
name.type = NBT_NAME_LOGON;
name.scope = NULL;
/* do an initial name resolution to find its IP */
torture_assert_ntstatus_ok(tctx,
- resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev),
+ resolve_name(lpcfg_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- myaddress, lp_dgram_port(tctx->lp_ctx));
+ myaddress, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, socket_address != NULL, "Error getting address");
/* try receiving replies on port 138 first, which will only
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock, &name, dest,
struct cli_credentials *machine_credentials;
const struct dom_sid *dom_sid;
- name.name = lp_workgroup(tctx->lp_ctx);
+ name.name = lpcfg_workgroup(tctx->lp_ctx);
name.type = NBT_NAME_LOGON;
name.scope = NULL;
/* do an initial name resolution to find its IP */
torture_assert_ntstatus_ok(tctx,
- resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev),
+ resolve_name(lpcfg_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- myaddress, lp_dgram_port(tctx->lp_ctx));
+ myaddress, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, socket_address != NULL, "Error getting address");
/* try receiving replies on port 138 first, which will only
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock, &name, dest,
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock, &name, dest,
torture_assert(tctx, join_ctx != NULL,
talloc_asprintf(tctx, "Failed to join domain %s as %s\n",
- lp_workgroup(tctx->lp_ctx), TEST_NAME));
+ lpcfg_workgroup(tctx->lp_ctx), TEST_NAME));
dom_sid = torture_join_sid(join_ctx);
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock, &name, dest,
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock, &name, dest,
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock, &name, dest,
struct interface *ifaces;
- name.name = lp_workgroup(tctx->lp_ctx);
+ name.name = lpcfg_workgroup(tctx->lp_ctx);
name.type = NBT_NAME_LOGON;
name.scope = NULL;
/* do an initial name resolution to find its IP */
torture_assert_ntstatus_ok(tctx,
- resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev),
+ resolve_name(lpcfg_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address));
socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- myaddress, lp_dgram_port(tctx->lp_ctx));
+ myaddress, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, socket_address != NULL, "Error getting address");
/* try receiving replies on port 138 first, which will only
torture_assert(tctx, join_ctx != NULL,
talloc_asprintf(tctx, "Failed to join domain %s as %s\n",
- lp_workgroup(tctx->lp_ctx), TEST_NAME));
+ lpcfg_workgroup(tctx->lp_ctx), TEST_NAME));
/* setup a temporary mailslot listener for replies */
dgmslot = dgram_mailslot_temp(dgmsock, NBT_MAILSLOT_GETDC,
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock,
&name, dest,
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock,
&name, dest,
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock,
&name, dest,
make_nbt_name_client(&myname, TEST_NAME);
dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
- address, lp_dgram_port(tctx->lp_ctx));
+ address, lpcfg_dgram_port(tctx->lp_ctx));
torture_assert(tctx, dest != NULL, "Error getting address");
status = dgram_mailslot_netlogon_send(dgmsock,
&name, dest,
/* do an initial name resolution to find its IP */
torture_assert_ntstatus_ok(tctx,
- resolve_name(lp_resolve_context(tctx->lp_ctx), name, tctx, address, tctx->ev),
+ resolve_name(lpcfg_resolve_context(tctx->lp_ctx), name, tctx, address, tctx->ev),
talloc_asprintf(tctx,
"Failed to resolve %s", name->name));
io.in.name = name;
io.in.dest_addr = address;
- io.in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ io.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
io.in.broadcast = false;
io.in.wins_lookup = false;
io.in.timeout = 1;
if (!torture_nbt_get_name(tctx, &name, &address))
return false;
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
myaddress = iface_best_ip(ifaces, address);
io.in.name = name;
io.in.dest_addr = address;
- io.in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ io.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
io.in.address = myaddress;
io.in.nb_flags = NBT_NODE_B | NBT_NM_ACTIVE;
io.in.register_demand = false;
if (!torture_nbt_get_name(tctx, &name, &address))
return false;
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
myaddress = iface_best_ip(ifaces, address);
io.in.name = name;
io.in.dest_addr = address;
- io.in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ io.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
io.in.address = myaddress;
io.in.nb_flags = NBT_NODE_B | NBT_NM_ACTIVE;
io.in.broadcast = false;
struct interface *ifaces;
bool low_port = try_low_port;
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
myaddress = talloc_strdup(tctx, iface_best_ip(ifaces, address));
socket_address = socket_address_from_strings(tctx,
nbtsock->sock->backend_name,
- myaddress, lp_nbt_port(tctx->lp_ctx));
+ myaddress, lpcfg_nbt_port(tctx->lp_ctx));
torture_assert(tctx, socket_address != NULL,
"Error getting address");
torture_comment(tctx, "release the name\n");
release.in.name = *name;
- release.in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ release.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
release.in.dest_addr = address;
release.in.address = myaddress;
release.in.nb_flags = nb_flags;
} else {
torture_comment(tctx, "register the name with a wrong address (makes the next request slow!)\n");
io.in.name = *name;
- io.in.wins_port = lp_nbt_port(tctx->lp_ctx);
+ io.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx);
io.in.wins_servers = const_str_list(
str_list_make_single(tctx, address));
io.in.addresses = const_str_list(
torture_comment(tctx, "register the name correct address\n");
name_register.in.name = *name;
- name_register.in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ name_register.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
name_register.in.dest_addr = address;
name_register.in.address = myaddress;
name_register.in.nb_flags = nb_flags;
torture_comment(tctx, "register the name correct address\n");
io.in.name = *name;
- io.in.wins_port = lp_nbt_port(tctx->lp_ctx);
+ io.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx);
io.in.wins_servers = (const char **)str_list_make_single(tctx, address);
io.in.addresses = (const char **)str_list_make_single(tctx, myaddress);
io.in.nb_flags = nb_flags;
torture_comment(tctx, "query the name to make sure its there\n");
query.in.name = *name;
query.in.dest_addr = address;
- query.in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ query.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
query.in.broadcast = false;
query.in.wins_lookup = true;
query.in.timeout = 3;
torture_comment(tctx, "refresh the name\n");
refresh.in.name = *name;
- refresh.in.wins_port = lp_nbt_port(tctx->lp_ctx);
+ refresh.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx);
refresh.in.wins_servers = (const char **)str_list_make_single(tctx, address);
refresh.in.addresses = (const char **)str_list_make_single(tctx, myaddress);
refresh.in.nb_flags = nb_flags;
printf("release the name\n");
release.in.name = *name;
- release.in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ release.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
release.in.dest_addr = address;
release.in.address = myaddress;
release.in.nb_flags = nb_flags;
} else {
torture_comment(tctx, "register the name with a wrong address (makes the next request slow!)\n");
io.in.name = *name;
- io.in.wins_port = lp_nbt_port(tctx->lp_ctx);
+ io.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx);
io.in.wins_servers = const_str_list(
str_list_make_single(tctx, address));
io.in.addresses = const_str_list(
torture_comment(tctx, "refresh the name with the correct address\n");
refresh.in.name = *name;
- refresh.in.wins_port = lp_nbt_port(tctx->lp_ctx);
+ refresh.in.wins_port = lpcfg_nbt_port(tctx->lp_ctx);
refresh.in.wins_servers = const_str_list(
str_list_make_single(tctx, address));
refresh.in.addresses = const_str_list(
torture_comment(tctx, "release the name\n");
release.in.name = *name;
- release.in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ release.in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
release.in.dest_addr = address;
release.in.address = myaddress;
release.in.nb_flags = nb_flags;
state->num_names = torture_entries;
state->registered = talloc_zero_array(state, bool, state->num_names);
state->wins_server = address;
- state->wins_port = lp_nbt_port(tctx->lp_ctx);
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ state->wins_port = lpcfg_nbt_port(tctx->lp_ctx);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
state->my_ip = talloc_strdup(tctx, iface_best_ip(ifaces, address));
state->ttl = timelimit;
ctx->nbtsock = nbt_name_socket_init(ctx, tctx->ev);
if (!ctx->nbtsock) return NULL;
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0);
if (!ctx->myaddr) return NULL;
if (!ctx->nbtsock_srv) return NULL;
/* Make a port 137 version of ctx->myaddr */
- nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lp_nbt_port(tctx->lp_ctx));
+ nbt_srv_addr = socket_address_from_strings(tctx, ctx->nbtsock_srv->sock->backend_name, ctx->myaddr->addr, lpcfg_nbt_port(tctx->lp_ctx));
if (!nbt_srv_addr) return NULL;
/* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
nbt_srv_addr = socket_address_from_strings(tctx,
ctx->nbtsock_srv->sock->backend_name,
ctx->myaddr2->addr,
- lp_nbt_port(tctx->lp_ctx));
+ lpcfg_nbt_port(tctx->lp_ctx));
if (!nbt_srv_addr) return NULL;
/* And if possible, bind to it. This won't work unless we are root or in sockewrapper */
*/
name_register->in.name = records[i].name;
name_register->in.dest_addr = ctx->address;
- name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
name_register->in.address = records[i].wins.ips[0].ip;
name_register->in.nb_flags = records[i].wins.nb_flags;
name_register->in.register_demand= false;
/* release the record */
release->in.name = records[i].name;
- release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
release->in.dest_addr = ctx->address;
release->in.address = records[i].wins.ips[0].ip;
release->in.nb_flags = records[i].wins.nb_flags;
} else {
release->in.name = records[i].name;
release->in.dest_addr = ctx->address;
- release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
release->in.address = records[i].wins.ips[0].ip;
release->in.nb_flags = records[i].wins.nb_flags;
release->in.broadcast = false;
if (!ctx->nbtsock_srv) {
torture_comment(tctx, "SKIP: Test Replica records vs. owned active records: not bound to port[%d]\n",
- lp_nbt_port(tctx->lp_ctx));
+ lpcfg_nbt_port(tctx->lp_ctx));
return true;
}
name_register->in.name = records[i].name;
name_register->in.dest_addr = ctx->address;
- name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ name_register->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
name_register->in.address = records[i].wins.ips[j].ip;
name_register->in.nb_flags = records[i].wins.nb_flags;
name_register->in.register_demand= false;
release->in.name = records[i].name;
release->in.dest_addr = ctx->address;
- release->in.dest_port = lp_nbt_port(tctx->lp_ctx);
+ release->in.dest_port = lpcfg_nbt_port(tctx->lp_ctx);
release->in.address = records[i].wins.ips[j].ip;
release->in.nb_flags = records[i].wins.nb_flags;
release->in.broadcast = false;
unix_address = talloc_asprintf(signd_client,
"%s/socket",
- lp_ntp_signd_socket_directory(tctx->lp_ctx));
+ lpcfg_ntp_signd_socket_directory(tctx->lp_ctx));
rc = tsocket_address_unix_from_path(mem_ctx,
unix_address,
&signd_client->remote_address);
torture_comment(tctx, "Testing rap_NetUserPasswordSet2(%s)\n", r.in.UserName);
torture_assert_ntstatus_ok(tctx,
- smbcli_rap_netuserpasswordset2(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
+ smbcli_rap_netuserpasswordset2(cli->tree, lpcfg_iconv_convenience(tctx->lp_ctx), tctx, &r),
"smbcli_rap_netuserpasswordset2 failed");
if (!W_ERROR_IS_OK(W_ERROR(r.out.status))) {
torture_warning(tctx, "RAP NetUserPasswordSet2 gave: %s\n",
torture_comment(tctx, "Testing rap_NetUserPasswordSet2(%s)\n", r.in.UserName);
torture_assert_ntstatus_ok(tctx,
- smbcli_rap_netuserpasswordset2(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
+ smbcli_rap_netuserpasswordset2(cli->tree, lpcfg_iconv_convenience(tctx->lp_ctx), tctx, &r),
"smbcli_rap_netuserpasswordset2 failed");
if (!W_ERROR_IS_OK(W_ERROR(r.out.status))) {
torture_warning(tctx, "RAP NetUserPasswordSet2 gave: %s\n",
torture_comment(tctx, "Testing rap_NetOEMChangePassword(%s)\n", r.in.UserName);
torture_assert_ntstatus_ok(tctx,
- smbcli_rap_netoemchangepassword(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
+ smbcli_rap_netoemchangepassword(cli->tree, lpcfg_iconv_convenience(tctx->lp_ctx), tctx, &r),
"smbcli_rap_netoemchangepassword failed");
if (!W_ERROR_IS_OK(W_ERROR(r.out.status))) {
torture_warning(tctx, "RAP NetOEMChangePassword gave: %s\n",
}
io2.in.dest_host = torture_setting_string(tctx, "host", NULL);
- io2.in.ports = lp_smb_ports(tctx->lp_ctx);
+ io2.in.ports = lpcfg_smb_ports(tctx->lp_ctx);
io2.in.called_name = torture_setting_string(tctx, "host", NULL);
io2.in.service = torture_setting_string(tctx, "share", NULL);
io2.in.service_type = "A:";
io2.in.credentials = cmdline_credentials;
- io2.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ io2.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
io2.in.filename = fname;
- io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx);
- io2.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
- lp_smbcli_options(tctx->lp_ctx, &io2.in.options);
- lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
+ io2.in.resolve_ctx = lpcfg_resolve_context(tctx->lp_ctx);
+ io2.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
+ lpcfg_smbcli_options(tctx->lp_ctx, &io2.in.options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
printf("Testing parallel fetchfile with %d ops\n", torture_numops);
bool ret = true;
io1.in.dest_host = torture_setting_string(tctx, "host", NULL);
- io1.in.dest_ports = lp_smb_ports(tctx->lp_ctx);
- io1.in.socket_options = lp_socket_options(tctx->lp_ctx);
+ io1.in.dest_ports = lpcfg_smb_ports(tctx->lp_ctx);
+ io1.in.socket_options = lpcfg_socket_options(tctx->lp_ctx);
io1.in.called_name = torture_setting_string(tctx, "host", NULL);
io1.in.service = torture_setting_string(tctx, "share", NULL);
io1.in.service_type = "A:";
io1.in.credentials = cmdline_credentials;
- io1.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ io1.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
io1.in.level = RAW_QFS_OBJECTID_INFORMATION;
- io1.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
+ io1.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
printf("Testing parallel queryfsinfo [Object ID] with %d ops\n",
torture_numops);
c = talloc_array(tctx, struct composite_context *, torture_numops);
for (i=0; i<torture_numops; i++) {
- c[i] = smb_composite_fsinfo_send(cli->tree, &io1, lp_resolve_context(tctx->lp_ctx));
+ c[i] = smb_composite_fsinfo_send(cli->tree, &io1, lpcfg_resolve_context(tctx->lp_ctx));
c[i]->async.fn = loadfile_complete;
c[i]->async.private_data = count;
}
printf("create a second security context on the same transport\n");
- lp_smbcli_session_options(tctx->lp_ctx, &options);
- gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
+ gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setup.in.credentials = cmdline_credentials;
setup.in.gensec_settings = gensec_settings;
session2->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setup.in.credentials = cmdline_credentials;
session3->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setup.in.credentials = cmdline_credentials;
session4->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
anon_creds = cli_credentials_init(tctx);
cli_credentials_set_conf(anon_creds, tctx->lp_ctx);
for (i=0; i <ARRAY_SIZE(sessions); i++) {
setups[i].in.sesskey = cli->transport->negotiate.sesskey;
setups[i].in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
- setups[i].in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setups[i].in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setups[i].in.credentials = cmdline_credentials;
setups[i].in.gensec_settings = gensec_settings;
share = torture_setting_string(tctx, "share", NULL);
host = torture_setting_string(tctx, "host", NULL);
- lp_smbcli_session_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
printf("create the first new sessions\n");
session1 = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setup.in.credentials = cmdline_credentials;
- setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
+ setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(session1, &setup);
CHECK_STATUS(status, NT_STATUS_OK);
session1->vuid = setup.out.vuid;
session2 = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setup.in.credentials = cmdline_credentials;
- setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
+ setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(session2, &setup);
CHECK_STATUS(status, NT_STATUS_OK);
session2->vuid = setup.out.vuid;
return false;
}
- lp_smbcli_session_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
printf("create a second security context on the same transport\n");
session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setup.in.credentials = cmdline_credentials;
- setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
+ setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(session, &setup);
CHECK_STATUS(status, NT_STATUS_OK);
struct smbcli_state *cli)
{
bool ret = true;
- if (lp_use_spnego(torture->lp_ctx)) {
+ if (lpcfg_use_spnego(torture->lp_ctx)) {
ret &= torture_raw_context_int(torture, cli);
- lp_set_cmdline(torture->lp_ctx, "use spnego", "False");
+ lpcfg_set_cmdline(torture->lp_ctx, "use spnego", "False");
}
ret &= torture_raw_context_int(torture, cli);
return false;
}
- lp_smbcli_session_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
torture_comment(tctx, "Testing LOCKING_ANDX_CANCEL_LOCK\n");
io.generic.level = RAW_LOCK_LOCKX;
session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
- setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
+ setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
setup.in.credentials = cmdline_credentials;
- setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
+ setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(session, &setup);
CHECK_STATUS(status, NT_STATUS_OK);
session->vuid = setup.out.vuid;
io->in.dest_host = state->dest_host;
io->in.dest_ports = state->dest_ports;
- io->in.gensec_settings = lp_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);
- io->in.socket_options = lp_socket_options(state->tctx->lp_ctx);
+ io->in.gensec_settings = lpcfg_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);
+ io->in.socket_options = lpcfg_socket_options(state->tctx->lp_ctx);
io->in.called_name = state->called_name;
io->in.service = share;
io->in.service_type = state->service_type;
io->in.credentials = cmdline_credentials;
io->in.fallback_to_anonymous = false;
- io->in.workgroup = lp_workgroup(state->tctx->lp_ctx);
- lp_smbcli_options(state->tctx->lp_ctx, &io->in.options);
- lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
+ io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx);
+ lpcfg_smbcli_options(state->tctx->lp_ctx, &io->in.options);
+ lpcfg_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
/* kill off the remnants of the old connection */
talloc_free(state->tree);
state->tree = NULL;
ctx = smb_composite_connect_send(io, state->mem_ctx,
- lp_resolve_context(state->tctx->lp_ctx),
+ lpcfg_resolve_context(state->tctx->lp_ctx),
state->ev);
if (ctx == NULL) {
DEBUG(0,("Failed to setup async reconnect\n"));
io->in.dest_host = state->dest_host;
io->in.dest_ports = state->dest_ports;
- io->in.socket_options = lp_socket_options(state->tctx->lp_ctx);
+ io->in.socket_options = lpcfg_socket_options(state->tctx->lp_ctx);
io->in.called_name = state->called_name;
io->in.service = share;
io->in.service_type = state->service_type;
io->in.credentials = cmdline_credentials;
io->in.fallback_to_anonymous = false;
- io->in.workgroup = lp_workgroup(state->tctx->lp_ctx);
- io->in.gensec_settings = lp_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);
- lp_smbcli_options(state->tctx->lp_ctx, &io->in.options);
- lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
+ io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx);
+ io->in.gensec_settings = lpcfg_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);
+ lpcfg_smbcli_options(state->tctx->lp_ctx, &io->in.options);
+ lpcfg_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
/* kill off the remnants of the old connection */
talloc_free(state->tree);
state->close_fnum = -1;
ctx = smb_composite_connect_send(io, state->mem_ctx,
- lp_resolve_context(state->tctx->lp_ctx),
+ lpcfg_resolve_context(state->tctx->lp_ctx),
state->ev);
if (ctx == NULL) {
DEBUG(0,("Failed to setup async reconnect\n"));
struct smbcli_options options;
struct smbcli_session_options session_options;
- lp_smbcli_options(tctx->lp_ctx, &options);
- lp_smbcli_session_options(tctx->lp_ctx, &session_options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options);
options.use_level2_oplocks = false;
status = smbcli_full_connection(tctx, c,
torture_setting_string(tctx, "host", NULL),
- lp_smb_ports(tctx->lp_ctx),
+ lpcfg_smb_ports(tctx->lp_ctx),
torture_setting_string(tctx, "share", NULL),
- NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials,
- lp_resolve_context(tctx->lp_ctx),
+ NULL, lpcfg_socket_options(tctx->lp_ctx), cmdline_credentials,
+ lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
torture_comment(tctx, "Failed to open connection - %s\n",
nt_errstr(status));
return false;
}
- nt_status_support = lp_nt_status_support(torture->lp_ctx);
+ nt_status_support = lpcfg_nt_status_support(torture->lp_ctx);
- if (!lp_set_cmdline(torture->lp_ctx, "nt status support", "yes")) {
+ if (!lpcfg_set_cmdline(torture->lp_ctx, "nt status support", "yes")) {
printf("Could not set 'nt status support = yes'\n");
goto fail;
}
goto fail;
}
- if (!lp_set_cmdline(torture->lp_ctx, "nt status support", "no")) {
+ if (!lpcfg_set_cmdline(torture->lp_ctx, "nt status support", "no")) {
printf("Could not set 'nt status support = yes'\n");
goto fail;
}
goto fail;
}
- if (!lp_set_cmdline(torture->lp_ctx, "nt status support",
+ if (!lpcfg_set_cmdline(torture->lp_ctx, "nt status support",
nt_status_support ? "yes":"no")) {
printf("Could not reset 'nt status support = yes'");
goto fail;
struct smbcli_options options;
struct smbcli_session_options session_options;
- lp_smbcli_options(tctx->lp_ctx, &options);
- lp_smbcli_session_options(tctx->lp_ctx, &session_options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options);
child = fork();
if (child == -1) {
NTSTATUS status;
status = smbcli_full_connection(NULL, &cli,
- host, lp_smb_ports(tctx->lp_ctx), share,
- NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials,
- lp_resolve_context(tctx->lp_ctx),
+ host, lpcfg_smb_ports(tctx->lp_ctx), share,
+ NULL, lpcfg_socket_options(tctx->lp_ctx), cmdline_credentials,
+ lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
const char *iface_name;
bool ret = true;
const struct ndr_interface_list *l;
- iface_name = lp_parm_string(torture->lp_ctx, NULL, "countcalls", "interface");
+ iface_name = lpcfg_parm_string(torture->lp_ctx, NULL, "countcalls", "interface");
if (iface_name != NULL) {
iface = ndr_table_by_name(iface_name);
if (!iface) {
r.in.req->req5.highwatermark.highest_usn = 0;
r.in.req->req5.uptodateness_vector = NULL;
r.in.req->req5.replica_flags = 0;
- if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) {
r.in.req->req5.replica_flags |= DRSUAPI_DRS_USE_COMPRESSION;
}
r.in.req->req5.max_object_count = 0;
r.in.req->req8.highwatermark.highest_usn = 0;
r.in.req->req8.uptodateness_vector = NULL;
r.in.req->req8.replica_flags = 0;
- if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) {
r.in.req->req8.replica_flags |= DRSUAPI_DRS_USE_COMPRESSION;
}
- if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "neighbour_writeable", true)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "neighbour_writeable", true)) {
r.in.req->req8.replica_flags |= DRSUAPI_DRS_WRIT_REP;
}
r.in.req->req8.replica_flags |= DRSUAPI_DRS_INIT_SYNC
make_nbt_name_server(&name, ctx->drsuapi_binding->host);
/* do an initial name resolution to find its IP */
- status = resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx,
+ status = resolve_name(lpcfg_resolve_context(tctx->lp_ctx), &name, tctx,
&ctx->dest_address, tctx->ev);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to resolve %s - %s\n",
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3;
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7;
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT;
- if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "xpress", false)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "xpress", false)) {
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS;
}
our_bind_info28->site_guid = GUID_zero();
ldb_set_modules_dir(ldb,
talloc_asprintf(ldb,
"%s/ldb",
- lp_modulesdir(tctx->lp_ctx)));
+ lpcfg_modulesdir(tctx->lp_ctx)));
if (ldb_set_opaque(ldb, "credentials", credentials)) {
talloc_free(ldb);
ret2 = tsocket_address_inet_from_strings(tctx, "ip",
ctx->dest_address,
- lp_cldap_port(tctx->lp_ctx),
+ lpcfg_cldap_port(tctx->lp_ctx),
&dest_addr);
if (ret2 != 0) {
printf("failed to create tsocket_address for '%s' port %u - %s\n",
- ctx->drsuapi_binding->host, lp_cldap_port(tctx->lp_ctx),
+ ctx->drsuapi_binding->host, lpcfg_cldap_port(tctx->lp_ctx),
strerror(errno));
return false;
}
r.in.req->req1.format_flags = DRSUAPI_DS_NAME_FLAG_NO_FLAGS;
r.in.req->req1.format_offered = DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT;
r.in.req->req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779;
- names[0].str = talloc_asprintf(ctx, "%s\\", lp_workgroup(tctx->lp_ctx));
+ names[0].str = talloc_asprintf(ctx, "%s\\", lpcfg_workgroup(tctx->lp_ctx));
r.out.level_out = &level_out;
r.out.ctr = &ctr;
talloc_free(search_req);
}
- if (!lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) {
+ if (!lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) {
talloc_free(objs);
return true;
}
- save_values_dir = lp_parm_string(tctx->lp_ctx, NULL, "dssync", "save_pwd_blobs_dir");
+ save_values_dir = lpcfg_parm_string(tctx->lp_ctx, NULL, "dssync", "save_pwd_blobs_dir");
for (cur = first_object; cur; cur = cur->next_object) {
const char *dn;
ZERO_STRUCT(null_guid);
ZERO_STRUCT(null_sid);
- partition = lp_parm_string(tctx->lp_ctx, NULL, "dssync", "partition");
+ partition = lpcfg_parm_string(tctx->lp_ctx, NULL, "dssync", "partition");
if (partition == NULL) {
partition = ctx->domain_dn;
printf("dssync:partition not specified, defaulting to %s.\n", ctx->domain_dn);
}
- highest_usn = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "highest_usn", 0);
+ highest_usn = lpcfg_parm_int(tctx->lp_ctx, NULL, "dssync", "highest_usn", 0);
- array[0].level = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "get_nc_changes_level", array[0].level);
+ array[0].level = lpcfg_parm_int(tctx->lp_ctx, NULL, "dssync", "get_nc_changes_level", array[0].level);
- if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) {
const struct samr_Password *nthash;
nthash = cli_credentials_get_nt_hash(ctx->new_dc.credentials, ctx);
if (nthash) {
r.in.req->req5.highwatermark.highest_usn = highest_usn;
r.in.req->req5.uptodateness_vector = NULL;
r.in.req->req5.replica_flags = 0;
- if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) {
r.in.req->req5.replica_flags |= DRSUAPI_DRS_USE_COMPRESSION;
}
- if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) {
r.in.req->req5.replica_flags |= DRSUAPI_DRS_WRIT_REP;
}
r.in.req->req5.replica_flags |= DRSUAPI_DRS_INIT_SYNC
r.in.req->req8.highwatermark.highest_usn = highest_usn;
r.in.req->req8.uptodateness_vector = NULL;
r.in.req->req8.replica_flags = 0;
- if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) {
r.in.req->req8.replica_flags |= DRSUAPI_DRS_USE_COMPRESSION;
}
- if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) {
+ if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) {
r.in.req->req8.replica_flags |= DRSUAPI_DRS_WRIT_REP;
}
r.in.req->req8.replica_flags |= DRSUAPI_DRS_INIT_SYNC
r.out.info = &info;
r.out.level_out = &level_out;
- req.req1.flags = lp_parm_int(tctx->lp_ctx, NULL,
+ req.req1.flags = lpcfg_parm_int(tctx->lp_ctx, NULL,
"dssync", "nt4changelog_flags",
DRSUAPI_NT4_CHANGELOG_GET_CHANGELOG |
DRSUAPI_NT4_CHANGELOG_GET_SERIAL_NUMBERS);
- req.req1.preferred_maximum_length = lp_parm_int(tctx->lp_ctx, NULL,
+ req.req1.preferred_maximum_length = lpcfg_parm_int(tctx->lp_ctx, NULL,
"dssync", "nt4changelog_preferred_len",
0x00004000);
r.in.replica_set_guid = NULL;
r.in.connection_guid = NULL;
- r.in.replica_set_name = lp_dnsdomain(tctx->lp_ctx);
+ r.in.replica_set_name = lpcfg_dnsdomain(tctx->lp_ctx);
r.in.partner_dns_name = dcerpc_server_name(p);
torture_assert_ntstatus_ok(tctx,
return false;
}
- lp_smbcli_options(torture->lp_ctx, &options);
- lp_smbcli_session_options(torture->lp_ctx, &session_options);
+ lpcfg_smbcli_options(torture->lp_ctx, &options);
+ lpcfg_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(tj, &cli, host,
- lp_smb_ports(torture->lp_ctx),
+ lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL,
- lp_socket_options(torture->lp_ctx),
+ lpcfg_socket_options(torture->lp_ctx),
machine_account,
- lp_resolve_context(torture->lp_ctx),
+ lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_gensec_settings(torture, torture->lp_ctx));
+ lpcfg_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
TORTURE_NETBIOS_NAME));
}
status = smbcli_full_connection(tj, &cli, host,
- lp_smb_ports(torture->lp_ctx),
+ lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL,
- lp_socket_options(torture->lp_ctx),
+ lpcfg_socket_options(torture->lp_ctx),
machine_account,
- lp_resolve_context(torture->lp_ctx),
+ lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_gensec_settings(torture, torture->lp_ctx));
+ lpcfg_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
TORTURE_NETBIOS_NAME));
continue;
}
- lp_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(loop_ctx, b));
+ lpcfg_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(loop_ctx, b));
status = torture_rpc_connection(torture, &p, &ndr_table_mgmt);
if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
int i;
struct dcerpc_binding_handle *b = p->binding_handle;
int flags = CLI_CRED_NTLM_AUTH;
- if (lp_client_lanman_auth(tctx->lp_ctx)) {
+ if (lpcfg_client_lanman_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(tctx->lp_ctx)) {
+ if (lpcfg_client_ntlmv2_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
struct dcerpc_binding_handle *b = p->binding_handle;
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.domainname = lp_workgroup(tctx->lp_ctx);
+ r.in.domainname = lpcfg_workgroup(tctx->lp_ctx);
r.out.dcname = &dcname;
torture_assert_ntstatus_ok(tctx, dcerpc_netr_GetDcName_r(b, tctx, &r),
const char *dcname = NULL;
struct dcerpc_binding_handle *b = p->binding_handle;
- r.in.domainname = lp_workgroup(tctx->lp_ctx);
+ r.in.domainname = lpcfg_workgroup(tctx->lp_ctx);
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.out.dcname = &dcname;
int i;
struct dcerpc_binding_handle *b = p->binding_handle;
- data.domain = lp_workgroup(tctx->lp_ctx);
+ data.domain = lpcfg_workgroup(tctx->lp_ctx);
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
torture_assert_ntstatus_ok(tctx, status, "LogonControl");
}
- data.domain = lp_workgroup(tctx->lp_ctx);
+ data.domain = lpcfg_workgroup(tctx->lp_ctx);
r.in.function_code = NETLOGON_CONTROL_TC_QUERY;
r.in.data = &data;
torture_assert_ntstatus_ok(tctx, status, "LogonControl");
}
- data.domain = lp_workgroup(tctx->lp_ctx);
+ data.domain = lpcfg_workgroup(tctx->lp_ctx);
r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY;
r.in.data = &data;
int i;
struct dcerpc_binding_handle *b = p->binding_handle;
- data.domain = lp_workgroup(tctx->lp_ctx);
+ data.domain = lpcfg_workgroup(tctx->lp_ctx);
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
torture_assert_ntstatus_ok(tctx, status, "LogonControl");
}
- data.domain = lp_workgroup(tctx->lp_ctx);
+ data.domain = lpcfg_workgroup(tctx->lp_ctx);
r.in.function_code = NETLOGON_CONTROL_TC_QUERY;
r.in.data = &data;
torture_assert_ntstatus_ok(tctx, status, "LogonControl");
}
- data.domain = lp_workgroup(tctx->lp_ctx);
+ data.domain = lpcfg_workgroup(tctx->lp_ctx);
r.in.function_code = NETLOGON_CONTROL_TRANSPORT_NOTIFY;
r.in.data = &data;
struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.domain_name = lp_dnsdomain(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_dnsdomain(tctx->lp_ctx);
r.in.domain_guid = NULL;
r.in.site_guid = NULL;
r.in.flags = DS_RETURN_DNS_NAME;
torture_assert_ntstatus_ok(tctx, status, "DsRGetDCName");
torture_assert_werr_ok(tctx, r.out.result, "DsRGetDCName");
- r.in.domain_name = lp_workgroup(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx);
status = dcerpc_netr_DsRGetDCName_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "DsRGetDCName");
struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.domain_name = lp_dnsdomain(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_dnsdomain(tctx->lp_ctx);
r.in.domain_guid = NULL;
r.in.site_name = NULL;
r.in.flags = DS_RETURN_DNS_NAME;
torture_assert_ntstatus_ok(tctx, status, "netr_DsRGetDCNameEx");
torture_assert_werr_ok(tctx, r.out.result, "netr_DsRGetDCNameEx");
- r.in.domain_name = lp_workgroup(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx);
status = dcerpc_netr_DsRGetDCNameEx_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "netr_DsRGetDCNameEx");
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.client_account = NULL;
r.in.mask = 0x00000000;
- r.in.domain_name = lp_dnsdomain(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_dnsdomain(tctx->lp_ctx);
r.in.domain_guid = NULL;
r.in.site_name = NULL;
r.in.flags = DS_RETURN_DNS_NAME;
torture_assert_ntstatus_ok(tctx, status, "netr_DsRGetDCNameEx2");
torture_assert_werr_ok(tctx, r.out.result, "netr_DsRGetDCNameEx2");
- r.in.domain_name = lp_workgroup(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx);
status = dcerpc_netr_DsRGetDCNameEx2_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "netr_DsRGetDCNameEx2");
ZERO_STRUCT(q1);
q1.dns_hostname = talloc_asprintf(tctx, "%s.%s", TEST_MACHINE_NAME,
- lp_dnsdomain(tctx->lp_ctx));
+ lpcfg_dnsdomain(tctx->lp_ctx));
q1.sitename = "Default-First-Site-Name";
q1.os_version.os = &os;
q1.os_name.string = talloc_asprintf(tctx,
/* Change also the DNS hostname to test differences in behaviour */
talloc_free(discard_const_p(char, q1.dns_hostname));
q1.dns_hostname = talloc_asprintf(tctx, "%s2.%s", TEST_MACHINE_NAME,
- lp_dnsdomain(tctx->lp_ctx));
+ lpcfg_dnsdomain(tctx->lp_ctx));
/* The workstation handles the "servicePrincipalName" and DNS hostname
updates */
/* Change also the DNS hostname to test differences in behaviour */
talloc_free(discard_const_p(char, q1.dns_hostname));
q1.dns_hostname = talloc_asprintf(tctx, "%s2.%s", TEST_MACHINE_NAME,
- lp_dnsdomain(tctx->lp_ctx));
+ lpcfg_dnsdomain(tctx->lp_ctx));
/* Wipe out the osVersion, and prove which values still 'stick' */
q1.os_version.os = NULL;
/* Put the DNS hostname back */
talloc_free(discard_const_p(char, q1.dns_hostname));
q1.dns_hostname = talloc_asprintf(tctx, "%s.%s", TEST_MACHINE_NAME,
- lp_dnsdomain(tctx->lp_ctx));
+ lpcfg_dnsdomain(tctx->lp_ctx));
/* The workstation handles the "servicePrincipalName" and DNS hostname
updates */
ZERO_STRUCT(q1);
q1.dns_hostname = talloc_asprintf(tctx, "%s.%s", TEST_MACHINE_NAME,
- lp_dnsdomain(tctx->lp_ctx));
+ lpcfg_dnsdomain(tctx->lp_ctx));
q1.sitename = "Default-First-Site-Name";
q1.os_name.string = "UNIX/Linux or similar";
torture_assert_ntstatus_ok(tctx, status, "torture_temp_dir failed");
status = gensec_client_start(tctx, &gensec_client_context, tctx->ev,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
torture_assert_ntstatus_ok(tctx, status, "gensec_client_start (client) failed");
status = gensec_set_target_hostname(gensec_client_context, test_machine_name);
torture_assert_ntstatus_ok(tctx, status, "gensec_start_mech_by_sasl_name (client) failed");
status = gensec_server_start(tctx, tctx->ev,
- lp_gensec_settings(tctx, tctx->lp_ctx),
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx),
NULL, &gensec_server_context);
torture_assert_ntstatus_ok(tctx, status, "gensec_server_start (server) failed");
torture_assert_ntstatus_ok(tctx, status, "torture_temp_dir failed");
status = gensec_client_start(tctx, &gensec_client_context, tctx->ev,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
torture_assert_ntstatus_ok(tctx, status, "gensec_client_start (client) failed");
status = gensec_set_target_hostname(gensec_client_context, test_machine_name);
torture_assert_ntstatus_ok(tctx, status, "gensec_start_mech_by_sasl_name (client) failed");
status = gensec_server_start(tctx, tctx->ev,
- lp_gensec_settings(tctx, tctx->lp_ctx),
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx),
NULL, &gensec_server_context);
torture_assert_ntstatus_ok(tctx, status, "gensec_server_start (server) failed");
cli_credentials_set_impersonate_principal(credentials, cli_credentials_get_principal(cmdline_credentials, tmp_ctx));
status = gensec_client_start(tctx, &gensec_client_context, tctx->ev,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
torture_assert_ntstatus_ok(tctx, status, "gensec_client_start (client) failed");
status = gensec_set_target_hostname(gensec_client_context, test_machine_name);
torture_assert_ntstatus_ok(tctx, status, "gensec_start_mech_by_sasl_name (client) failed");
status = gensec_server_start(tctx, tctx->ev,
- lp_gensec_settings(tctx, tctx->lp_ctx),
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx),
NULL, &gensec_server_context);
torture_assert_ntstatus_ok(tctx, status, "gensec_server_start (server) failed");
return false;
}
- lp_smbcli_options(torture->lp_ctx, &options);
- lp_smbcli_session_options(torture->lp_ctx, &session_options);
+ lpcfg_smbcli_options(torture->lp_ctx, &options);
+ lpcfg_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
- lp_smb_ports(torture->lp_ctx),
+ lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL,
- lp_socket_options(torture->lp_ctx),
+ lpcfg_socket_options(torture->lp_ctx),
cmdline_credentials,
- lp_resolve_context(torture->lp_ctx),
+ lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_gensec_settings(torture, torture->lp_ctx));
+ lpcfg_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
torture_comment(torture, "smbcli_full_connection failed: %s\n",
nt_errstr(status));
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = "";
setup.in.credentials = anon_creds;
- setup.in.gensec_settings = lp_gensec_settings(torture, torture->lp_ctx);
+ setup.in.gensec_settings = lpcfg_gensec_settings(torture, torture->lp_ctx);
status = smb_composite_sesssetup(session2, &setup);
if (!NT_STATUS_IS_OK(status)) {
}
status = dcerpc_bind_auth(lsa_pipe, &ndr_table_lsarpc,
- credentials, lp_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), auth_type, auth_level,
+ credentials, lpcfg_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), auth_type, auth_level,
NULL);
if (!NT_STATUS_IS_OK(status)) {
torture_comment(tctx, "dcerpc_bind_auth failed: %s\n", nt_errstr(status));
return false;
}
- lp_smbcli_options(torture->lp_ctx, &options);
- lp_smbcli_session_options(torture->lp_ctx, &session_options);
+ lpcfg_smbcli_options(torture->lp_ctx, &options);
+ lpcfg_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
- lp_smb_ports(torture->lp_ctx),
+ lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL,
- lp_socket_options(torture->lp_ctx),
+ lpcfg_socket_options(torture->lp_ctx),
cmdline_credentials,
- lp_resolve_context(torture->lp_ctx),
+ lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_gensec_settings(torture, torture->lp_ctx));
+ lpcfg_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
torture_comment(torture, "smbcli_full_connection failed: %s\n",
nt_errstr(status));
if (admin_creds != NULL) {
torture_assert_ntstatus_ok(tctx,
dcerpc_bind_auth(samr_pipe, &ndr_table_samr,
- admin_creds, lp_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), auth_type, auth_level,
+ admin_creds, lpcfg_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), auth_type, auth_level,
NULL),
"dcerpc_bind_auth failed");
} else {
#if 1
net_pipe->conn->flags |= (DCERPC_SIGN | DCERPC_SEAL);
status = dcerpc_bind_auth(net_pipe, &ndr_table_netlogon,
- wks_creds, lp_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), DCERPC_AUTH_TYPE_SCHANNEL,
+ wks_creds, lpcfg_gensec_settings(tctx->lp_ctx, tctx->lp_ctx), DCERPC_AUTH_TYPE_SCHANNEL,
DCERPC_AUTH_LEVEL_PRIVACY,
NULL);
#else
goto done;
}
- lp_smbcli_options(torture->lp_ctx, &options);
- lp_smbcli_session_options(torture->lp_ctx, &session_options);
+ lpcfg_smbcli_options(torture->lp_ctx, &options);
+ lpcfg_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
- lp_smb_ports(torture->lp_ctx),
+ lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL,
- lp_socket_options(torture->lp_ctx),
+ lpcfg_socket_options(torture->lp_ctx),
anon_creds,
- lp_resolve_context(torture->lp_ctx),
+ lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_gensec_settings(torture, torture->lp_ctx));
+ lpcfg_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
torture_comment(torture, "smbcli_full_connection failed: %s\n",
nt_errstr(status));
struct smbcli_options options;
struct smbcli_session_options session_options;
- lp_smbcli_options(tctx->lp_ctx, &options);
- lp_smbcli_session_options(tctx->lp_ctx, &session_options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli,
torture_setting_string(tctx, "host", NULL),
- lp_smb_ports(tctx->lp_ctx),
- "IPC$", NULL, lp_socket_options(tctx->lp_ctx),
- smb_creds, lp_resolve_context(tctx->lp_ctx),
+ lpcfg_smb_ports(tctx->lp_ctx),
+ "IPC$", NULL, lpcfg_socket_options(tctx->lp_ctx),
+ smb_creds, lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
torture_assert_ntstatus_ok(tctx, status,
"smbcli_full_connection failed");
return false;
}
- lp_smbcli_options(torture->lp_ctx, &options);
- lp_smbcli_session_options(torture->lp_ctx, &session_options);
+ lpcfg_smbcli_options(torture->lp_ctx, &options);
+ lpcfg_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(
mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
- lp_smb_ports(torture->lp_ctx),
- "IPC$", NULL, lp_socket_options(torture->lp_ctx), cmdline_credentials,
- lp_resolve_context(torture->lp_ctx), torture->ev, &options,
- &session_options, lp_gensec_settings(torture, torture->lp_ctx));
+ lpcfg_smb_ports(torture->lp_ctx),
+ "IPC$", NULL, lpcfg_socket_options(torture->lp_ctx), cmdline_credentials,
+ lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options,
+ &session_options, lpcfg_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
torture_warning(torture, "smbcli_full_connection failed: %s\n",
nt_errstr(status));
status = smbcli_full_connection(
mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
- lp_smb_ports(torture->lp_ctx), "IPC$", NULL,
- lp_socket_options(torture->lp_ctx), anon_creds,
- lp_resolve_context(torture->lp_ctx),
+ lpcfg_smb_ports(torture->lp_ctx), "IPC$", NULL,
+ lpcfg_socket_options(torture->lp_ctx), anon_creds,
+ lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_gensec_settings(torture, torture->lp_ctx));
+ lpcfg_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
torture_warning(torture, "anon smbcli_full_connection failed: %s\n",
nt_errstr(status));
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = "";
setup.in.credentials = user_creds;
- setup.in.gensec_settings = lp_gensec_settings(torture, torture->lp_ctx);
+ setup.in.gensec_settings = lpcfg_gensec_settings(torture, torture->lp_ctx);
status = smb_composite_sesssetup(session2, &setup);
if (!NT_STATUS_IS_OK(status)) {
ZERO_STRUCT(userlevel1);
userlevel1.client = talloc_asprintf(
- torture, "\\\\%s", lp_netbios_name(torture->lp_ctx));
+ torture, "\\\\%s", lpcfg_netbios_name(torture->lp_ctx));
userlevel1.user = cli_credentials_get_username(cmdline_credentials);
userlevel1.build = 2600;
userlevel1.major = 3;
samlogon_state.account_name = account_name;
samlogon_state.account_domain = account_domain;
samlogon_state.password = plain_pass;
- samlogon_state.workgroup = lp_workgroup(tctx->lp_ctx);
- samlogon_state.netbios_name = lp_netbios_name(tctx->lp_ctx);
+ samlogon_state.workgroup = lpcfg_workgroup(tctx->lp_ctx);
+ samlogon_state.netbios_name = lpcfg_netbios_name(tctx->lp_ctx);
samlogon_state.p = p;
samlogon_state.creds = creds;
samlogon_state.expected_error = expected_error;
ld_r.in.connect_handle = &connect_handle;
ld_r.in.domain_name = &domName;
- ld_r.in.domain_name->string = lp_workgroup(torture->lp_ctx);
+ ld_r.in.domain_name->string = lpcfg_workgroup(torture->lp_ctx);
ld_r.out.sid = &domSid;
torture_assert_ntstatus_ok(torture,
return false;
}
- userdomain = torture_setting_string(torture, "userdomain", lp_workgroup(torture->lp_ctx));
+ userdomain = torture_setting_string(torture, "userdomain", lpcfg_workgroup(torture->lp_ctx));
user_ctx = torture_create_testuser(torture,
TEST_USER_NAME,
.username = talloc_asprintf(mem_ctx,
"%s@%s",
TEST_USER_NAME,
- lp_realm(torture->lp_ctx)),
+ lpcfg_realm(torture->lp_ctx)),
.password = user_password,
.network_login = true,
.expected_interactive_error = NT_STATUS_OK,
torture_assert_ntstatus_ok(tctx, dcerpc_schannel_creds(p->conn->security_state.generic_state, tctx, &creds), "");
- if (lp_client_lanman_auth(tctx->lp_ctx)) {
+ if (lpcfg_client_lanman_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(tctx->lp_ctx)) {
+ if (lpcfg_client_ntlmv2_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
ld.in.connect_handle = &ch;
ld.in.domain_name = &dn;
ld.out.sid = &sid;
- dn.string = lp_workgroup(tctx->lp_ctx);
+ dn.string = lpcfg_workgroup(tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupDomain_r(b, tctx, &ld),
"LookupDomain failed");
ld.in.connect_handle = &ch;
ld.in.domain_name = &dn;
ld.out.sid = &sid;
- dn.string = lp_workgroup(tctx->lp_ctx);
+ dn.string = lpcfg_workgroup(tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupDomain_r(b, tctx, &ld),
"LookupDomain failed");
ld.in.connect_handle = &ch;
ld.in.domain_name = &dn;
ld.out.sid = &sid;
- dn.string = lp_workgroup(tctx->lp_ctx);
+ dn.string = lpcfg_workgroup(tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, dcerpc_samr_LookupDomain_r(b, tctx, &ld),
"LookupDomain failed");
if (!NT_STATUS_IS_OK(ld.out.result)) {
}
/* create a test user */
- testuser = torture_create_testuser(tctx, TEST_USER_NAME, lp_workgroup(tctx->lp_ctx),
+ testuser = torture_create_testuser(tctx, TEST_USER_NAME, lpcfg_workgroup(tctx->lp_ctx),
ACB_NORMAL, &testuser_passwd);
if (!testuser) {
printf("Failed to create test user\n");
}
test_credentials = cli_credentials_init(tctx);
cli_credentials_set_workstation(test_credentials, "localhost", CRED_SPECIFIED);
- cli_credentials_set_domain(test_credentials, lp_workgroup(tctx->lp_ctx),
+ cli_credentials_set_domain(test_credentials, lpcfg_workgroup(tctx->lp_ctx),
CRED_SPECIFIED);
cli_credentials_set_username(test_credentials, TEST_USER_NAME, CRED_SPECIFIED);
cli_credentials_set_password(test_credentials, testuser_passwd, CRED_SPECIFIED);
torture_assert(tctx,
test_samr_domain(tctx, b, SEC_FLAG_MAXIMUM_ALLOWED,
- lp_workgroup(tctx->lp_ctx),
+ lpcfg_workgroup(tctx->lp_ctx),
&connect_handle, &domain_handle),
"failed to test domain");
test_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
join_ctx = torture_create_testuser(torture, test_machine_account,
- lp_workgroup(torture->lp_ctx), ACB_SVRTRUST,
+ lpcfg_workgroup(torture->lp_ctx), ACB_SVRTRUST,
&machine_password);
if (!join_ctx) {
talloc_free(mem_ctx);
}
test_wksta_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_WKSTA_MACHINE_NAME);
- join_ctx2 = torture_create_testuser(torture, test_wksta_machine_account, lp_workgroup(torture->lp_ctx), ACB_WSTRUST, &wksta_machine_password);
+ join_ctx2 = torture_create_testuser(torture, test_wksta_machine_account, lpcfg_workgroup(torture->lp_ctx), ACB_WSTRUST, &wksta_machine_password);
if (!join_ctx2) {
talloc_free(mem_ctx);
torture_comment(torture, "Failed to join as member\n");
}
user_ctx = torture_create_testuser(torture, TEST_USER_NAME,
- lp_workgroup(torture->lp_ctx),
+ lpcfg_workgroup(torture->lp_ctx),
ACB_NORMAL, NULL);
if (!user_ctx) {
talloc_free(mem_ctx);
ret, failed,
"samr_Connect failed");
- domain_policy = samsync_open_domain(torture, mem_ctx, samsync_state, lp_workgroup(torture->lp_ctx), NULL);
+ domain_policy = samsync_open_domain(torture, mem_ctx, samsync_state, lpcfg_workgroup(torture->lp_ctx), NULL);
if (!domain_policy) {
torture_comment(torture, "samrsync_open_domain failed\n");
ret = false;
credentials = cli_credentials_init(mem_ctx);
cli_credentials_set_workstation(credentials, TEST_MACHINE_NAME, CRED_SPECIFIED);
- cli_credentials_set_domain(credentials, lp_workgroup(torture->lp_ctx), CRED_SPECIFIED);
+ cli_credentials_set_domain(credentials, lpcfg_workgroup(torture->lp_ctx), CRED_SPECIFIED);
cli_credentials_set_username(credentials, test_machine_account, CRED_SPECIFIED);
cli_credentials_set_password(credentials, machine_password, CRED_SPECIFIED);
cli_credentials_set_secure_channel_type(credentials,
credentials_wksta = cli_credentials_init(mem_ctx);
cli_credentials_set_workstation(credentials_wksta, TEST_WKSTA_MACHINE_NAME, CRED_SPECIFIED);
- cli_credentials_set_domain(credentials_wksta, lp_workgroup(torture->lp_ctx), CRED_SPECIFIED);
+ cli_credentials_set_domain(credentials_wksta, lpcfg_workgroup(torture->lp_ctx), CRED_SPECIFIED);
cli_credentials_set_username(credentials_wksta, test_wksta_machine_account, CRED_SPECIFIED);
cli_credentials_set_password(credentials_wksta, wksta_machine_password, CRED_SPECIFIED);
cli_credentials_set_secure_channel_type(credentials_wksta,
b->endpoint = talloc_strdup(b, l->table->name);
}
- lp_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(torture, b));
+ lpcfg_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(torture, b));
status = torture_rpc_connection(torture, &p, &ndr_table_mgmt);
if (!NT_STATUS_IS_OK(status)) {
int flags = CLI_CRED_NTLM_AUTH;
struct dcerpc_binding_handle *b = p->binding_handle;
- if (lp_client_lanman_auth(tctx->lp_ctx)) {
+ if (lpcfg_client_lanman_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(tctx->lp_ctx)) {
+ if (lpcfg_client_ntlmv2_auth(tctx->lp_ctx)) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
struct policy_handle handle;
struct policy_handle domain_handle;
- name.string = lp_workgroup(tctx->lp_ctx);
+ name.string = lpcfg_workgroup(tctx->lp_ctx);
r.in.domain_name = &name;
r.out.info = &info;
torture_assert_ntstatus_ok(tctx, status, "seconday connection");
status = dcerpc_bind_auth(p_netlogon, &ndr_table_netlogon,
- credentials, lp_gensec_settings(tctx, tctx->lp_ctx),
+ credentials, lpcfg_gensec_settings(tctx, tctx->lp_ctx),
DCERPC_AUTH_TYPE_SCHANNEL,
dcerpc_auth_level(p->conn),
NULL);
torture_assert_ntstatus_ok(tctx, status, "seconday connection");
status = dcerpc_bind_auth(p_lsa, &ndr_table_lsarpc,
- credentials, lp_gensec_settings(tctx, tctx->lp_ctx),
+ credentials, lpcfg_gensec_settings(tctx, tctx->lp_ctx),
DCERPC_AUTH_TYPE_SCHANNEL,
dcerpc_auth_level(p->conn),
NULL);
/* and now setup an SCHANNEL bind on netlogon */
status = dcerpc_bind_auth(p_netlogon2, &ndr_table_netlogon,
- credentials, lp_gensec_settings(tctx, tctx->lp_ctx),
+ credentials, lpcfg_gensec_settings(tctx, tctx->lp_ctx),
DCERPC_AUTH_TYPE_SCHANNEL,
dcerpc_auth_level(p_samr2->conn),
NULL);
user_creds = s->user2_creds;
}
- if (lp_client_lanman_auth(s->tctx->lp_ctx)) {
+ if (lpcfg_client_lanman_auth(s->tctx->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(s->tctx->lp_ctx)) {
+ if (lpcfg_client_ntlmv2_auth(s->tctx->lp_ctx)) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
NTSTATUS status;
struct dcerpc_binding_handle *b;
- lp_set_cmdline(torture->lp_ctx, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False");
- lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False");
- lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:lm_key", settings->lm_key?"True":"False");
+ lpcfg_set_cmdline(torture->lp_ctx, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False");
+ lpcfg_set_cmdline(torture->lp_ctx, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False");
+ lpcfg_set_cmdline(torture->lp_ctx, "ntlmssp_client:lm_key", settings->lm_key?"True":"False");
torture_assert_ntstatus_ok(torture, torture_rpc_binding(torture, &binding),
"Getting bindoptions");
torture_comment(tctx, "Connecting printer driver share '%s' on '%s'\n",
share_name, server_name);
- lp_smbcli_options(tctx->lp_ctx, &smb_options);
- lp_smbcli_session_options(tctx->lp_ctx, &smb_session_options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &smb_options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &smb_session_options);
torture_assert_ntstatus_ok(tctx,
smbcli_full_connection(tctx, cli, server_name,
- lp_smb_ports(tctx->lp_ctx),
+ lpcfg_smb_ports(tctx->lp_ctx),
share_name, NULL,
- lp_socket_options(tctx->lp_ctx),
+ lpcfg_socket_options(tctx->lp_ctx),
cmdline_credentials,
- lp_resolve_context(tctx->lp_ctx),
+ lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev,
&smb_options,
&smb_session_options,
- lp_gensec_settings(tctx, tctx->lp_ctx)),
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx)),
"failed to open driver share");
return true;
test_credentials = cli_credentials_init(tctx);
cli_credentials_set_workstation(test_credentials, "localhost", CRED_SPECIFIED);
- cli_credentials_set_domain(test_credentials, lp_workgroup(tctx->lp_ctx),
+ cli_credentials_set_domain(test_credentials, lpcfg_workgroup(tctx->lp_ctx),
CRED_SPECIFIED);
cli_credentials_set_username(test_credentials, t->user.username, CRED_SPECIFIED);
cli_credentials_set_password(test_credentials, testuser_passwd, CRED_SPECIFIED);
torture_assert_ntstatus_ok(tctx, dcerpc_register_ep_server(&ep_server),
"unable to register spoolss server");
- lp_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss");
+ lpcfg_set_cmdline(tctx->lp_ctx, "dcerpc endpoint servers", "spoolss");
- load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces);
+ load_interfaces(tctx, lpcfg_interfaces(tctx->lp_ctx), &ifaces);
address = iface_n_ip(ifaces, 0);
torture_comment(tctx, "Listening for callbacks on %s\n", address);
u.info21.description.string = talloc_asprintf(join,
"Samba4 torture account created by host %s: %s",
- lp_netbios_name(torture->lp_ctx),
+ lpcfg_netbios_name(torture->lp_ctx),
timestring(join, time(NULL)));
printf("Resetting ACB flags, force pw change time\n");
return NULL;
}
- libnet_ctx = libnet_context_init(tctx->ev, tctx->lp_ctx);
+ libnet_ctx = libnet_context_init(tctx->ev, tctx->lp_ctx);
if (!libnet_ctx) {
talloc_free(tj);
return NULL;
u.info21.description.string = talloc_asprintf(tj,
"Samba4 torture account created by host %s: %s",
- lp_netbios_name(tctx->lp_ctx), timestring(tj, time(NULL)));
+ lpcfg_netbios_name(tctx->lp_ctx), timestring(tj, time(NULL)));
status = dcerpc_samr_SetUserInfo_r(tj->p->binding_handle, tj, &s);
if (!NT_STATUS_IS_OK(status)) {
NTSTATUS status;
struct wkssvc_NetrWkstaUserGetInfo r;
union wkssvc_NetrWkstaUserInfo info;
- const char *dom = lp_workgroup(tctx->lp_ctx);
+ const char *dom = lpcfg_workgroup(tctx->lp_ctx);
struct cli_credentials *creds = cmdline_credentials;
const char *user = cli_credentials_get_username(creds);
int i;
struct wkssvc_NetrLogonDomainNameAdd r;
struct dcerpc_binding_handle *b = p->binding_handle;
- r.in.domain_name = lp_workgroup(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx);
torture_comment(tctx, "Testing NetrLogonDomainNameAdd\n");
struct wkssvc_NetrLogonDomainNameDel r;
struct dcerpc_binding_handle *b = p->binding_handle;
- r.in.domain_name = lp_workgroup(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx);
torture_comment(tctx, "Testing NetrLogonDomainNameDel\n");
for (i=0; i<ARRAY_SIZE(levels); i++) {
r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.name = lp_workgroup(tctx->lp_ctx);
+ r.in.name = lpcfg_workgroup(tctx->lp_ctx);
r.in.Account = NULL;
r.in.Password = NULL;
r.in.name_type = levels[i];
for (i=0; i<ARRAY_SIZE(levels); i++) {
r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.name = lp_workgroup(tctx->lp_ctx);
+ r.in.name = lpcfg_workgroup(tctx->lp_ctx);
r.in.Account = NULL;
r.in.EncryptedPassword = NULL;
r.in.name_type = levels[i];
struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_name = dcerpc_server_name(p);
- r.in.domain_name = lp_workgroup(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx);
r.in.Account = NULL;
r.in.unknown = NULL;
r.in.num_ous = r.out.num_ous = &num_ous;
struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_name = dcerpc_server_name(p);
- r.in.domain_name = lp_workgroup(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_workgroup(tctx->lp_ctx);
r.in.Account = NULL;
r.in.EncryptedPassword = NULL;
r.in.num_ous = r.out.num_ous = &num_ous;
struct dcerpc_binding_handle *b = p->binding_handle;
admin_account = talloc_asprintf(tctx, "%s\\%s",
- lp_workgroup(tctx->lp_ctx),
+ lpcfg_workgroup(tctx->lp_ctx),
user);
r.in.server_name = dcerpc_server_name(p);
struct dcerpc_binding_handle *b = p->binding_handle;
admin_account = talloc_asprintf(tctx, "%s\\%s",
- lp_workgroup(tctx->lp_ctx),
+ lpcfg_workgroup(tctx->lp_ctx),
user);
r.in.server_name = dcerpc_server_name(p);
- r.in.domain_name = lp_dnsdomain(tctx->lp_ctx);
+ r.in.domain_name = lpcfg_dnsdomain(tctx->lp_ctx);
r.in.account_ou = NULL;
r.in.Account = admin_account;
r.in.password = NULL;
switch (argc) {
case 0:
- lp_dump(tctx->lp_ctx, stdout,
+ lpcfg_dump(tctx->lp_ctx, stdout,
false /* show_defaults */,
0 /* skip services */);
break;
case 2:
name = talloc_asprintf(NULL, "torture:%s", argv[0]);
- lp_set_cmdline(tctx->lp_ctx, name, argv[1]);
+ lpcfg_set_cmdline(tctx->lp_ctx, name, argv[1]);
talloc_free(name);
break;
struct cli_credentials *credentials = cmdline_credentials;
struct smbcli_options options;
- lp_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
options.use_level2_oplocks = false;
status = smb2_connect(tctx, host,
- lp_smb_ports(tctx->lp_ctx), share,
- lp_resolve_context(tctx->lp_ctx),
+ lpcfg_smb_ports(tctx->lp_ctx), share,
+ lpcfg_resolve_context(tctx->lp_ctx),
credentials, tree, tctx->ev, &options,
- lp_socket_options(tctx->lp_ctx),
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_socket_options(tctx->lp_ctx),
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
torture_comment(tctx, "Failed to connect to SMB2 share "
"\\\\%s\\%s - %s\n", host, share,
struct smb2_request *req;
struct smbcli_options options;
- lp_smbcli_options(torture->lp_ctx, &options);
+ lpcfg_smbcli_options(torture->lp_ctx, &options);
status = smb2_connect(mem_ctx, host,
- lp_smb_ports(torture->lp_ctx),
+ lpcfg_smb_ports(torture->lp_ctx),
share,
- lp_resolve_context(torture->lp_ctx),
+ lpcfg_resolve_context(torture->lp_ctx),
credentials, &tree, torture->ev, &options,
- lp_socket_options(torture->lp_ctx),
- lp_gensec_settings(torture, torture->lp_ctx));
+ lpcfg_socket_options(torture->lp_ctx),
+ lpcfg_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("Connection failed - %s\n", nt_errstr(status));
return false;
if (!smb2_request_receive(req)) {
talloc_free(tree);
status = smb2_connect(mem_ctx, host,
- lp_smb_ports(torture->lp_ctx),
+ lpcfg_smb_ports(torture->lp_ctx),
share,
- lp_resolve_context(torture->lp_ctx),
+ lpcfg_resolve_context(torture->lp_ctx),
credentials, &tree, torture->ev, &options,
- lp_socket_options(torture->lp_ctx),
- lp_gensec_settings(mem_ctx, torture->lp_ctx));
+ lpcfg_socket_options(torture->lp_ctx),
+ lpcfg_gensec_settings(mem_ctx, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("Connection failed - %s\n", nt_errstr(status));
return false;
struct cli_credentials *credentials = cmdline_credentials;
struct smbcli_options options;
- lp_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
status = smb2_connect(tctx, host,
- lp_smb_ports(tctx->lp_ctx),
+ lpcfg_smb_ports(tctx->lp_ctx),
share,
- lp_resolve_context(tctx->lp_ctx),
+ lpcfg_resolve_context(tctx->lp_ctx),
credentials, tree,
tctx->ev, &options,
- lp_socket_options(tctx->lp_ctx),
- lp_gensec_settings(tctx, tctx->lp_ctx)
+ lpcfg_socket_options(tctx->lp_ctx),
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx)
);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to SMB2 share \\\\%s\\%s - %s\n",
}
}
- cd = smb_iconv_open_ex(tctx, to, from, lp_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
+ cd = smb_iconv_open_ex(tctx, to, from, lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true));
if((int)cd == -1) {
DEBUG(0,("unable to find from or to encoding, exiting...\n"));
if (out != stdout) fclose(out);
d_printf("Invalid option: %s is not a valid torture target (share or binding string)\n\n", target);
return false;
}
- lp_set_cmdline(lp_ctx, "torture:host", binding_struct->host);
- if (lp_parm_string(lp_ctx, NULL, "torture", "share") == NULL)
- lp_set_cmdline(lp_ctx, "torture:share", "IPC$");
- lp_set_cmdline(lp_ctx, "torture:binding", target);
+ lpcfg_set_cmdline(lp_ctx, "torture:host", binding_struct->host);
+ if (lpcfg_parm_string(lp_ctx, NULL, "torture", "share") == NULL)
+ lpcfg_set_cmdline(lp_ctx, "torture:share", "IPC$");
+ lpcfg_set_cmdline(lp_ctx, "torture:binding", target);
} else {
- lp_set_cmdline(lp_ctx, "torture:host", host);
- lp_set_cmdline(lp_ctx, "torture:share", share);
- lp_set_cmdline(lp_ctx, "torture:binding", host);
+ lpcfg_set_cmdline(lp_ctx, "torture:host", host);
+ lpcfg_set_cmdline(lp_ctx, "torture:share", share);
+ lpcfg_set_cmdline(lp_ctx, "torture:binding", host);
}
return true;
/* retrievieng the userdn */
p = strchr_m(dns, '#');
if (!p) {
- lp_set_cmdline(lp_ctx, "torture:ldap_userdn", "");
- lp_set_cmdline(lp_ctx, "torture:ldap_basedn", "");
- lp_set_cmdline(lp_ctx, "torture:ldap_secret", "");
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_userdn", "");
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", "");
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", "");
return;
}
userdn = strndup(dns, p - dns);
- lp_set_cmdline(lp_ctx, "torture:ldap_userdn", userdn);
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_userdn", userdn);
/* retrieve the basedn */
d = p + 1;
p = strchr_m(d, '#');
if (!p) {
- lp_set_cmdline(lp_ctx, "torture:ldap_basedn", "");
- lp_set_cmdline(lp_ctx, "torture:ldap_secret", "");
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", "");
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", "");
return;
}
basedn = strndup(d, p - d);
- lp_set_cmdline(lp_ctx, "torture:ldap_basedn", basedn);
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", basedn);
/* retrieve the secret */
p = p + 1;
if (!p) {
- lp_set_cmdline(lp_ctx, "torture:ldap_secret", "");
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", "");
return;
}
secret = strdup(p);
- lp_set_cmdline(lp_ctx, "torture:ldap_secret", secret);
+ lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", secret);
printf ("%s - %s - %s\n", userdn, basedn, secret);
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
case OPT_LOADFILE:
- lp_set_cmdline(cmdline_lp_ctx, "torture:loadfile", poptGetOptArg(pc));
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:loadfile", poptGetOptArg(pc));
break;
case OPT_UNCLIST:
- lp_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
break;
case OPT_TIMELIMIT:
- lp_set_cmdline(cmdline_lp_ctx, "torture:timelimit", poptGetOptArg(pc));
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:timelimit", poptGetOptArg(pc));
break;
case OPT_NUMPROGS:
- lp_set_cmdline(cmdline_lp_ctx, "torture:nprocs", poptGetOptArg(pc));
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:nprocs", poptGetOptArg(pc));
break;
case OPT_DNS:
parse_dns(cmdline_lp_ctx, poptGetOptArg(pc));
break;
case OPT_DANGEROUS:
- lp_set_cmdline(cmdline_lp_ctx, "torture:dangerous", "Yes");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:dangerous", "Yes");
break;
case OPT_ASYNC:
- lp_set_cmdline(cmdline_lp_ctx, "torture:async", "Yes");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:async", "Yes");
break;
case OPT_SMB_PORTS:
- lp_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc));
+ lpcfg_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc));
break;
case OPT_EXTRA_USER:
{
char *option = talloc_asprintf(NULL, "torture:extra_user%u",
++num_extra_users);
const char *value = poptGetOptArg(pc);
- lp_set_cmdline(cmdline_lp_ctx, option, value);
+ lpcfg_set_cmdline(cmdline_lp_ctx, option, value);
talloc_free(option);
}
break;
}
if (strcmp(target, "samba3") == 0) {
- lp_set_cmdline(cmdline_lp_ctx, "torture:samba3", "true");
- lp_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba3", "true");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
} else if (strcmp(target, "samba4") == 0) {
- lp_set_cmdline(cmdline_lp_ctx, "torture:samba4", "true");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba4", "true");
} else if (strcmp(target, "winxp") == 0) {
- lp_set_cmdline(cmdline_lp_ctx, "torture:winxp", "true");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:winxp", "true");
} else if (strcmp(target, "w2k3") == 0) {
- lp_set_cmdline(cmdline_lp_ctx, "torture:w2k3", "true");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k3", "true");
} else if (strcmp(target, "w2k8") == 0) {
- lp_set_cmdline(cmdline_lp_ctx, "torture:w2k8", "true");
- lp_set_cmdline(cmdline_lp_ctx,
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k8", "true");
+ lpcfg_set_cmdline(cmdline_lp_ctx,
"torture:invalid_lock_range_support", "false");
} else if (strcmp(target, "win7") == 0) {
- lp_set_cmdline(cmdline_lp_ctx, "torture:win7", "true");
- lp_set_cmdline(cmdline_lp_ctx, "torture:cn_max_buffer_size",
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:win7", "true");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:cn_max_buffer_size",
"0x00010000");
- lp_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false");
/* RAW-SEARCH for fails for inexplicable reasons against win7 */
- lp_set_cmdline(cmdline_lp_ctx, "torture:search_ea_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:search_ea_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:hide_on_access_denied",
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:hide_on_access_denied",
"true");
} else if (strcmp(target, "onefs") == 0) {
- lp_set_cmdline(cmdline_lp_ctx, "torture:onefs", "true");
- lp_set_cmdline(cmdline_lp_ctx, "torture:openx_deny_dos_support",
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:onefs", "true");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:openx_deny_dos_support",
"false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:range_not_locked_on_file_close", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:sacl_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:ea_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:smbexit_pdu_support",
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:range_not_locked_on_file_close", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:sacl_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:ea_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:smbexit_pdu_support",
"false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:smblock_pdu_support",
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:smblock_pdu_support",
"false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:2_step_break_to_none",
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:2_step_break_to_none",
"true");
- lp_set_cmdline(cmdline_lp_ctx, "torture:deny_dos_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:deny_fcb_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:read_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:writeclose_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:raw_search_search", "false");
- lp_set_cmdline(cmdline_lp_ctx, "torture:search_ea_size", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:deny_dos_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:deny_fcb_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:read_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:writeclose_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:raw_search_search", "false");
+ lpcfg_set_cmdline(cmdline_lp_ctx, "torture:search_ea_size", "false");
}
if (max_runtime) {
struct smbcli_options options;
struct smbcli_session_options session_options;
- lp_smbcli_options(tctx->lp_ctx, &options);
- lp_smbcli_session_options(tctx->lp_ctx, &session_options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli, host,
- lp_smb_ports(tctx->lp_ctx),
- share, NULL, lp_socket_options(tctx->lp_ctx),
+ lpcfg_smb_ports(tctx->lp_ctx),
+ share, NULL, lpcfg_socket_options(tctx->lp_ctx),
cmdline_credentials,
- lp_resolve_context(tctx->lp_ctx),
+ lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
struct smbcli_options options;
struct smbcli_session_options session_options;
- lp_smbcli_options(tctx->lp_ctx, &options);
- lp_smbcli_session_options(tctx->lp_ctx, &session_options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli, host,
- lp_smb_ports(tctx->lp_ctx),
- share, NULL, lp_socket_options(tctx->lp_ctx),
- creds, lp_resolve_context(tctx->lp_ctx),
+ lpcfg_smb_ports(tctx->lp_ctx),
+ share, NULL, lpcfg_socket_options(tctx->lp_ctx),
+ creds, lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
struct smbcli_options options;
struct smbcli_session_options session_options;
- lp_smbcli_options(tctx->lp_ctx, &options);
- lp_smbcli_session_options(tctx->lp_ctx, &session_options);
+ lpcfg_smbcli_options(tctx->lp_ctx, &options);
+ lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options);
options.use_oplocks = torture_setting_bool(tctx, "use_oplocks", true);
options.use_level2_oplocks = torture_setting_bool(tctx, "use_level2_oplocks", true);
status = smbcli_full_connection(mem_ctx, c, hostname,
- lp_smb_ports(tctx->lp_ctx),
+ lpcfg_smb_ports(tctx->lp_ctx),
sharename, NULL,
- lp_socket_options(tctx->lp_ctx),
+ lpcfg_socket_options(tctx->lp_ctx),
cmdline_credentials,
- lp_resolve_context(tctx->lp_ctx),
+ lpcfg_resolve_context(tctx->lp_ctx),
ev, &options, &session_options,
- lp_gensec_settings(tctx, tctx->lp_ctx));
+ lpcfg_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return false;
printf("asprintf failed\n");
return -1;
}
- lp_set_cmdline(tctx->lp_ctx, "netbios name", myname);
+ lpcfg_set_cmdline(tctx->lp_ctx, "netbios name", myname);
free(myname);
separator = torture_setting_string(torture,
"winbindd_separator",
- lp_winbind_separator(torture->lp_ctx));
+ lpcfg_winbind_separator(torture->lp_ctx));
torture_assert_int_equal(torture,
rep.data.info.winbind_separator,
expected = torture_setting_string(torture,
"winbindd_netbios_name",
- lp_netbios_name(torture->lp_ctx));
+ lpcfg_netbios_name(torture->lp_ctx));
expected = strupper_talloc(torture, expected);
torture_assert_str_equal(torture,
expected = torture_setting_string(torture,
"winbindd_netbios_domain",
- lp_workgroup(torture->lp_ctx));
+ lpcfg_workgroup(torture->lp_ctx));
get_winbind_domain(torture, &domain);
bool strict = torture_setting_bool(torture, "strict mode", false);
const char *domain_name = torture_setting_string(torture,
"winbindd_netbios_domain",
- lp_workgroup(torture->lp_ctx));
+ lpcfg_workgroup(torture->lp_ctx));
struct torture_trust_domain *listd = NULL;
uint32_t i, count = 0;
char *name;
const char *domain_name = torture_setting_string(torture,
"winbindd_netbios_domain",
- lp_workgroup(torture->lp_ctx));
+ lpcfg_workgroup(torture->lp_ctx));
ZERO_STRUCT(req);
ZERO_STRUCT(rep);
* user, needed for a token */
status = authsam_make_server_info(gp_ctx,
gp_ctx->ldb_ctx,
- lp_netbios_name(gp_ctx->lp_ctx),
- lp_sam_name(gp_ctx->lp_ctx),
+ lpcfg_netbios_name(gp_ctx->lp_ctx),
+ lpcfg_sam_name(gp_ctx->lp_ctx),
ldb_get_default_basedn(gp_ctx->ldb_ctx),
result->msgs[0],
dummy,
return -1;
}
/* prepare parameters for the join */
- r->in.netbios_name = lp_netbios_name(ctx->lp_ctx);
+ r->in.netbios_name = lpcfg_netbios_name(ctx->lp_ctx);
r->in.domain_name = domain_name;
r->in.join_type = secure_channel_type;
r->in.level = LIBNET_JOIN_AUTOMATIC;
nt_status = ntlm_password_check(mem_ctx,
- lp_lanman_auth(lp_ctx),
- lp_ntlm_auth(lp_ctx),
+ lpcfg_lanman_auth(lp_ctx),
+ lpcfg_ntlm_auth(lp_ctx),
MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT |
MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT,
challenge,
if (NT_STATUS_IS_OK(nt_status)) {
if (unix_name) {
if (asprintf(unix_name, "%s%c%s", domain,
- *lp_winbind_separator(lp_ctx),
+ *lpcfg_winbind_separator(lp_ctx),
username) < 0) {
nt_status = NT_STATUS_NO_MEMORY;
}
/* setup the client side */
nt_status = gensec_client_start(NULL, &state->gensec_state, ev,
- lp_gensec_settings(NULL, lp_ctx));
+ lpcfg_gensec_settings(NULL, lp_ctx));
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(mem_ctx);
exit(1);
const char *winbind_method[] = { "winbind", NULL };
struct auth_context *auth_context;
- msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx), ev);
+ msg = messaging_client_init(state, lpcfg_messaging_path(state, lp_ctx), ev);
if (!msg) {
talloc_free(mem_ctx);
exit(1);
}
if (!NT_STATUS_IS_OK(gensec_server_start(state, ev,
- lp_gensec_settings(state, lp_ctx),
+ lpcfg_gensec_settings(state, lp_ctx),
auth_context, &state->gensec_state))) {
talloc_free(mem_ctx);
exit(1);
reply_code = "AF";
reply_arg = talloc_asprintf(state->gensec_state,
"%s%s%s", session_info->server_info->domain_name,
- lp_winbind_separator(lp_ctx), session_info->server_info->account_name);
+ lpcfg_winbind_separator(lp_ctx), session_info->server_info->account_name);
talloc_free(session_info);
}
} else if (state->gensec_state->gensec_role == GENSEC_CLIENT) {
} else if (plaintext_password) {
/* handle this request as plaintext */
if (!full_username) {
- if (asprintf(&full_username, "%s%c%s", domain, *lp_winbind_separator(lp_ctx), username) < 0) {
+ if (asprintf(&full_username, "%s%c%s", domain, *lpcfg_winbind_separator(lp_ctx), username) < 0) {
mux_printf(mux_id, "Error: Out of memory in asprintf!\n.\n");
return;
}
SAFE_FREE(domain);
if (!parse_ntlm_auth_domain_user(full_username, &username,
&domain,
- *lp_winbind_separator(lp_ctx))) {
+ *lpcfg_winbind_separator(lp_ctx))) {
/* username might be 'tainted', don't print into our new-line deleimianted stream */
mux_printf(mux_id, "Error: Could not parse into domain and username\n");
}
}
if (!domain) {
- domain = smb_xstrdup(lp_workgroup(lp_ctx));
+ domain = smb_xstrdup(lpcfg_workgroup(lp_ctx));
}
if (ntlm_server_1_lm_session_key)
local_pw_check_specified(lp_ctx,
username,
domain,
- lp_netbios_name(lp_ctx),
+ lpcfg_netbios_name(lp_ctx),
&challenge,
&lm_response,
&nt_response,
}
}
-static void manage_squid_request(struct loadparm_context *lp_ctx, enum stdio_helper_mode helper_mode,
+static void manage_squid_request(struct loadparm_context *lp_ctx, enum stdio_helper_mode helper_mode,
stdio_helper_function fn, void **private2)
{
char *buf;
talloc_free(buf);
}
-static void squid_stream(struct loadparm_context *lp_ctx,
+static void squid_stream(struct loadparm_context *lp_ctx,
enum stdio_helper_mode stdio_mode,
stdio_helper_function fn) {
/* initialize FDescs */
gensec_init(cmdline_lp_ctx);
if (opt_domain == NULL) {
- opt_domain = lp_workgroup(cmdline_lp_ctx);
+ opt_domain = lpcfg_workgroup(cmdline_lp_ctx);
}
if (helper_protocol) {
}
if (opt_workstation == NULL) {
- opt_workstation = lp_netbios_name(cmdline_lp_ctx);
+ opt_workstation = lpcfg_netbios_name(cmdline_lp_ctx);
}
if (!opt_password) {
char *user;
if (asprintf(&user, "%s%c%s", opt_domain,
- *lp_winbind_separator(cmdline_lp_ctx),
+ *lpcfg_winbind_separator(cmdline_lp_ctx),
opt_username) < 0) {
return 1;
}
static void websrv_task_init(struct task_server *task)
{
NTSTATUS status;
- uint16_t port = lp_web_port(task->lp_ctx);
+ uint16_t port = lpcfg_web_port(task->lp_ctx);
const struct model_ops *model_ops;
struct web_server_data *wdata;
model_ops = process_model_startup(task->event_ctx, "single");
if (!model_ops) 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)) {
int num_interfaces;
int i;
struct interface *ifaces;
- load_interfaces(NULL, lp_interfaces(task->lp_ctx), &ifaces);
+ load_interfaces(NULL, lpcfg_interfaces(task->lp_ctx), &ifaces);
num_interfaces = iface_count(ifaces);
for(i = 0; i < num_interfaces; i++) {
const char *address = iface_n_ip(ifaces, i);
status = stream_setup_socket(task->event_ctx,
- task->lp_ctx, model_ops,
+ task->lp_ctx, model_ops,
&web_stream_ops,
"ipv4", address,
- &port, lp_socket_options(task->lp_ctx),
+ &port, lpcfg_socket_options(task->lp_ctx),
task);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
} else {
status = stream_setup_socket(task->event_ctx, task->lp_ctx,
model_ops, &web_stream_ops,
- "ipv4", lp_socket_address(task->lp_ctx),
- &port, lp_socket_options(task->lp_ctx), task);
+ "ipv4", lpcfg_socket_address(task->lp_ctx),
+ &port, lpcfg_socket_options(task->lp_ctx), task);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
idmap_ctx->lp_ctx = lp_ctx;
idmap_ctx->ldb_ctx = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx,
- lp_idmap_url(lp_ctx),
+ lpcfg_idmap_url(lp_ctx),
system_session(lp_ctx),
NULL, 0);
if (idmap_ctx->ldb_ctx == NULL) {
*
* If no mapping exists, a new mapping will be created.
*
- * \todo Check if SIDs can be resolved if lp_idmap_trusted_only() == true
+ * \todo Check if SIDs can be resolved if lpcfg_idmap_trusted_only() == true
* \todo Fix backwards compatibility for Samba3
*
* \param idmap_ctx idmap context to use
goto failed;
}
- /*FIXME: if lp_idmap_trusted_only() == true, check if SID can be
+ /*FIXME: if lpcfg_idmap_trusted_only() == true, check if SID can be
* resolved here. */
ret = idmap_get_bounds(idmap_ctx, &low, &high);
WBSRV_SAMBA3_SET_STRING(pw->pw_passwd, "*");
WBSRV_SAMBA3_SET_STRING(pw->pw_gecos, user_info->out.full_name);
WBSRV_SAMBA3_SET_STRING(pw->pw_dir,
- lp_template_homedir(state->service->task->lp_ctx));
+ lpcfg_template_homedir(state->service->task->lp_ctx));
all_string_sub(pw->pw_dir, "%WORKGROUP%", state->workgroup_name,
sizeof(fstring) - 1);
all_string_sub(pw->pw_dir, "%ACCOUNTNAME%", user_info->out.account_name,
sizeof(fstring) - 1);
WBSRV_SAMBA3_SET_STRING(pw->pw_shell,
- lp_template_shell(state->service->task->lp_ctx));
+ lpcfg_template_shell(state->service->task->lp_ctx));
state->group_sid = dom_sid_dup(state, user_info->out.primary_group_sid);
if(composite_nomem(state->group_sid, state->ctx)) return;
WBSRV_SAMBA3_SET_STRING(pw->pw_passwd, "*");
WBSRV_SAMBA3_SET_STRING(pw->pw_gecos, user_info->out.full_name);
WBSRV_SAMBA3_SET_STRING(pw->pw_dir,
- lp_template_homedir(state->service->task->lp_ctx));
+ lpcfg_template_homedir(state->service->task->lp_ctx));
all_string_sub(pw->pw_dir, "%WORKGROUP%", state->workgroup,
sizeof(fstring) - 1);
all_string_sub(pw->pw_dir, "%ACCOUNTNAME%", user_info->out.account_name,
sizeof(fstring) - 1);
WBSRV_SAMBA3_SET_STRING(pw->pw_shell,
- lp_template_shell(state->service->task->lp_ctx));
+ lpcfg_template_shell(state->service->task->lp_ctx));
pw->pw_uid = state->uid;
dom_sid = dom_sid_dup(mem_ctx, sid);
if (dom_sid == NULL) goto failed;
- ctx = finddcs_send(mem_ctx, lp_netbios_name(service->task->lp_ctx),
- lp_nbt_port(service->task->lp_ctx),
+ ctx = finddcs_send(mem_ctx, lpcfg_netbios_name(service->task->lp_ctx),
+ lpcfg_nbt_port(service->task->lp_ctx),
domain_name, NBT_NAME_LOGON,
dom_sid,
- lp_resolve_context(service->task->lp_ctx),
+ lpcfg_resolve_context(service->task->lp_ctx),
service->task->event_ctx,
service->task->msg_ctx);
if (ctx == NULL) goto failed;
if (*state->info->dcs[0].name == '\\') state->info->dcs[0].name++;
make_nbt_name(&name, state->info->dcs[0].name, 0x20);
- ctx = resolve_name_send(lp_resolve_context(state->service->task->lp_ctx), state,
+ ctx = resolve_name_send(lpcfg_resolve_context(state->service->task->lp_ctx), state,
&name, state->service->task->event_ctx);
composite_continue(state->ctx, ctx, trusted_dom_info_recv_dcaddr,
state->domain->netlogon_pipe = NULL;
if ((!cli_credentials_is_anonymous(state->domain->libnet_ctx->cred)) &&
- ((lp_server_role(service->task->lp_ctx) == ROLE_DOMAIN_MEMBER) ||
- (lp_server_role(service->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER)) &&
+ ((lpcfg_server_role(service->task->lp_ctx) == ROLE_DOMAIN_MEMBER) ||
+ (lpcfg_server_role(service->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER)) &&
(dom_sid_equal(state->domain->info->sid,
state->service->primary_sid))) {
state->domain->netlogon_binding->flags |= DCERPC_SCHANNEL;
/* For debugging, it can be a real pain if all the traffic is encrypted */
- if (lp_winbind_sealed_pipes(service->task->lp_ctx)) {
+ if (lpcfg_winbind_sealed_pipes(service->task->lp_ctx)) {
state->domain->netlogon_binding->flags |= (DCERPC_SIGN | DCERPC_SEAL );
} else {
state->domain->netlogon_binding->flags |= (DCERPC_SIGN);
state->domain->lsa_binding = init_domain_binding(state, &ndr_table_lsarpc);
/* For debugging, it can be a real pain if all the traffic is encrypted */
- if (lp_winbind_sealed_pipes(state->service->task->lp_ctx)) {
+ if (lpcfg_winbind_sealed_pipes(state->service->task->lp_ctx)) {
state->domain->lsa_binding->flags |= (DCERPC_SIGN | DCERPC_SEAL );
} else {
state->domain->lsa_binding->flags |= (DCERPC_SIGN);
state->unix_username = talloc_asprintf(state, "%s%s%s",
state->domain_name,
- lp_winbind_separator(state->lp_ctx),
+ lpcfg_winbind_separator(state->lp_ctx),
state->user_name);
if (composite_nomem(state->unix_username, state->ctx)) return;
const char *user, *domain;
DATA_BLOB chal, nt_resp, lm_resp, names_blob;
int flags = CLI_CRED_NTLM_AUTH;
- if (lp_client_lanman_auth(service->task->lp_ctx)) {
+ if (lpcfg_client_lanman_auth(service->task->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(service->task->lp_ctx)) {
+ if (lpcfg_client_ntlmv2_auth(service->task->lp_ctx)) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
NTSTATUS wbsrv_samba3_info(struct wbsrv_samba3_call *s3call)
{
s3call->response->result = WINBINDD_OK;
- s3call->response->data.info.winbind_separator = *lp_winbind_separator(s3call->wbconn->lp_ctx);
+ s3call->response->data.info.winbind_separator = *lpcfg_winbind_separator(s3call->wbconn->lp_ctx);
WBSRV_SAMBA3_SET_STRING(s3call->response->data.info.samba_version,
SAMBA_VERSION_STRING);
return NT_STATUS_OK;
{
s3call->response->result = WINBINDD_OK;
WBSRV_SAMBA3_SET_STRING(s3call->response->data.domain_name,
- lp_workgroup(s3call->wbconn->lp_ctx));
+ lpcfg_workgroup(s3call->wbconn->lp_ctx));
return NT_STATUS_OK;
}
{
s3call->response->result = WINBINDD_OK;
WBSRV_SAMBA3_SET_STRING(s3call->response->data.netbios_name,
- lp_netbios_name(s3call->wbconn->lp_ctx));
+ lpcfg_netbios_name(s3call->wbconn->lp_ctx));
return NT_STATUS_OK;
}
NTSTATUS wbsrv_samba3_priv_pipe_dir(struct wbsrv_samba3_call *s3call)
{
struct loadparm_context *lp_ctx = s3call->wbconn->listen_socket->service->task->lp_ctx;
- const char *priv_socket_dir = lp_winbindd_privileged_socket_directory(lp_ctx);
+ const char *priv_socket_dir = lpcfg_winbindd_privileged_socket_directory(lp_ctx);
s3call->response->result = WINBINDD_OK;
s3call->response->extra_data.data = discard_const(priv_socket_dir);
}
/* Make sure the directory for the Samba3 socket exists, and is of the correct permissions */
- if (!directory_create_or_exist(lp_winbindd_socket_directory(task->lp_ctx), geteuid(), 0755)) {
+ if (!directory_create_or_exist(lpcfg_winbindd_socket_directory(task->lp_ctx), geteuid(), 0755)) {
task_server_terminate(task,
"Cannot create winbindd pipe directory", true);
return;
}
/* Make sure the directory for the Samba3 socket exists, and is of the correct permissions */
- if (!directory_create_or_exist(lp_winbindd_privileged_socket_directory(task->lp_ctx), geteuid(), 0750)) {
+ if (!directory_create_or_exist(lpcfg_winbindd_privileged_socket_directory(task->lp_ctx), geteuid(), 0750)) {
task_server_terminate(task,
"Cannot create winbindd privileged pipe directory", true);
return;
/* Find the primary SID, depending if we are a standalone
* server (what good is winbind in this case, but anyway...),
* or are in a domain as a member or a DC */
- switch (lp_server_role(service->task->lp_ctx)) {
+ switch (lpcfg_server_role(service->task->lp_ctx)) {
case ROLE_STANDALONE:
primary_sid = secrets_get_domain_sid(service,
service->task->event_ctx,
service->task->lp_ctx,
- lp_netbios_name(service->task->lp_ctx), &errstring);
+ lpcfg_netbios_name(service->task->lp_ctx), &errstring);
if (!primary_sid) {
char *message = talloc_asprintf(task,
"Cannot start Winbind (standalone configuration): %s: "
"Have you provisioned this server (%s) or changed it's name?",
- errstring, lp_netbios_name(service->task->lp_ctx));
+ errstring, lpcfg_netbios_name(service->task->lp_ctx));
task_server_terminate(task, message, true);
return;
}
primary_sid = secrets_get_domain_sid(service,
service->task->event_ctx,
service->task->lp_ctx,
- lp_workgroup(service->task->lp_ctx), &errstring);
+ lpcfg_workgroup(service->task->lp_ctx), &errstring);
if (!primary_sid) {
char *message = talloc_asprintf(task, "Cannot start Winbind (domain member): %s: "
"Have you joined the %s domain?",
- errstring, lp_workgroup(service->task->lp_ctx));
+ errstring, lpcfg_workgroup(service->task->lp_ctx));
task_server_terminate(task, message, true);
return;
}
primary_sid = secrets_get_domain_sid(service,
service->task->event_ctx,
service->task->lp_ctx,
- lp_workgroup(service->task->lp_ctx), &errstring);
+ lpcfg_workgroup(service->task->lp_ctx), &errstring);
if (!primary_sid) {
char *message = talloc_asprintf(task, "Cannot start Winbind (domain controller): %s: "
"Have you provisioned the %s domain?",
- errstring, lp_workgroup(service->task->lp_ctx));
+ errstring, lpcfg_workgroup(service->task->lp_ctx));
task_server_terminate(task, message, true);
return;
}
return;
}
- service->priv_pipe_dir = lp_winbindd_privileged_socket_directory(task->lp_ctx);
- service->pipe_dir = lp_winbindd_socket_directory(task->lp_ctx);
+ service->priv_pipe_dir = lpcfg_winbindd_privileged_socket_directory(task->lp_ctx);
+ service->pipe_dir = lpcfg_winbindd_socket_directory(task->lp_ctx);
/* setup the unprivileged samba3 socket */
listen_socket = talloc(service, struct wbsrv_listen_socket);
status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops,
&wbsrv_ops, "unix",
listen_socket->socket_path, &port,
- lp_socket_options(task->lp_ctx),
+ lpcfg_socket_options(task->lp_ctx),
listen_socket);
if (!NT_STATUS_IS_OK(status)) goto listen_failed;
status = stream_setup_socket(task->event_ctx, task->lp_ctx, model_ops,
&wbsrv_ops, "unix",
listen_socket->socket_path, &port,
- lp_socket_options(task->lp_ctx),
+ lpcfg_socket_options(task->lp_ctx),
listen_socket);
if (!NT_STATUS_IS_OK(status)) goto listen_failed;
if (dom_sid_equal(service->primary_sid, sid) ||
dom_sid_in_domain(service->primary_sid, sid)) {
- ctx = wb_get_dom_info_send(state, service, lp_workgroup(service->task->lp_ctx),
+ ctx = wb_get_dom_info_send(state, service, lpcfg_workgroup(service->task->lp_ctx),
service->primary_sid);
if (ctx == NULL) goto failed;
ctx->async.fn = sid2domain_recv_dom_info;
const char *domuser,
char **domain, char **user)
{
- char *p = strchr(domuser, *lp_winbind_separator(lp_ctx));
+ char *p = strchr(domuser, *lpcfg_winbind_separator(lp_ctx));
if (p == NULL) {
- *domain = talloc_strdup(mem_ctx, lp_workgroup(lp_ctx));
+ *domain = talloc_strdup(mem_ctx, lpcfg_workgroup(lp_ctx));
} else {
*domain = talloc_strndup(mem_ctx, domuser,
PTR_DIFF(p, domuser));
bool changed_old_addrs = false;
bool skip_replica_owned_by_us = false;
bool become_owner = true;
- bool propagate = lp_parm_bool(partner->service->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false);
+ bool propagate = lpcfg_parm_bool(partner->service->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false);
const char *local_owner = partner->service->wins_db->local_owner;
merge = talloc(mem_ctx, struct winsdb_record);
return NT_STATUS_INTERNAL_ERROR;
}
- if (lp_interfaces(lp_ctx) && lp_bind_interfaces_only(lp_ctx)) {
+ if (lpcfg_interfaces(lp_ctx) && lpcfg_bind_interfaces_only(lp_ctx)) {
int num_interfaces;
int i;
struct interface *ifaces;
- load_interfaces(task, lp_interfaces(lp_ctx), &ifaces);
+ load_interfaces(task, lpcfg_interfaces(lp_ctx), &ifaces);
num_interfaces = iface_count(ifaces);
for(i = 0; i < num_interfaces; i++) {
address = iface_n_ip(ifaces, i);
status = stream_setup_socket(task->event_ctx,
- task->lp_ctx, model_ops,
+ task->lp_ctx, model_ops,
&wreplsrv_stream_ops,
"ipv4", address, &port,
- lp_socket_options(task->lp_ctx),
+ lpcfg_socket_options(task->lp_ctx),
service);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("stream_setup_socket(address=%s,port=%u) failed - %s\n",
}
}
} else {
- address = lp_socket_address(lp_ctx);
- status = stream_setup_socket(task->event_ctx, task->lp_ctx,
+ address = lpcfg_socket_address(lp_ctx);
+ status = stream_setup_socket(task->event_ctx, task->lp_ctx,
model_ops, &wreplsrv_stream_ops,
- "ipv4", address, &port, lp_socket_options(task->lp_ctx),
+ "ipv4", address, &port, lpcfg_socket_options(task->lp_ctx),
service);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("stream_setup_socket(address=%s,port=%u) failed - %s\n",
bool delete_tombstones;
struct timeval tombstone_extra_time;
const char *local_owner = service->wins_db->local_owner;
- bool propagate = lp_parm_bool(service->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false);
+ bool propagate = lpcfg_parm_bool(service->task->lp_ctx, NULL, "wreplsrv", "propagate name releases", false);
now_timestr = ldb_timestring(tmp_mem, now);
NT_STATUS_HAVE_NO_MEMORY(now_timestr);
struct tevent_context *ev_ctx,
struct loadparm_context *lp_ctx)
{
- return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, private_path(mem_ctx,
- lp_ctx, lp_wins_config_url(lp_ctx)),
+ return ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, private_path(mem_ctx,
+ lp_ctx, lpcfg_wins_config_url(lp_ctx)),
system_session(lp_ctx), NULL, 0);
}
static NTSTATUS wreplsrv_open_winsdb(struct wreplsrv_service *service,
struct loadparm_context *lp_ctx)
{
- const char *owner = lp_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
+ const char *owner = lpcfg_parm_string(lp_ctx, NULL, "winsdb", "local_owner");
if (owner == NULL) {
struct interface *ifaces;
- load_interfaces(service, lp_interfaces(lp_ctx), &ifaces);
+ load_interfaces(service, lpcfg_interfaces(lp_ctx), &ifaces);
owner = iface_n_ip(ifaces, 0);
}
}
/* the default renew interval is 6 days */
- service->config.renew_interval = lp_parm_int(lp_ctx, NULL,"wreplsrv","renew_interval", 6*24*60*60);
+ service->config.renew_interval = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","renew_interval", 6*24*60*60);
/* the default tombstone (extinction) interval is 6 days */
- service->config.tombstone_interval= lp_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_interval", 6*24*60*60);
+ service->config.tombstone_interval= lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_interval", 6*24*60*60);
/* the default tombstone (extinction) timeout is 1 day */
- service->config.tombstone_timeout = lp_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_timeout", 1*24*60*60);
+ service->config.tombstone_timeout = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_timeout", 1*24*60*60);
/* the default tombstone extra timeout is 3 days */
- service->config.tombstone_extra_timeout = lp_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_extra_timeout", 3*24*60*60);
+ service->config.tombstone_extra_timeout = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","tombstone_extra_timeout", 3*24*60*60);
/* the default verify interval is 24 days */
- service->config.verify_interval = lp_parm_int(lp_ctx, NULL,"wreplsrv","verify_interval", 24*24*60*60);
+ service->config.verify_interval = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","verify_interval", 24*24*60*60);
/* the default scavenging interval is 'renew_interval/2' */
- service->config.scavenging_interval=lp_parm_int(lp_ctx, NULL,"wreplsrv","scavenging_interval",
+ service->config.scavenging_interval=lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","scavenging_interval",
service->config.renew_interval/2);
/* the maximun interval to the next periodic processing event */
- service->config.periodic_interval = lp_parm_int(lp_ctx, NULL,"wreplsrv","periodic_interval", 15);
+ service->config.periodic_interval = lpcfg_parm_int(lp_ctx, NULL,"wreplsrv","periodic_interval", 15);
return NT_STATUS_OK;
}
NTSTATUS status;
struct wreplsrv_service *service;
- if (!lp_wins_support(task->lp_ctx)) {
+ if (!lpcfg_wins_support(task->lp_ctx)) {
return;
}