unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: 44261@debbugs.gnu.org
Subject: bug#44261: running a daemon with userns in relocateble pack breaks
Date: Tue, 27 Oct 2020 21:09:02 +0100	[thread overview]
Message-ID: <875z6v2zz5.fsf@gnu.org> (raw)
In-Reply-To: <87blgn30w0.fsf@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 27 Oct 2020 20:49:19 +0100")

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

Jan Nieuwenhuizen writes:

Hi!

I tried the hint from Ludovic to use MS_PRIVATE in the attached patch
and that works for me; not sure if we want a test and even less sure how
to write that...

Janneke


[-- Attachment #2: 0001-pack-Support-running-of-daemons-in-user-namespace-ba.patch --]
[-- Type: text/x-patch, Size: 1748 bytes --]

From fd3104608c3fa6a2375b6c7df0862e5479976b39 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Tue, 27 Oct 2020 20:55:11 +0100
Subject: [PATCH] pack: Support running of daemons in user namespace-based
 relocation.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

Add relocation via ld.so and fakechroot.
Fixes <https://bugs.gnu.org/44261>.

* gnu/packages/aux-files/run-in-namespace.c (bind_mount): Add 'MS_PRIVATE' to
avoid unmounting the bind mount when parent process exits.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/packages/aux-files/run-in-namespace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/aux-files/run-in-namespace.c b/gnu/packages/aux-files/run-in-namespace.c
index 52a16a5362..67cea4fcd5 100644
--- a/gnu/packages/aux-files/run-in-namespace.c
+++ b/gnu/packages/aux-files/run-in-namespace.c
@@ -1,5 +1,6 @@
 /* GNU Guix --- Functional package management for GNU
    Copyright (C) 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+   Copyright (C) 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 
    This file is part of GNU Guix.
 
@@ -138,7 +139,7 @@ bind_mount (const char *source, const struct dirent *entry,
     close (open (target, O_WRONLY | O_CREAT));
 
   return mount (source, target, "none",
-		MS_BIND | MS_REC | MS_RDONLY, NULL);
+		MS_BIND | MS_PRIVATE | MS_REC | MS_RDONLY, NULL);
 }
 
 #if HAVE_EXEC_WITH_LOADER
-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


[-- Attachment #3: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

  reply	other threads:[~2020-10-27 20:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 19:49 bug#44261: running a daemon with userns in relocateble pack breaks Jan Nieuwenhuizen
2020-10-27 20:09 ` Jan Nieuwenhuizen [this message]
2020-10-30 21:33   ` Ludovic Courtès
2020-10-30 22:05     ` Jan Nieuwenhuizen
2020-10-31 22:19       ` Ludovic Courtès
2020-11-01  6:07         ` Jan Nieuwenhuizen

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=875z6v2zz5.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=44261@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 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).