move msg.sock from /var/lib/samba to /run/samba
authorMichael Tokarev <mjt@tls.msk.ru>
Tue, 26 Apr 2022 13:11:48 +0000 (16:11 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 25 Oct 2024 09:30:52 +0000 (12:30 +0300)
This moves a socket directory from /var/lib/samba to /run/samba.

https://lists.samba.org/archive/samba-technical/2022-April/137322.html

Gbp-Pq: Name move-msg.sock-from-var-lib-samba-to-run-samba.patch

source3/lib/messages.c
source4/lib/messaging/messaging.c

index b856a2889b1f5bb750e71dd0c3c0493b01ff3b60..46b99cb1c19611a40d2813d75e28f1266e12e853 100644 (file)
@@ -462,11 +462,6 @@ static int messaging_context_destructor(struct messaging_context *ctx)
        return 0;
 }
 
-static const char *private_path(const char *name)
-{
-       return talloc_asprintf(talloc_tos(), "%s/%s", lp_private_dir(), name);
-}
-
 static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx,
                                        struct tevent_context *ev,
                                        struct messaging_context **pmsg_ctx)
@@ -501,7 +496,7 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx,
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       priv_path = private_path("msg.sock");
+       priv_path = lock_path(talloc_tos(), "msg.sock");
        if (priv_path == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -664,7 +659,7 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
                msg_ctx->per_process_talloc_ctx,
                msg_ctx->event_ctx,
                &msg_ctx->id.unique_id,
-               private_path("msg.sock"),
+               lock_path(talloc_tos(), "msg.sock"),
                lck_path,
                messaging_recv_cb,
                msg_ctx,
index aa923165255c38602cc896c1f919a669d7dacfd3..901338058fbf59e3a080a6968861077e6e9fb5a9 100644 (file)
@@ -537,7 +537,7 @@ static struct imessaging_context *imessaging_init_internal(
                goto fail;
        }
 
-       msg->sock_dir = lpcfg_private_path(msg, lp_ctx, "msg.sock");
+       msg->sock_dir = lpcfg_lock_path(msg, lp_ctx, "msg.sock");
        if (msg->sock_dir == NULL) {
                goto fail;
        }