From: Volker Lendecke Date: Tue, 30 Dec 2025 09:30:24 +0000 (+0100) Subject: smbd: Simplify callers of messaging_send() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c00ad9c89fefe77d8cd95a3d91c001fc7c03062;p=thirdparty%2Fsamba.git smbd: Simplify callers of messaging_send() It deals fine with a NULL argument Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/lib/audit_logging/audit_logging.c b/lib/audit_logging/audit_logging.c index 8ed15edffb6..e2fe4b0edb7 100644 --- a/lib/audit_logging/audit_logging.c +++ b/lib/audit_logging/audit_logging.c @@ -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); diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c index 8bc4328862a..09ec334d5a9 100644 --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c @@ -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; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 0d5c4347353..80e96b04860 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -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)); diff --git a/source3/smbd/smb1_sesssetup.c b/source3/smbd/smb1_sesssetup.c index b191e3848b9..fde52d721fc 100644 --- a/source3/smbd/smb1_sesssetup.c +++ b/source3/smbd/smb1_sesssetup.c @@ -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; } diff --git a/source3/smbd/smb2_process.c b/source3/smbd/smb2_process.c index c7fe20dd928..9290714e8ae 100644 --- a/source3/smbd/smb2_process.c +++ b/source3/smbd/smb2_process.c @@ -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; } diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index 1d2a8a9b1c8..70f9520aea7 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -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 pong_count + 20) { ret = tevent_loop_once(evt_ctx);