emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67867: closed ([PATCH shepherd] service: fix ownership+permissions o


From: GNU bug Tracking System
Subject: bug#67867: closed ([PATCH shepherd] service: fix ownership+permissions on Unix sockets)
Date: Tue, 19 Dec 2023 22:40:02 +0000

Your message dated Tue, 19 Dec 2023 23:38:57 +0100
with message-id <87a5q5izr2.fsf@gnu.org>
and subject line Re: bug#67867: [PATCH shepherd] service: fix 
ownership+permissions on Unix sockets
has caused the debbugs.gnu.org bug report #67867,
regarding [PATCH shepherd] service: fix ownership+permissions on Unix sockets
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
67867: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67867
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH shepherd] service: fix ownership+permissions on Unix sockets Date: Sun, 17 Dec 2023 14:38:12 +0100 (CET)
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



--- End Message ---
--- Begin Message --- Subject: Re: bug#67867: [PATCH shepherd] service: fix ownership+permissions on Unix sockets Date: Tue, 19 Dec 2023 23:38:57 +0100 User-agent: Gnus/5.13 (Gnus v5.13)
Hi Ulrich,

Ulrich Baum <ulrich.baum@ubaum.de> skribis:

> 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

[...]

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

Good catch!  I was surprised that fchown(2) and fchmod(2) silently did
nothing, but that’s how it is.

Pushed together with a test, which allowed me to find a related bug
(more serious, because it’s about permissions on the socket’s
directory):

  9dfeb4e support: ‘mkdir-p’ sets permissions when directory already exists.
  f5b7411 service: Really set ownership and permissions on Unix sockets.

(BTW, I have just renamed ‘master’ to ‘main’, but ‘master’ hasn’t been
deleted yet from the server; make sure to pick ‘main’ and adjust your
Git config.)

Thanks,
Ludo’.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]