From: Volker Lendecke Date: Thu, 20 Jun 2024 18:25:24 +0000 (+0200) Subject: smbd: Simplify callers of notify_filter_string X-Git-Tag: tdb-1.4.11~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d86f9ff7fdd042b76cf03cd84668c98391652f5e;p=thirdparty%2Fsamba.git smbd: Simplify callers of notify_filter_string This is exactly the application talloc_tos() was made for Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Mon Jun 24 17:27:04 UTC 2024 on atb-devel-224 --- diff --git a/source3/smbd/smb1_nttrans.c b/source3/smbd/smb1_nttrans.c index 104d3c09656..f89cddb2501 100644 --- a/source3/smbd/smb1_nttrans.c +++ b/source3/smbd/smb1_nttrans.c @@ -1675,20 +1675,10 @@ static void call_nt_transact_notify_change(connection_struct *conn, return; } - { - char *filter_string; - - if (!(filter_string = notify_filter_string(NULL, filter))) { - reply_nterror(req,NT_STATUS_NO_MEMORY); - return; - } - - DEBUG(3,("call_nt_transact_notify_change: notify change " - "called on %s, filter = %s, recursive = %d\n", - fsp_str_dbg(fsp), filter_string, recursive)); - - TALLOC_FREE(filter_string); - } + DBG_NOTICE("notify change called on %s, filter = %s, recursive = %d\n", + fsp_str_dbg(fsp), + notify_filter_string(talloc_tos(), filter), + recursive); if((!fsp->fsp_flags.is_directory) || (conn != fsp->conn)) { reply_nterror(req, NT_STATUS_INVALID_PARAMETER); diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c index 8cccd90b3fb..2f4176f3fbb 100644 --- a/source3/smbd/smb2_notify.c +++ b/source3/smbd/smb2_notify.c @@ -240,20 +240,10 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx, state->smbreq = smbreq; smbreq->async_priv = (void *)req; - if (DEBUGLEVEL >= 3) { - char *filter_string; - - filter_string = notify_filter_string(NULL, in_completion_filter); - if (tevent_req_nomem(filter_string, req)) { - return tevent_req_post(req, ev); - } - - DEBUG(3,("smbd_smb2_notify_send: notify change " - "called on %s, filter = %s, recursive = %d\n", - fsp_str_dbg(fsp), filter_string, recursive)); - - TALLOC_FREE(filter_string); - } + DBG_NOTICE("notify change called on %s, filter = %s, recursive = %d\n", + fsp_str_dbg(fsp), + notify_filter_string(talloc_tos(), in_completion_filter), + recursive); if ((!fsp->fsp_flags.is_directory) || (conn != fsp->conn)) { tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);