From d61545a5b3531ecf22fa310a66ba85ae8165cadf Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 15 Sep 2017 19:39:01 -0700 Subject: [PATCH] netlogon_creds_cli: Add netlogon_creds_cli_delete_lck Like netlogon_creds_cli_delete, protected by netlogon_creds_cli_lck instead of netlogon_creds_cli_lock. Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- libcli/auth/netlogon_creds_cli.c | 13 +++++++++++++ libcli/auth/netlogon_creds_cli.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c index 06d7260c8b6..248fb371fed 100644 --- a/libcli/auth/netlogon_creds_cli.c +++ b/libcli/auth/netlogon_creds_cli.c @@ -677,6 +677,19 @@ static NTSTATUS netlogon_creds_cli_delete_internal( return status; } +NTSTATUS netlogon_creds_cli_delete_lck( + struct netlogon_creds_cli_context *context) +{ + NTSTATUS status; + + if (context->db.lock != NETLOGON_CREDS_CLI_LCK_EXCLUSIVE) { + return NT_STATUS_NOT_LOCKED; + } + + status = netlogon_creds_cli_delete_internal(context); + return status; +} + NTSTATUS netlogon_creds_cli_delete(struct netlogon_creds_cli_context *context, struct netlogon_creds_CredentialState *creds) { diff --git a/libcli/auth/netlogon_creds_cli.h b/libcli/auth/netlogon_creds_cli.h index b3e30eb67bf..62d11ac283e 100644 --- a/libcli/auth/netlogon_creds_cli.h +++ b/libcli/auth/netlogon_creds_cli.h @@ -65,6 +65,8 @@ NTSTATUS netlogon_creds_cli_store(struct netlogon_creds_cli_context *context, struct netlogon_creds_CredentialState *creds); NTSTATUS netlogon_creds_cli_delete(struct netlogon_creds_cli_context *context, struct netlogon_creds_CredentialState *creds); +NTSTATUS netlogon_creds_cli_delete_lck( + struct netlogon_creds_cli_context *context); struct tevent_req *netlogon_creds_cli_lock_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,