From: "Ludovic Courtès" <ludo@gnu.org>
To: Ulrich Baum <ulrich.baum@ubaum.de>
Cc: 67867-done@debbugs.gnu.org
Subject: bug#67867: [PATCH shepherd] service: fix ownership+permissions on Unix sockets
Date: Tue, 19 Dec 2023 23:38:57 +0100 [thread overview]
Message-ID: <87a5q5izr2.fsf@gnu.org> (raw)
In-Reply-To: <656849315.83800.1702820292582@office.mailbox.org> (Ulrich Baum's message of "Sun, 17 Dec 2023 14:38:12 +0100 (CET)")
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’.
prev parent reply other threads:[~2023-12-19 22:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-17 13:38 [bug#67867] [PATCH shepherd] service: fix ownership+permissions on Unix sockets Ulrich Baum
2023-12-19 22:38 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a5q5izr2.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=67867-done@debbugs.gnu.org \
--cc=ulrich.baum@ubaum.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).