diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c index 51b30a14b78..37bdf742570 100644 --- a/libcli/auth/netlogon_creds_cli.c +++ b/libcli/auth/netlogon_creds_cli.c @@ -199,6 +199,16 @@ static NTSTATUS netlogon_creds_cli_context_common( static struct db_context *netlogon_creds_cli_global_db; +NTSTATUS netlogon_creds_cli_set_global_db(struct db_context **db) +{ + if (netlogon_creds_cli_global_db != NULL) { + return NT_STATUS_INVALID_PARAMETER_MIX; + } + + netlogon_creds_cli_global_db = talloc_move(talloc_autofree_context(), db); + return NT_STATUS_OK; +} + NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx) { char *fname; diff --git a/libcli/auth/netlogon_creds_cli.h b/libcli/auth/netlogon_creds_cli.h index 5bd8bd3b691..90d01826d06 100644 --- a/libcli/auth/netlogon_creds_cli.h +++ b/libcli/auth/netlogon_creds_cli.h @@ -28,7 +28,9 @@ struct netlogon_creds_cli_context; struct messaging_context; struct dcerpc_binding_handle; +struct db_context; +NTSTATUS netlogon_creds_cli_set_global_db(struct db_context **db); NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx); NTSTATUS netlogon_creds_cli_context_global(struct loadparm_context *lp_ctx,