GNU bug report logs -
#44261
running a daemon with userns in relocateble pack breaks
Previous Next
Reported by: Jan Nieuwenhuizen <janneke <at> gnu.org>
Date: Tue, 27 Oct 2020 19:50:01 UTC
Severity: important
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 44261 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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
[0001-pack-Support-running-of-daemons-in-user-namespace-ba.patch (text/x-patch, inline)]
From fd3104608c3fa6a2375b6c7df0862e5479976b39 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke <at> 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 <at> 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 <at> gnu.org>
+ Copyright (C) 2020 Jan (janneke) Nieuwenhuizen <janneke <at> 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 <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
[Message part 3 (text/plain, inline)]
--
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
This bug report was last modified 4 years and 205 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.