mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
samdb: Add flags argument to samdb_connect().
This commit is contained in:
parent
6280725b47
commit
93126b3315
@ -447,7 +447,7 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **
|
|||||||
if (sam_ctx) {
|
if (sam_ctx) {
|
||||||
ctx->sam_ctx = sam_ctx;
|
ctx->sam_ctx = sam_ctx;
|
||||||
} else {
|
} else {
|
||||||
ctx->sam_ctx = samdb_connect(ctx, ctx->event_ctx, ctx->lp_ctx, system_session(ctx->lp_ctx));
|
ctx->sam_ctx = samdb_connect(ctx, ctx->event_ctx, ctx->lp_ctx, system_session(ctx->lp_ctx), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; methods[i] ; i++) {
|
for (i=0; methods[i] ; i++) {
|
||||||
|
@ -212,7 +212,7 @@ static void cldapd_task_init(struct task_server *task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cldapd->task = task;
|
cldapd->task = task;
|
||||||
cldapd->samctx = samdb_connect(cldapd, task->event_ctx, task->lp_ctx, system_session(task->lp_ctx));
|
cldapd->samctx = samdb_connect(cldapd, task->event_ctx, task->lp_ctx, system_session(task->lp_ctx), 0);
|
||||||
if (cldapd->samctx == NULL) {
|
if (cldapd->samctx == NULL) {
|
||||||
task_server_terminate(task, "cldapd failed to open samdb", true);
|
task_server_terminate(task, "cldapd failed to open samdb", true);
|
||||||
return;
|
return;
|
||||||
|
@ -575,7 +575,7 @@ static void dnsupdate_task_init(struct task_server *task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
service->samdb = samdb_connect(service, service->task->event_ctx, task->lp_ctx,
|
service->samdb = samdb_connect(service, service->task->event_ctx, task->lp_ctx,
|
||||||
service->system_session_info);
|
service->system_session_info, 0);
|
||||||
if (!service->samdb) {
|
if (!service->samdb) {
|
||||||
task_server_terminate(task, "dnsupdate: Failed to connect to local samdb\n",
|
task_server_terminate(task, "dnsupdate: Failed to connect to local samdb\n",
|
||||||
true);
|
true);
|
||||||
|
@ -55,7 +55,7 @@ static WERROR kccsrv_connect_samdb(struct kccsrv_service *service, struct loadpa
|
|||||||
{
|
{
|
||||||
const struct GUID *ntds_guid;
|
const struct GUID *ntds_guid;
|
||||||
|
|
||||||
service->samdb = samdb_connect(service, service->task->event_ctx, lp_ctx, service->system_session_info);
|
service->samdb = samdb_connect(service, service->task->event_ctx, lp_ctx, service->system_session_info, 0);
|
||||||
if (!service->samdb) {
|
if (!service->samdb) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ static WERROR dreplsrv_connect_samdb(struct dreplsrv_service *service, struct lo
|
|||||||
const struct GUID *ntds_guid;
|
const struct GUID *ntds_guid;
|
||||||
struct drsuapi_DsBindInfo28 *bind_info28;
|
struct drsuapi_DsBindInfo28 *bind_info28;
|
||||||
|
|
||||||
service->samdb = samdb_connect(service, service->task->event_ctx, lp_ctx, service->system_session_info);
|
service->samdb = samdb_connect(service, service->task->event_ctx, lp_ctx, service->system_session_info, 0);
|
||||||
if (!service->samdb) {
|
if (!service->samdb) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
@ -1235,7 +1235,7 @@ NTSTATUS crack_name_to_nt4_name(TALLOC_CTX *mem_ctx,
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ldb = samdb_connect(mem_ctx, ev_ctx, lp_ctx, system_session(lp_ctx));
|
ldb = samdb_connect(mem_ctx, ev_ctx, lp_ctx, system_session(lp_ctx), 0);
|
||||||
if (ldb == NULL) {
|
if (ldb == NULL) {
|
||||||
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
||||||
}
|
}
|
||||||
|
@ -123,14 +123,15 @@ struct cli_credentials *samdb_credentials(struct tevent_context *event_ctx,
|
|||||||
struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
|
struct ldb_context *samdb_connect(TALLOC_CTX *mem_ctx,
|
||||||
struct tevent_context *ev_ctx,
|
struct tevent_context *ev_ctx,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
struct auth_session_info *session_info)
|
struct auth_session_info *session_info,
|
||||||
|
int flags)
|
||||||
{
|
{
|
||||||
struct ldb_context *ldb;
|
struct ldb_context *ldb;
|
||||||
struct dsdb_schema *schema;
|
struct dsdb_schema *schema;
|
||||||
ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx,
|
ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx,
|
||||||
lpcfg_sam_url(lp_ctx), session_info,
|
lpcfg_sam_url(lp_ctx), session_info,
|
||||||
samdb_credentials(ev_ctx, lp_ctx),
|
samdb_credentials(ev_ctx, lp_ctx),
|
||||||
0);
|
flags);
|
||||||
|
|
||||||
if (!ldb) {
|
if (!ldb) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1660,7 +1660,7 @@ NTSTATUS samba_kdc_setup_db_ctx(TALLOC_CTX *mem_ctx, struct samba_kdc_base_conte
|
|||||||
|
|
||||||
/* Setup the link to LDB */
|
/* Setup the link to LDB */
|
||||||
kdc_db_ctx->samdb = samdb_connect(kdc_db_ctx, base_ctx->ev_ctx,
|
kdc_db_ctx->samdb = samdb_connect(kdc_db_ctx, base_ctx->ev_ctx,
|
||||||
base_ctx->lp_ctx, session_info);
|
base_ctx->lp_ctx, session_info, 0);
|
||||||
if (kdc_db_ctx->samdb == NULL) {
|
if (kdc_db_ctx->samdb == NULL) {
|
||||||
DEBUG(1, ("hdb_samba4_create: Cannot open samdb for KDC backend!"));
|
DEBUG(1, ("hdb_samba4_create: Cannot open samdb for KDC backend!"));
|
||||||
talloc_free(kdc_db_ctx);
|
talloc_free(kdc_db_ctx);
|
||||||
|
@ -180,7 +180,7 @@ static bool kpasswdd_change_password(struct kdc_server *kdc,
|
|||||||
/* Connect to a SAMDB with system privileges for fetching the old pw
|
/* Connect to a SAMDB with system privileges for fetching the old pw
|
||||||
* hashes. */
|
* hashes. */
|
||||||
samdb = samdb_connect(mem_ctx, kdc->task->event_ctx, kdc->task->lp_ctx,
|
samdb = samdb_connect(mem_ctx, kdc->task->event_ctx, kdc->task->lp_ctx,
|
||||||
system_session(kdc->task->lp_ctx));
|
system_session(kdc->task->lp_ctx), 0);
|
||||||
if (!samdb) {
|
if (!samdb) {
|
||||||
return kpasswdd_make_error_reply(kdc, mem_ctx,
|
return kpasswdd_make_error_reply(kdc, mem_ctx,
|
||||||
KRB5_KPASSWD_HARDERROR,
|
KRB5_KPASSWD_HARDERROR,
|
||||||
@ -213,7 +213,7 @@ static bool kpasswdd_change_password(struct kdc_server *kdc,
|
|||||||
|
|
||||||
/* Start a SAM with user privileges for the password change */
|
/* Start a SAM with user privileges for the password change */
|
||||||
samdb = samdb_connect(mem_ctx, kdc->task->event_ctx, kdc->task->lp_ctx,
|
samdb = samdb_connect(mem_ctx, kdc->task->event_ctx, kdc->task->lp_ctx,
|
||||||
session_info);
|
session_info, 0);
|
||||||
if (!samdb) {
|
if (!samdb) {
|
||||||
return kpasswdd_make_error_reply(kdc, mem_ctx,
|
return kpasswdd_make_error_reply(kdc, mem_ctx,
|
||||||
KRB5_KPASSWD_HARDERROR,
|
KRB5_KPASSWD_HARDERROR,
|
||||||
@ -371,7 +371,7 @@ static bool kpasswd_process_request(struct kdc_server *kdc,
|
|||||||
}
|
}
|
||||||
krb5_free_principal(context, principal);
|
krb5_free_principal(context, principal);
|
||||||
|
|
||||||
samdb = samdb_connect(mem_ctx, kdc->task->event_ctx, kdc->task->lp_ctx, session_info);
|
samdb = samdb_connect(mem_ctx, kdc->task->event_ctx, kdc->task->lp_ctx, session_info, 0);
|
||||||
if (!samdb) {
|
if (!samdb) {
|
||||||
return kpasswdd_make_error_reply(kdc, mem_ctx,
|
return kpasswdd_make_error_reply(kdc, mem_ctx,
|
||||||
KRB5_KPASSWD_HARDERROR,
|
KRB5_KPASSWD_HARDERROR,
|
||||||
|
@ -194,12 +194,10 @@ static int map_ldb_error(TALLOC_CTX *mem_ctx, int ldb_err,
|
|||||||
*/
|
*/
|
||||||
NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn)
|
NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn)
|
||||||
{
|
{
|
||||||
conn->ldb = ldb_wrap_connect(conn,
|
conn->ldb = samdb_connect(conn,
|
||||||
conn->connection->event.ctx,
|
conn->connection->event.ctx,
|
||||||
conn->lp_ctx,
|
conn->lp_ctx,
|
||||||
lpcfg_sam_url(conn->lp_ctx),
|
|
||||||
conn->session_info,
|
conn->session_info,
|
||||||
samdb_credentials(conn->connection->event.ctx, conn->lp_ctx),
|
|
||||||
conn->global_catalog ? LDB_FLG_RDONLY : 0);
|
conn->global_catalog ? LDB_FLG_RDONLY : 0);
|
||||||
if (conn->ldb == NULL) {
|
if (conn->ldb == NULL) {
|
||||||
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
||||||
|
@ -841,7 +841,7 @@ static NTSTATUS add_socket(struct tevent_context *event_context,
|
|||||||
|
|
||||||
/* Load LDAP database, but only to read our settings */
|
/* Load LDAP database, but only to read our settings */
|
||||||
ldb = samdb_connect(ldap_service, ldap_service->task->event_ctx,
|
ldb = samdb_connect(ldap_service, ldap_service->task->event_ctx,
|
||||||
lp_ctx, system_session(lp_ctx));
|
lp_ctx, system_session(lp_ctx), 0);
|
||||||
if (!ldb) {
|
if (!ldb) {
|
||||||
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
||||||
}
|
}
|
||||||
|
@ -1216,7 +1216,8 @@ NTSTATUS libnet_samsync_ldb(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, str
|
|||||||
state->sam_ldb = samdb_connect(mem_ctx,
|
state->sam_ldb = samdb_connect(mem_ctx,
|
||||||
ctx->event_ctx,
|
ctx->event_ctx,
|
||||||
ctx->lp_ctx,
|
ctx->lp_ctx,
|
||||||
r->in.session_info);
|
r->in.session_info,
|
||||||
|
0);
|
||||||
if (!state->sam_ldb) {
|
if (!state->sam_ldb) {
|
||||||
return NT_STATUS_INTERNAL_DB_ERROR;
|
return NT_STATUS_INTERNAL_DB_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ static void nbtd_task_init(struct task_server *task)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbtsrv->sam_ctx = samdb_connect(nbtsrv, task->event_ctx, task->lp_ctx, system_session(task->lp_ctx));
|
nbtsrv->sam_ctx = samdb_connect(nbtsrv, task->event_ctx, task->lp_ctx, system_session(task->lp_ctx), 0);
|
||||||
if (nbtsrv->sam_ctx == NULL) {
|
if (nbtsrv->sam_ctx == NULL) {
|
||||||
task_server_terminate(task, "nbtd failed to open samdb", true);
|
task_server_terminate(task, "nbtd failed to open samdb", true);
|
||||||
return;
|
return;
|
||||||
|
@ -1013,7 +1013,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx,
|
|||||||
|
|
||||||
h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)),
|
h->ldb = ldb_wrap_connect(h, ev_ctx, lp_ctx, lock_path(h, lp_ctx, lpcfg_wins_url(lp_ctx)),
|
||||||
NULL, NULL, flags);
|
NULL, NULL, flags);
|
||||||
if (!h->ldb) goto failed;
|
if (!h->ldb) goto failed;
|
||||||
|
|
||||||
h->caller = caller;
|
h->caller = caller;
|
||||||
h->hook_script = lpcfg_wins_hook(lp_ctx);
|
h->hook_script = lpcfg_wins_hook(lp_ctx);
|
||||||
|
@ -520,7 +520,7 @@ static void ntp_signd_task_init(struct task_server *task)
|
|||||||
ntp_signd->task = task;
|
ntp_signd->task = task;
|
||||||
|
|
||||||
/* Must be system to get at the password hashes */
|
/* Must be system to get at the password hashes */
|
||||||
ntp_signd->samdb = samdb_connect(ntp_signd, task->event_ctx, task->lp_ctx, system_session(task->lp_ctx));
|
ntp_signd->samdb = samdb_connect(ntp_signd, task->event_ctx, task->lp_ctx, system_session(task->lp_ctx), 0);
|
||||||
if (ntp_signd->samdb == NULL) {
|
if (ntp_signd->samdb == NULL) {
|
||||||
task_server_terminate(task, "ntp_signd failed to open samdb", true);
|
task_server_terminate(task, "ntp_signd failed to open samdb", true);
|
||||||
return;
|
return;
|
||||||
|
@ -95,7 +95,7 @@ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct tevent_contex
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* open main ldb */
|
/* open main ldb */
|
||||||
samctx = samdb_connect(tmp_ctx, event_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, dce_ctx->lp_ctx));
|
samctx = samdb_connect(tmp_ctx, event_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, dce_ctx->lp_ctx), 0);
|
||||||
if (samctx == NULL) {
|
if (samctx == NULL) {
|
||||||
DEBUG(2,("Unable to open samdb in determining server announce flags\n"));
|
DEBUG(2,("Unable to open samdb in determining server announce flags\n"));
|
||||||
} else {
|
} else {
|
||||||
|
@ -80,7 +80,7 @@ static WERROR dcesrv_drsuapi_DsBind(struct dcesrv_call_state *dce_call, TALLOC_C
|
|||||||
* connect to the samdb
|
* connect to the samdb
|
||||||
*/
|
*/
|
||||||
b_state->sam_ctx = samdb_connect(b_state, dce_call->event_ctx,
|
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, 0);
|
||||||
if (!b_state->sam_ctx) {
|
if (!b_state->sam_ctx) {
|
||||||
return WERR_FOOBAR;
|
return WERR_FOOBAR;
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ static WERROR dcesrv_drsuapi_DsBind(struct dcesrv_call_state *dce_call, TALLOC_C
|
|||||||
if (W_ERROR_IS_OK(werr)) {
|
if (W_ERROR_IS_OK(werr)) {
|
||||||
b_state->sam_ctx_system = samdb_connect(b_state, dce_call->event_ctx,
|
b_state->sam_ctx_system = samdb_connect(b_state, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
system_session(dce_call->conn->dce_ctx->lp_ctx));
|
system_session(dce_call->conn->dce_ctx->lp_ctx), 0);
|
||||||
if (!b_state->sam_ctx_system) {
|
if (!b_state->sam_ctx_system) {
|
||||||
return WERR_FOOBAR;
|
return WERR_FOOBAR;
|
||||||
}
|
}
|
||||||
|
@ -2884,7 +2884,7 @@ static NTSTATUS dcesrv_lsa_CreateSecret(struct dcesrv_call_state *dce_call, TALL
|
|||||||
name = &r->in.name.string[2];
|
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) */
|
/* 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,
|
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), 0));
|
||||||
secret_state->global = true;
|
secret_state->global = true;
|
||||||
|
|
||||||
if (strlen(name) < 1) {
|
if (strlen(name) < 1) {
|
||||||
@ -3021,7 +3021,7 @@ static NTSTATUS dcesrv_lsa_OpenSecret(struct dcesrv_call_state *dce_call, TALLOC
|
|||||||
name = &r->in.name.string[2];
|
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) */
|
/* 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,
|
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), 0));
|
||||||
secret_state->global = true;
|
secret_state->global = true;
|
||||||
|
|
||||||
if (strlen(name) < 1) {
|
if (strlen(name) < 1) {
|
||||||
|
@ -43,7 +43,7 @@ NTSTATUS dcesrv_lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make sure the sam database is accessible */
|
/* 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, 0);
|
||||||
if (state->sam_ldb == NULL) {
|
if (state->sam_ldb == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ static NTSTATUS dcesrv_netr_ServerAuthenticate3(struct dcesrv_call_state *dce_ca
|
|||||||
}
|
}
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx,
|
sam_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));
|
system_session(dce_call->conn->dce_ctx->lp_ctx), 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -400,7 +400,7 @@ static NTSTATUS dcesrv_netr_ServerPasswordSet(struct dcesrv_call_state *dce_call
|
|||||||
&creds);
|
&creds);
|
||||||
NT_STATUS_NOT_OK_RETURN(nt_status);
|
NT_STATUS_NOT_OK_RETURN(nt_status);
|
||||||
|
|
||||||
sam_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));
|
sam_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), 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -458,7 +458,7 @@ static NTSTATUS dcesrv_netr_ServerPasswordSet2(struct dcesrv_call_state *dce_cal
|
|||||||
&creds);
|
&creds);
|
||||||
NT_STATUS_NOT_OK_RETURN(nt_status);
|
NT_STATUS_NOT_OK_RETURN(nt_status);
|
||||||
|
|
||||||
sam_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));
|
sam_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), 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -942,7 +942,7 @@ static WERROR dcesrv_netr_GetDcName(struct dcesrv_call_state *dce_call, TALLOC_C
|
|||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
@ -1057,7 +1057,7 @@ static WERROR dcesrv_netr_GetAnyDCName(struct dcesrv_call_state *dce_call, TALLO
|
|||||||
}
|
}
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
@ -1184,7 +1184,7 @@ static WERROR dcesrv_netr_DsRGetSiteName(struct dcesrv_call_state *dce_call, TAL
|
|||||||
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
|
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
@ -1293,7 +1293,7 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
|
|||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
system_session(dce_call->conn->dce_ctx->lp_ctx));
|
system_session(dce_call->conn->dce_ctx->lp_ctx), 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -1557,7 +1557,7 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call,
|
|||||||
ZERO_STRUCTP(r->out.info);
|
ZERO_STRUCTP(r->out.info);
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
@ -1708,7 +1708,7 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce
|
|||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
@ -1824,7 +1824,7 @@ static WERROR dcesrv_netr_DsrGetDcSiteCoverageW(struct dcesrv_call_state *dce_ca
|
|||||||
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
|
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_DS_UNAVAILABLE;
|
return WERR_DS_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
@ -2003,7 +2003,7 @@ static WERROR dcesrv_netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce
|
|||||||
r->out.trusts = trusts;
|
r->out.trusts = trusts;
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_GENERAL_FAILURE;
|
return WERR_GENERAL_FAILURE;
|
||||||
}
|
}
|
||||||
@ -2153,7 +2153,7 @@ static WERROR dcesrv_netr_DsRGetForestTrustInformation(struct dcesrv_call_state
|
|||||||
}
|
}
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return WERR_GENERAL_FAILURE;
|
return WERR_GENERAL_FAILURE;
|
||||||
}
|
}
|
||||||
@ -2223,7 +2223,7 @@ static NTSTATUS dcesrv_netr_GetForestTrustInformation(struct dcesrv_call_state *
|
|||||||
}
|
}
|
||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_UNSUCCESSFUL;
|
return NT_STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ static NTSTATUS dcesrv_samr_Connect(struct dcesrv_call_state *dce_call, TALLOC_C
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* make sure the sam database is accessible */
|
/* 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, 0);
|
||||||
if (c_state->sam_ctx == NULL) {
|
if (c_state->sam_ctx == NULL) {
|
||||||
talloc_free(c_state);
|
talloc_free(c_state);
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
@ -4098,7 +4098,7 @@ static NTSTATUS dcesrv_samr_GetDomPwInfo(struct dcesrv_call_state *dce_call, TAL
|
|||||||
|
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call,
|
|||||||
* hashes. */
|
* hashes. */
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
system_session(dce_call->conn->dce_ctx->lp_ctx));
|
system_session(dce_call->conn->dce_ctx->lp_ctx), 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call,
|
|||||||
/* Start a SAM with user privileges for the password change */
|
/* Start a SAM with user privileges for the password change */
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call,
|
|||||||
* hashes. */
|
* hashes. */
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
system_session(dce_call->conn->dce_ctx->lp_ctx));
|
system_session(dce_call->conn->dce_ctx->lp_ctx), 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -261,7 +261,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call,
|
|||||||
/* Connect to a SAMDB with user privileges for the password change */
|
/* Connect to a SAMDB with user privileges for the password change */
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -335,7 +335,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
|
|||||||
* hashes. */
|
* hashes. */
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
system_session(dce_call->conn->dce_ctx->lp_ctx));
|
system_session(dce_call->conn->dce_ctx->lp_ctx), 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
@ -413,7 +413,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
|
|||||||
/* Connect to a SAMDB with user privileges for the password change */
|
/* Connect to a SAMDB with user privileges for the password change */
|
||||||
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
|
||||||
dce_call->conn->dce_ctx->lp_ctx,
|
dce_call->conn->dce_ctx->lp_ctx,
|
||||||
dce_call->conn->auth_state.session_info);
|
dce_call->conn->auth_state.session_info, 0);
|
||||||
if (sam_ctx == NULL) {
|
if (sam_ctx == NULL) {
|
||||||
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
return NT_STATUS_INVALID_SYSTEM_SERVICE;
|
||||||
}
|
}
|
||||||
|
@ -1627,7 +1627,7 @@ static NTSTATUS trans2_getdfsreferral(struct smbsrv_request *req,
|
|||||||
context = talloc_new(req);
|
context = talloc_new(req);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(context);
|
NT_STATUS_HAVE_NO_MEMORY(context);
|
||||||
|
|
||||||
ldb = samdb_connect(context, req->tcon->ntvfs->event_ctx, lp_ctx, system_session(lp_ctx));
|
ldb = samdb_connect(context, req->tcon->ntvfs->event_ctx, lp_ctx, system_session(lp_ctx), 0);
|
||||||
if (ldb == NULL) {
|
if (ldb == NULL) {
|
||||||
DEBUG(2,(__location__ ": Failed to open samdb\n"));
|
DEBUG(2,(__location__ ": Failed to open samdb\n"));
|
||||||
talloc_free(context);
|
talloc_free(context);
|
||||||
|
Loading…
Reference in New Issue
Block a user