summaryrefslogtreecommitdiff
path: root/source4/ntptr
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntptr')
-rw-r--r--source4/ntptr/ntptr.h1
-rw-r--r--source4/ntptr/ntptr_base.c4
-rw-r--r--source4/ntptr/simple_ldb/ntptr_simple_ldb.c20
3 files changed, 14 insertions, 11 deletions
diff --git a/source4/ntptr/ntptr.h b/source4/ntptr/ntptr.h
index 56cb4176f4..3e95c3c5e1 100644
--- a/source4/ntptr/ntptr.h
+++ b/source4/ntptr/ntptr.h
@@ -220,6 +220,7 @@ struct ntptr_ops {
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 */
diff --git a/source4/ntptr/ntptr_base.c b/source4/ntptr/ntptr_base.c
index 1a14c3b33e..e184afcfd5 100644
--- a/source4/ntptr/ntptr_base.c
+++ b/source4/ntptr/ntptr_base.c
@@ -119,7 +119,8 @@ const struct ntptr_critical_sizes *ntptr_interface_version(void)
/*
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;
@@ -132,6 +133,7 @@ NTSTATUS ntptr_init_context(TALLOC_CTX *mem_ctx, const char *providor, struct nt
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",
diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
index 9a9fa626ef..4e6586db65 100644
--- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
+++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
@@ -87,7 +87,7 @@ static int sptr_db_search(struct ldb_context *ldb,
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;
@@ -170,9 +170,9 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
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);
@@ -188,9 +188,9 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
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;
@@ -204,12 +204,12 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
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;
}