unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67867] [PATCH shepherd] service: fix ownership+permissions on Unix sockets
@ 2023-12-17 13:38 Ulrich Baum
  2023-12-19 22:38 ` bug#67867: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Baum @ 2023-12-17 13:38 UTC (permalink / raw)
  To: 67867

Previously, ownership and permissions of AF_UNIX sockets created by
make-inetd-constructor and make-systemd-constructor were not set,
leaving the socket with root:root and 755 permissions.

modules/shepherd/service.scm (endpoint->listening-socket): fix chown and
chmod calls
---
 modules/shepherd/service.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 41c6248..f22aaaf 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -1867,8 +1867,8 @@ retrying to bind it in one second.")
        (listen sock backlog)

        (when (= AF_UNIX (sockaddr:fam address))
-         (chown sock owner group)
-         (chmod sock #o666))
+         (chown (sockaddr:path address) owner group)
+         (chmod (sockaddr:path address) #o666))

        sock))))

--
2.43.0




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-19 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-17 13:38 [bug#67867] [PATCH shepherd] service: fix ownership+permissions on Unix sockets Ulrich Baum
2023-12-19 22:38 ` bug#67867: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).