diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/credentials/credentials.c | 1 | ||||
-rw-r--r-- | source4/auth/credentials/credentials_files.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/ldb_ildap/config.mk | 2 | ||||
-rw-r--r-- | source4/libnet/libnet_join.c | 2 | ||||
-rw-r--r-- | source4/param/secrets.c | 11 | ||||
-rw-r--r-- | source4/param/secrets.h | 6 | ||||
-rw-r--r-- | source4/rpc_server/lsa/dcesrv_lsa.c | 6 |
7 files changed, 17 insertions, 13 deletions
diff --git a/source4/auth/credentials/credentials.c b/source4/auth/credentials/credentials.c index d6c0bbc0ba2..8510a1f7110 100644 --- a/source4/auth/credentials/credentials.c +++ b/source4/auth/credentials/credentials.c @@ -229,7 +229,6 @@ bool cli_credentials_set_principal(struct cli_credentials *cred, /* Set a callback to get the principal. This could be a popup dialog, * a terminal prompt or similar. */ - bool cli_credentials_set_principal_callback(struct cli_credentials *cred, const char *(*principal_cb) (struct cli_credentials *)) { diff --git a/source4/auth/credentials/credentials_files.c b/source4/auth/credentials/credentials_files.c index db69fc1cb4f..2d850956e2c 100644 --- a/source4/auth/credentials/credentials_files.c +++ b/source4/auth/credentials/credentials_files.c @@ -212,7 +212,7 @@ NTSTATUS cli_credentials_set_secrets(struct cli_credentials *cred, if (!ldb) { /* Local secrets are stored in secrets.ldb */ - ldb = secrets_db_connect(mem_ctx); + ldb = secrets_db_connect(mem_ctx, global_loadparm); if (!ldb) { /* set anonymous as the fallback, if the machine account won't work */ cli_credentials_set_anonymous(cred); diff --git a/source4/lib/ldb/ldb_ildap/config.mk b/source4/lib/ldb/ldb_ildap/config.mk index f7ed3469f35..83c43b6c350 100644 --- a/source4/lib/ldb/ldb_ildap/config.mk +++ b/source4/lib/ldb/ldb_ildap/config.mk @@ -3,7 +3,7 @@ [MODULE::ldb_ildap] SUBSYSTEM = LIBLDB CFLAGS = -Ilib/ldb/include -OUTPUT_TYPE = SHARED_LIBRARY +#OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC LIBCLI_LDAP INIT_FUNCTION = ldb_ildap_init ALIASES = ldapi ldaps ldap diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c index d80ff34d0fd..25ad0ca4402 100644 --- a/source4/libnet/libnet_join.c +++ b/source4/libnet/libnet_join.c @@ -909,7 +909,7 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx, * Local secrets are stored in secrets.ldb * open it to make sure we can write the info into it after the join */ - ldb = secrets_db_connect(tmp_mem); + ldb = secrets_db_connect(tmp_mem, global_loadparm); if (!ldb) { r->out.error_string = talloc_asprintf(mem_ctx, diff --git a/source4/param/secrets.c b/source4/param/secrets.c index 308c5a607be..eeced9ddbe8 100644 --- a/source4/param/secrets.c +++ b/source4/param/secrets.c @@ -99,18 +99,18 @@ bool secrets_init(void) /** connect to the secrets ldb */ -struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx) +struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { char *path; const char *url; struct ldb_context *ldb; - url = lp_secrets_url(global_loadparm); + url = lp_secrets_url(lp_ctx); if (!url || !url[0]) { return NULL; } - path = private_path(mem_ctx, global_loadparm, url); + path = private_path(mem_ctx, lp_ctx, url); if (!path) { return NULL; } @@ -123,6 +123,9 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx) return NULL; } + ldb_set_modules_dir(ldb, + talloc_asprintf(ldb, "%s/ldb", lp_modulesdir(lp_ctx))); + if (ldb_connect(ldb, path, 0, NULL) != 0) { talloc_free(path); return NULL; @@ -146,7 +149,7 @@ struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, const char *attrs[] = { "objectSid", NULL }; struct dom_sid *result = NULL; - ldb = secrets_db_connect(mem_ctx); + ldb = secrets_db_connect(mem_ctx, global_loadparm); if (ldb == NULL) { DEBUG(5, ("secrets_db_connect failed\n")); return NULL; diff --git a/source4/param/secrets.h b/source4/param/secrets.h index 5aabb849c5c..9d98db0d084 100644 --- a/source4/param/secrets.h +++ b/source4/param/secrets.h @@ -44,9 +44,9 @@ struct machine_acct_pass { */ void secrets_shutdown(void); bool secrets_init(void); -struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx); -struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, - const char *domain); +struct loadparm_context; +struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, const char *domain); #endif /* _SECRETS_H */ diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index 93c1ee9e4d3..9d1f43a2147 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -1713,7 +1713,8 @@ static NTSTATUS dcesrv_lsa_CreateSecret(struct dcesrv_call_state *dce_call, TALL return NT_STATUS_INVALID_PARAMETER; } - secret_state->sam_ldb = talloc_reference(secret_state, secrets_db_connect(mem_ctx)); + secret_state->sam_ldb = talloc_reference(secret_state, secrets_db_connect(mem_ctx, + global_loadparm)); /* search for the secret record */ ret = gendb_search(secret_state->sam_ldb, mem_ctx, ldb_dn_new(mem_ctx, secret_state->sam_ldb, "cn=LSA Secrets"), @@ -1831,7 +1832,8 @@ static NTSTATUS dcesrv_lsa_OpenSecret(struct dcesrv_call_state *dce_call, TALLOC } } else { - secret_state->sam_ldb = talloc_reference(secret_state, secrets_db_connect(mem_ctx)); + secret_state->sam_ldb = talloc_reference(secret_state, + secrets_db_connect(mem_ctx, global_loadparm)); secret_state->global = false; name = r->in.name.string; |