From 92b6e04f8539c2438e649c5baf3f70e2833fea09 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 11 Sep 2020 09:55:18 +0200 Subject: [PATCH] smbd: don't log success as error In 58bc493c77 the check for NT_STATUS_OK was removed, causing smbd to spam syslog with misleading ``failure`` messages: Sep 11 03:57:54 mail smbd[4813]: remove_share_mode_lease: leases_db_del failed: NT_STATUS_OK Sep 11 03:58:54 mail smbd[4813]: remove_share_mode_lease: leases_db_del failed: NT_STATUS_OK Sep 11 03:59:54 mail smbd[4813]: remove_share_mode_lease: leases_db_del failed: NT_STATUS_OK Sep 11 04:00:03 mail smbd[4798]: remove_share_mode_lease: leases_db_del failed: NT_STATUS_OK Sep 11 04:00:05 mail smbd[4798]: remove_share_mode_lease: leases_db_del failed: NT_STATUS_OK Reinstate the check; the code now follows the error handling logic as in 4.13. Signed-off-by: Philipp Gesang --- source3/locking/locking.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 5272a3dc829..4aeee0819a0 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -704,17 +704,20 @@ static void remove_share_mode_lease(struct share_mode_data *d, } { - int level = DBGLVL_DEBUG; NTSTATUS status; status = leases_db_del(&e->client_guid, &e->lease_key, &d->id); - if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { - level = DBGLVL_ERR; + if (!NT_STATUS_IS_OK(status)) { + int level = DBGLVL_DEBUG; + + if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { + level = DBGLVL_ERR; + } + DBG_PREFIX(level, ("leases_db_del failed: %s\n", + nt_errstr(status))); } - DBG_PREFIX(level, ("leases_db_del failed: %s\n", - nt_errstr(status))); } } -- 2.26.2