]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify callers of messaging_send()
authorVolker Lendecke <vl@samba.org>
Tue, 30 Dec 2025 09:30:24 +0000 (10:30 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 7 Jan 2026 09:57:40 +0000 (09:57 +0000)
It deals fine with a NULL argument

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
lib/audit_logging/audit_logging.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/smbd/server.c
source3/smbd/smb1_sesssetup.c
source3/smbd/smb2_process.c
source3/torture/msgtest.c

index 8ed15edffb6acdb1ea115fd03dd0373e6e3f8889..e2fe4b0edb765350a493e5ac532ab2087ae454ec 100644 (file)
@@ -186,11 +186,7 @@ static NTSTATUS get_event_server(
         * without waiting
         */
        for (i = 0; i < num_servers; i++) {
-               status = imessaging_send(
-                       msg_ctx,
-                       servers[i],
-                       MSG_PING,
-                       &data_blob_null);
+               status = imessaging_send(msg_ctx, servers[i], MSG_PING, NULL);
                if (NT_STATUS_IS_OK(status)) {
                        *event_server = servers[i];
                        TALLOC_FREE(frame);
index 8bc4328862a4cbf9431c78067c9f85b4151bd682..09ec334d5a9fa8bdae791a84eb5f675a13717d89 100644 (file)
@@ -1711,7 +1711,8 @@ WERROR _srvsvc_NetSessDel(struct pipes_struct *p,
 
                ntstat = messaging_send(p->msg_ctx,
                                        session_list[snum].pid,
-                                       MSG_SHUTDOWN, &data_blob_null);
+                                       MSG_SHUTDOWN,
+                                       NULL);
 
                if (NT_STATUS_IS_OK(ntstat))
                        werr = WERR_OK;
index 0d5c434735310360d806fbbb811fbf454feefc7b..80e96b04860ccb653924ac093530063323d016f2 100644 (file)
@@ -870,7 +870,7 @@ static void cleanupd_started(struct tevent_req *req)
        status = messaging_send(parent->msg_ctx,
                                parent->cleanupd,
                                MSG_SMB_NOTIFY_CLEANUP,
-                               &data_blob_null);
+                               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                DBG_ERR("messaging_send returned %s\n",
                        nt_errstr(status));
@@ -949,7 +949,7 @@ static void remove_child_pid(struct smbd_parent_context *parent,
                status = messaging_send(parent->msg_ctx,
                                        parent->cleanupd,
                                        MSG_SMB_NOTIFY_CLEANUP,
-                                       &data_blob_null);
+                                       NULL);
                if (!NT_STATUS_IS_OK(status)) {
                        DBG_ERR("messaging_send returned %s\n",
                                nt_errstr(status));
index b191e3848b9ea95c19cfafdba54e1a5cfca5a97b..fde52d721fc3b07861b45bb2cc0a96e98270c707 100644 (file)
@@ -540,8 +540,7 @@ static int shutdown_other_smbds(struct smbXsrv_session_global0 *session,
                  "(IP %s)\n", (unsigned int)procid_to_pid(&pid),
                  state->ip));
 
-       messaging_send(state->msg_ctx, pid, MSG_SHUTDOWN,
-                      &data_blob_null);
+       messaging_send(state->msg_ctx, pid, MSG_SHUTDOWN, NULL);
        return 0;
 }
 
index c7fe20dd92879e3819b4eaf5a97ec8f7b2c610f6..9290714e8ae5e028d54e12a253e588fe0f329009 100644 (file)
@@ -1616,7 +1616,8 @@ static bool deadtime_fn(const struct timeval *now, void *private_data)
                DEBUG( 2, ( "Closing idle connection\n" ) );
                messaging_send(sconn->msg_ctx,
                               messaging_server_id(sconn->msg_ctx),
-                              MSG_SHUTDOWN, &data_blob_null);
+                              MSG_SHUTDOWN,
+                              NULL);
                return False;
        }
 
index 1d2a8a9b1c86275a74d6cd11ec23cd6d6858e3a4..70f9520aea74053efb5606168929aa9fe34365bb 100644 (file)
@@ -74,8 +74,7 @@ static void pong_message(struct messaging_context *msg_ctx,
        messaging_register(msg_ctx, NULL, MSG_PONG, pong_message);
 
        for (i=0;i<n;i++) {
-               messaging_send(msg_ctx, pid_to_procid(pid), MSG_PING,
-                              &data_blob_null);
+               messaging_send(msg_ctx, pid_to_procid(pid), MSG_PING, NULL);
        }
 
        while (pong_count < i) {
@@ -91,8 +90,10 @@ static void pong_message(struct messaging_context *msg_ctx,
        strlcpy(buf, "1234567890", sizeof(buf));
 
        for (i=0;i<n;i++) {
-               messaging_send(msg_ctx, messaging_server_id(msg_ctx), MSG_PING,
-                              &data_blob_null);
+               messaging_send(msg_ctx,
+                              messaging_server_id(msg_ctx),
+                              MSG_PING,
+                              NULL);
                messaging_send_buf(msg_ctx, messaging_server_id(msg_ctx),
                                   MSG_PING,(uint8_t *)buf, 11);
        }
@@ -134,10 +135,11 @@ static void pong_message(struct messaging_context *msg_ctx,
                                                   MSG_PING,
                                                   (uint8_t *)buf, 11)))
                           ping_count++;
-                       if(NT_STATUS_IS_OK(messaging_send(
-                                                  msg_ctx, pid_to_procid(pid),
-                                                  MSG_PING, &data_blob_null)))
-                          ping_count++;
+                       if (NT_STATUS_IS_OK(messaging_send(msg_ctx,
+                                                          pid_to_procid(pid),
+                                                          MSG_PING,
+                                                          NULL)))
+                               ping_count++;
 
                        while (ping_count > pong_count + 20) {
                                ret = tevent_loop_once(evt_ctx);