]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify callers of notify_filter_string
authorVolker Lendecke <vl@samba.org>
Thu, 20 Jun 2024 18:25:24 +0000 (20:25 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 24 Jun 2024 17:27:04 +0000 (17:27 +0000)
This is exactly the application talloc_tos() was made for

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jun 24 17:27:04 UTC 2024 on atb-devel-224

source3/smbd/smb1_nttrans.c
source3/smbd/smb2_notify.c

index 104d3c096567a06dc2b8dfdbcb74891b62b2a486..f89cddb25017b5eca608dd61631faa6a8c152b98 100644 (file)
@@ -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);
index 8cccd90b3fb03c257948cb479bc753c0bdfdf296..2f4176f3fbbfe98e13564bda454ed49995221a2e 100644 (file)
@@ -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);