[PATCH] ipc: use /run/swupdate as default socket directory instead of /tmp

25 views
Skip to first unread message

Badrikesh Prusty

unread,
Feb 5, 2026, 6:08:32 AM (10 days ago) Feb 5
to swup...@googlegroups.com, Badrikesh Prusty
Change the default socket directory for control and progress IPC from
/tmp to /run/swupdate.

This aligns with systemd conventions (RuntimeDirectory=swupdate) and
the documentation in `doc/source/swupdate.rst`. It also improves
security by avoiding world-writable /tmp and provides deterministic,
predictable paths for both daemon and clients.

Signed-off-by: Badrikesh Prusty <badrikes...@siemens.com>
---
ipc/network_ipc.c | 2 +-
ipc/progress_ipc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipc/network_ipc.c b/ipc/network_ipc.c
index 099587d4..e167d0b1 100644
--- a/ipc/network_ipc.c
+++ b/ipc/network_ipc.c
@@ -32,7 +32,7 @@ char *get_ctrl_socket(void) {
socketdir = getenv("TMPDIR");
}
if (!socketdir)
- socketdir = "/tmp";
+ socketdir = "/run/swupdate";
if (asprintf(&SOCKET_CTRL_PATH, "%s/%s", socketdir, SOCKET_CTRL_DEFAULT) == -1)
return (char *)"/tmp/"SOCKET_CTRL_DEFAULT;
}
diff --git a/ipc/progress_ipc.c b/ipc/progress_ipc.c
index d3689271..382a83c9 100644
--- a/ipc/progress_ipc.c
+++ b/ipc/progress_ipc.c
@@ -41,7 +41,7 @@ char *get_prog_socket(void) {
socketdir = getenv("TMPDIR");
}
if(!socketdir){
- socketdir = "/tmp";
+ socketdir = "/run/swupdate";
}
if (asprintf(&SOCKET_PROGRESS_PATH, "%s/%s", socketdir, SOCKET_PROGRESS_DEFAULT) == -1)
return (char *)"/tmp/"SOCKET_PROGRESS_DEFAULT;
--
2.39.5

Reply all
Reply to author
Forward
0 new messages