1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

CVE-2022-38023 libcli/auth: pass lp_ctx to netlogon_creds_cli_set_global_db()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15240

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Stefan Metzmacher 2022-11-30 14:46:59 +01:00
parent 830e865ba5
commit 992f39a2c8
4 changed files with 5 additions and 4 deletions

View File

@ -202,7 +202,8 @@ static NTSTATUS netlogon_creds_cli_context_common(
static struct db_context *netlogon_creds_cli_global_db; static struct db_context *netlogon_creds_cli_global_db;
NTSTATUS netlogon_creds_cli_set_global_db(struct db_context **db) NTSTATUS netlogon_creds_cli_set_global_db(struct loadparm_context *lp_ctx,
struct db_context **db)
{ {
if (netlogon_creds_cli_global_db != NULL) { if (netlogon_creds_cli_global_db != NULL) {
return NT_STATUS_INVALID_PARAMETER_MIX; return NT_STATUS_INVALID_PARAMETER_MIX;

View File

@ -31,7 +31,7 @@ struct messaging_context;
struct dcerpc_binding_handle; struct dcerpc_binding_handle;
struct db_context; struct db_context;
NTSTATUS netlogon_creds_cli_set_global_db(struct db_context **db); NTSTATUS netlogon_creds_cli_set_global_db(struct loadparm_context *lp_ctx, struct db_context **db);
NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx); NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx);
void netlogon_creds_cli_close_global_db(void); void netlogon_creds_cli_close_global_db(void);

View File

@ -76,7 +76,7 @@ NTSTATUS rpccli_pre_open_netlogon_creds(void)
return NT_STATUS_NO_MEMORY; return NT_STATUS_NO_MEMORY;
} }
status = netlogon_creds_cli_set_global_db(&global_db); status = netlogon_creds_cli_set_global_db(lp_ctx, &global_db);
TALLOC_FREE(frame); TALLOC_FREE(frame);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
return status; return status;

View File

@ -82,7 +82,7 @@ int main(int argc, const char *argv[])
goto done; goto done;
} }
status = netlogon_creds_cli_set_global_db(&global_db); status = netlogon_creds_cli_set_global_db(lp_ctx, &global_db);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
fprintf(stderr, fprintf(stderr,
"netlogon_creds_cli_set_global_db failed: %s\n", "netlogon_creds_cli_set_global_db failed: %s\n",