From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 60890@debbugs.gnu.org
Subject: bug#60890: least-authority-wrapper and make-forkexec-constructor composition problem
Date: Tue, 17 Jan 2023 14:30:03 -0500 [thread overview]
Message-ID: <87zgahyn5w.fsf@gmail.com> (raw)
Hi,
I'm creating a bug to keep track of a problem that was uncovered when
attempting to migrate the jami-service-type service to use the
least-authority-wrapper [0], to avoid forgetting about it.
It was found that using something like:
--8<---------------cut here---------------start------------->8---
(make-forkexec-constructor
(least-authority
(list (file-append coreutils "/bin/true"))
(mappings (delq 'user %namespaces))
#:user "nobody"
#:group "nobody"))
--8<---------------cut here---------------end--------------->8---
Would fail with EPERM, because in order to be able to drop the user
namespace, the CAP_SYS_ADMIN capability is required, but in the above
case, make-forkexec-constructor has already changed the user to
"nobody", which lacks such capability.
The solution proposed by Ludovic in would be to [1]:
> [...] add #:user and #:group to ‘least-authority-wrapper’ and
> have it call setuid/setgid. ‘make-forkexec-constructor’ doesn’t need to
> be modified, but the user simply won’t pass #:user and #:group to it.
[0] https://issues.guix.gnu.org/54786#16
[1] https://issues.guix.gnu.org/54786#17
--
Thanks,
Maxim
next reply other threads:[~2023-01-17 19:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 19:30 Maxim Cournoyer [this message]
2023-01-19 17:04 ` bug#60890: least-authority-wrapper and make-forkexec-constructor composition problem Ludovic Courtès
2023-01-20 13:42 ` Maxim Cournoyer
2024-11-12 5:54 ` Maxim Cournoyer
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=87zgahyn5w.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=60890@debbugs.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.