From: Brice Waegeneire <brice@waegenei.re>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 52454@debbugs.gnu.org
Subject: [bug#52454] [PATCH v2 0/4] Ensure correct ownership of directory trees in services
Date: Tue, 21 Dec 2021 20:30:11 +0100 [thread overview]
Message-ID: <8735mleoxo.fsf_-_@waegenei.re> (raw)
In-Reply-To: <87zgoxmway.fsf_-_@gnu.org> ("Ludovic Courtès"'s message of "Sat, 18 Dec 2021 22:34:45 +0100")
Hello Ludo’,
Here is a second version of the patch set.
Ludovic Courtès <ludo@gnu.org> writes:
> [...]
>
> This has been discussed a few times: I wonder if we should simply chown
> service home directories systematically?
#45571¹ is one of such discussion. For services' home, I guess that's what we
should do, but it probably won't be sufficient as log or chache directories
usualy aren't in a home, but still need to chowned. The easiest and probably
least controversion would be to just replace current `chown` calls on
directories by `lchown-recursive`.
Seeing that we don't want static UID/GID mapping, like most other distros do, we
could try to implement something like systemd's dynamic users² approch.
> Brice Waegeneire <brice@waegenei.re> skribis:
>
>> * guix/build/syscalls.scm (lchown): New procedure.
>
> Would be nice to add even trivial tests to tests/syscalls.scm.
I wrote 4 tests, however the last two, the ones actually testing 'lchown' fail
bescause "/tmp" has it's sticky bit set, which prevent changing ownership of
files there. I tried to workaround this but didn't managed to.
> Unfortunately, this doesn’t work for service activation because when
> booting, activation snippets are run from the initrd’s Guile, which is
> statically linked and lacks dlopen.
>
> [...]
>
> For this strategy to work, you need to add ‘lchown’ in
> ‘guile-3.0-linux-syscalls.patch’ and to use ‘define-as-needed’ in (guix
> build syscalls).
Done and it fixes the check system for postgresql service.
¹ <https://issues.guix.gnu.org/45571>
² <https://0pointer.net/blog/dynamic-users-with-systemd.html>
Cheers,
- Brice
Brice Waegeneire (4):
syscalls: Add 'lchown'.
activation: Add 'lchown-recursive'.
services: postgresql: Ensure correct ownership of directory trees.
services: cuirass: Ensure correct ownership of directory trees.
gnu/build/activation.scm | 20 +++++-
.../patches/guile-3.0-linux-syscalls.patch | 33 ++++++++++
gnu/services/cuirass.scm | 18 +++---
gnu/services/databases.scm | 14 +++--
guix/build/syscalls.scm | 16 +++++
tests/syscalls.scm | 62 +++++++++++++++++++
6 files changed, 150 insertions(+), 13 deletions(-)
base-commit: 87e5502d406bfb44b61f7577b241602e02a3498e
--
2.34.0
next prev parent reply other threads:[~2021-12-21 19:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-12 18:28 [bug#52454] [PATCH 0/4] Ensure correct ownership of directory trees in services.Hello Guix, Brice Waegeneire
2021-12-12 18:36 ` [bug#52454] [PATCH 1/4] syscalls: Add 'lchown' Brice Waegeneire
2021-12-18 21:34 ` [bug#52454] [PATCH 0/4] Ensure correct ownership of directory trees in services.Hello Guix, Ludovic Courtès
2021-12-21 19:30 ` Brice Waegeneire [this message]
2021-12-21 19:36 ` [bug#52715] [PATCH v2 1/4] syscalls: Add 'lchown' Brice Waegeneire
2021-12-21 19:36 ` [bug#52713] [PATCH v2 2/4] activation: Add 'lchown-recursive' Brice Waegeneire
2021-12-21 19:36 ` [bug#52714] [PATCH v2 3/4] services: postgresql: Ensure correct ownership of directory trees Brice Waegeneire
2021-12-21 19:36 ` [bug#52712] [PATCH v2 4/4] services: cuirass: " Brice Waegeneire
2021-12-12 18:36 ` [bug#52454] [PATCH 2/4] activation: Add 'lchown-recursive' Brice Waegeneire
2021-12-12 18:36 ` [bug#52454] [PATCH 3/4] services: postgresql: Ensure correct ownership of directory trees Brice Waegeneire
2021-12-12 18:36 ` [bug#52454] [PATCH 4/4] services: cuirass: " Brice Waegeneire
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735mleoxo.fsf_-_@waegenei.re \
--to=brice@waegenei.re \
--cc=52454@debbugs.gnu.org \
--cc=ludo@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.