{
if (lp_parm_bool(lp_ctx, NULL, "ctdb", "enable", false) &&
lp_parm_bool(lp_ctx, NULL, "ctdb", name, true)) {
- return db_tmp_open_ctdb(mem_ctx, name, tdb_flags);
+ return db_tmp_open_ctdb(mem_ctx, lp_ctx, name, tdb_flags);
}
return db_tmp_open_tdb(mem_ctx, lp_ctx, name, tdb_flags);
/* backends */
struct db_context *db_tmp_open_tdb(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *name, int tdb_flags);
-struct db_context *db_tmp_open_ctdb(TALLOC_CTX *mem_ctx, const char *name, int tdb_flags);
+struct db_context *db_tmp_open_ctdb(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *name, int tdb_flags);
return -1;
}
-struct db_context *db_tmp_open_ctdb(TALLOC_CTX *mem_ctx, const char *name, int tdb_flags)
+struct db_context *db_tmp_open_ctdb(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
+ const char *name, int tdb_flags)
{
struct db_context *db;
struct ctdb_context *ctdb = talloc_get_type(cluster_backend_handle(),
#include "libcli/ldap/ldap_client.h"
#include "auth/auth.h"
#include "auth/credentials/credentials.h"
+#include "param/param.h"
struct ildb_private {
struct ldap_connection *ldap;
goto failed;
}
} else {
- status = ldap_bind_sasl(ildb->ldap, creds);
+ status = ldap_bind_sasl(ildb->ldap, creds, global_loadparm);
if (!NT_STATUS_IS_OK(status)) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n",
ldap_errstr(ildb->ldap, module, status));
switch (conn->bind.type) {
case LDAP_BIND_SASL:
- status = ldap_bind_sasl(conn, (struct cli_credentials *)conn->bind.creds);
+ status = ldap_bind_sasl(conn, (struct cli_credentials *)conn->bind.creds,
+ global_loadparm);
break;
case LDAP_BIND_SIMPLE:
perform a sasl bind using the given credentials
*/
NTSTATUS ldap_bind_sasl(struct ldap_connection *conn,
- struct cli_credentials *creds)
+ struct cli_credentials *creds,
+ struct loadparm_context *lp_ctx)
{
NTSTATUS status;
TALLOC_CTX *tmp_ctx = NULL;
NULL
};
- status = gensec_client_start(conn, &conn->gensec, NULL, global_loadparm);
+ status = gensec_client_start(conn, &conn->gensec, NULL, lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("Failed to start GENSEC engine (%s)\n", nt_errstr(status)));
goto failed;
struct ntptr_context {
const struct ntptr_ops *ops;
void *private_data;
+ struct loadparm_context *lp_ctx;
};
/* this structure is used by backends to determine the size of some critical types */
/*
create a ntptr_context with a specified NTPTR backend
*/
-NTSTATUS ntptr_init_context(TALLOC_CTX *mem_ctx, const char *providor, struct ntptr_context **_ntptr)
+NTSTATUS ntptr_init_context(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
+ const char *providor, struct ntptr_context **_ntptr)
{
NTSTATUS status;
struct ntptr_context *ntptr;
NT_STATUS_HAVE_NO_MEMORY(ntptr);
ntptr->private_data = NULL;
ntptr->ops = ntptr_backend_byname(providor);
+ ntptr->lp_ctx = lp_ctx;
if (!ntptr->ops) {
DEBUG(1,("ntptr_init_context: failed to find NTPTR providor='%s'\n",
static NTSTATUS sptr_init_context(struct ntptr_context *ntptr)
{
- struct ldb_context *sptr_db = sptr_db_connect(ntptr, global_loadparm);
+ struct ldb_context *sptr_db = sptr_db_connect(ntptr, ntptr->lp_ctx);
NT_STATUS_HAVE_NO_MEMORY(sptr_db);
ntptr->private_data = sptr_db;
enum ndr_err_code ndr_err;
struct spoolss_OSVersion os;
- os.major = dcesrv_common_get_version_major(mem_ctx, global_loadparm);
- os.minor = dcesrv_common_get_version_minor(mem_ctx, global_loadparm);
- os.build = dcesrv_common_get_version_build(mem_ctx, global_loadparm);
+ os.major = dcesrv_common_get_version_major(mem_ctx, server->ntptr->lp_ctx);
+ os.minor = dcesrv_common_get_version_minor(mem_ctx, server->ntptr->lp_ctx);
+ os.build = dcesrv_common_get_version_build(mem_ctx, server->ntptr->lp_ctx);
os.extra_string = "";
ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &os, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersion);
enum ndr_err_code ndr_err;
struct spoolss_OSVersionEx os_ex;
- os_ex.major = dcesrv_common_get_version_major(mem_ctx, global_loadparm);
- os_ex.minor = dcesrv_common_get_version_minor(mem_ctx, global_loadparm);
- os_ex.build = dcesrv_common_get_version_build(mem_ctx, global_loadparm);
+ os_ex.major = dcesrv_common_get_version_major(mem_ctx, server->ntptr->lp_ctx);
+ os_ex.minor = dcesrv_common_get_version_minor(mem_ctx, server->ntptr->lp_ctx);
+ os_ex.build = dcesrv_common_get_version_build(mem_ctx, server->ntptr->lp_ctx);
os_ex.extra_string = "";
os_ex.unknown2 = 0;
os_ex.unknown3 = 0;
r->out.data.binary = blob;
return WERR_OK;
} else if (strcmp("DNSMachineName", r->in.value_name) == 0) {
- if (!lp_realm(global_loadparm)) return WERR_INVALID_PARAM;
+ if (!lp_realm(server->ntptr->lp_ctx)) return WERR_INVALID_PARAM;
r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
r->out.data.string = talloc_asprintf(mem_ctx, "%s.%s",
- lp_netbios_name(global_loadparm),
- lp_realm(global_loadparm));
+ lp_netbios_name(server->ntptr->lp_ctx),
+ lp_realm(server->ntptr->lp_ctx));
W_ERROR_HAVE_NO_MEMORY(r->out.data.string);
return WERR_OK;
}
return NT_STATUS_NO_MEMORY;
}
cli_credentials_set_event_context(credentials, ntvfs->ctx->event_ctx);
- cli_credentials_set_conf(credentials, global_loadparm);
+ cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx);
cli_credentials_set_username(credentials, user, CRED_SPECIFIED);
if (domain) {
cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
DEBUG(5, ("CIFS backend: Using machine account\n"));
credentials = cli_credentials_init(private);
cli_credentials_set_event_context(credentials, ntvfs->ctx->event_ctx);
- cli_credentials_set_conf(credentials, global_loadparm);
+ cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx);
if (domain) {
cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
}
io.in.called_name = host;
io.in.credentials = credentials;
io.in.fallback_to_anonymous = false;
- io.in.workgroup = lp_workgroup(global_loadparm);
+ io.in.workgroup = lp_workgroup(ntvfs->ctx->lp_ctx);
io.in.service = remote_share;
io.in.service_type = "?????";
odb->ntvfs_ctx = ntvfs_ctx;
/* leave oplocks disabled by default until the code is working */
- odb->oplocks = lp_parm_bool(global_loadparm, NULL, "opendb", "oplocks", false);
+ odb->oplocks = lp_parm_bool(ntvfs_ctx->lp_ctx, NULL, "opendb", "oplocks", false);
return odb;
}
private->pipe_list = NULL;
/* setup the DCERPC server subsystem */
- status = dcesrv_init_ipc_context(private, global_loadparm, &private->dcesrv);
+ status = dcesrv_init_ipc_context(private, ntvfs->ctx->lp_ctx, &private->dcesrv);
NT_STATUS_NOT_OK_RETURN(status);
return NT_STATUS_OK;
struct share_config *config;
struct server_id server_id;
+ struct loadparm_context *lp_ctx;
struct event_context *event_ctx;
struct messaging_context *msg_ctx;
NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, enum ntvfs_type type,
enum protocol_types protocol,
struct event_context *ev, struct messaging_context *msg,
+ struct loadparm_context *lp_ctx,
struct server_id server_id, struct ntvfs_context **_ctx)
{
const char **handlers = share_string_list_option(mem_ctx, scfg, SHARE_NTVFS_HANDLER);
ctx->event_ctx = ev;
ctx->msg_ctx = msg;
ctx->server_id = server_id;
+ ctx->lp_ctx = lp_ctx;
for (i=0; handlers[i]; i++) {
struct ntvfs_module_context *ntvfs;
}
/* by default have a max of 512 entries in the cache. */
- ctx->cache_size = lp_parm_int(global_loadparm, NULL, "mangle", "cachesize", 512);
+ ctx->cache_size = lp_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(global_loadparm, NULL, "mangle", "prefix", -1);
+ ctx->mangle_prefix = lp_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;
}
event_context_find(pvfs),
pvfs->ntvfs->ctx->config);
- pvfs->sidmap = sidmap_open(pvfs, global_loadparm);
+ pvfs->sidmap = sidmap_open(pvfs, pvfs->ntvfs->ctx->lp_ctx);
if (pvfs->sidmap == NULL) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
p = (char *)io->ioctl.out.blob.data;
SSVAL(p,0, 1 /* REWRITE: fsp->rap_print_jobid */);
- push_string(global_smb_iconv_convenience, p+2, lp_netbios_name(global_loadparm), 15, STR_TERMINATE|STR_ASCII);
+ push_string(global_smb_iconv_convenience, p+2, lp_netbios_name(ntvfs->ctx->lp_ctx), 15, STR_TERMINATE|STR_ASCII);
push_string(global_smb_iconv_convenience, p+18, ntvfs->ctx->config->name, 13, STR_TERMINATE|STR_ASCII);
return NT_STATUS_OK;
}
return NT_STATUS_NO_MEMORY;
}
- private->sidmap = sidmap_open(private, global_loadparm);
+ private->sidmap = sidmap_open(private, ntvfs->ctx->lp_ctx);
if (private->sidmap == NULL) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
NTSTATUS status;
struct ntptr_context *ntptr;
- status = ntptr_init_context(dce_call->context, lp_ntptr_providor(dce_call->conn->dce_ctx->lp_ctx), &ntptr);
+ status = ntptr_init_context(dce_call->context, dce_call->conn->dce_ctx->lp_ctx,
+ lp_ntptr_providor(dce_call->conn->dce_ctx->lp_ctx), &ntptr);
NT_STATUS_NOT_OK_RETURN(status);
dce_call->context->private = ntptr;
PROTOCOL_NT1,
dce_call->event_ctx,
dce_call->conn->msg_ctx,
+ dce_call->conn->dce_ctx->lp_ctx,
dce_call->conn->server_id,
&c->ntvfs);
if (!NT_STATUS_IS_OK(status)) {
req->smb_conn->negotiate.protocol,
req->smb_conn->connection->event.ctx,
req->smb_conn->connection->msg_ctx,
+ global_loadparm,
req->smb_conn->connection->server_id,
&tcon->ntvfs);
if (!NT_STATUS_IS_OK(status)) {
#include "librpc/gen_ndr/security.h"
#include "smbd/service_stream.h"
#include "ntvfs/ntvfs.h"
+#include "param/param.h"
/*
send an oplock break request to a client
req->smb_conn->negotiate.protocol,
req->smb_conn->connection->event.ctx,
req->smb_conn->connection->msg_ctx,
+ global_loadparm,
req->smb_conn->connection->server_id,
&tcon->ntvfs);
if (!NT_STATUS_IS_OK(status)) {
#include "torture/torture.h"
#include "torture/ldap/proto.h"
+#include "param/param.h"
+
static bool test_bind_simple(struct ldap_connection *conn, const char *userdn, const char *password)
{
NTSTATUS status;
printf("Testing sasl bind as user\n");
- status = torture_ldap_bind_sasl(conn, creds);
+ status = torture_ldap_bind_sasl(conn, creds, global_loadparm);
if (!NT_STATUS_IS_OK(status)) {
ret = false;
}
}
_PUBLIC_ NTSTATUS torture_ldap_bind_sasl(struct ldap_connection *conn,
- struct cli_credentials *creds)
+ struct cli_credentials *creds,
+ struct loadparm_context *lp_ctx)
{
NTSTATUS status;
- status = ldap_bind_sasl(conn, creds);
+ status = ldap_bind_sasl(conn, creds, lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed sasl bind with provided credentials - %s\n",
nt_errstr(status));
printf("connected to LDAP: %s\n", ctx->ldap_url);
- status = torture_ldap_bind_sasl(l->conn, credentials);
+ status = torture_ldap_bind_sasl(l->conn, credentials, global_loadparm);
if (!NT_STATUS_IS_OK(status)) {
printf("failed to bind to LDAP:\n");
return false;
state->domain->dc_name);
state->ctx->status =
ldap_bind_sasl(state->domain->ldap_conn,
- state->domain->libnet_ctx->cred);
+ state->domain->libnet_ctx->cred,
+ state->domain->libnet_ctx->lp_ctx);
DEBUG(0, ("ldap_bind returned %s\n",
nt_errstr(state->ctx->status)));
}