diff mbox series

[bug#43673] linux-container: Reset jailed root permissions.

Message ID 20200928143433.31994-1-jlicht@fsfe.org
State Accepted
Headers show
Series [bug#43673] linux-container: Reset jailed root permissions. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Jelle Licht Sept. 28, 2020, 2:34 p.m. UTC
* gnu/build/linux-container.scm (mount-file-systems): Add 'chmod' call.
---
 gnu/build/linux-container.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès Sept. 29, 2020, 8:28 p.m. UTC | #1
Hi,

Jelle Licht <jlicht@fsfe.org> skribis:

> * gnu/build/linux-container.scm (mount-file-systems): Add 'chmod' call.

Well done!  Could you add a test checking (stat:perms (lstat "/")) in
tests/containers.scm?

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm
index 2d4de788df..4a8bed5a9a 100644
--- a/gnu/build/linux-container.scm
+++ b/gnu/build/linux-container.scm
@@ -170,7 +170,8 @@  for the process."
     (pivot-root root put-old)
     (chdir "/")
     (umount "real-root" MNT_DETACH)
-    (rmdir "real-root")))
+    (rmdir "real-root")
+    (chmod "/" #o755)))
 
 (define* (initialize-user-namespace pid host-uids
                                     #:key (guest-uid 0) (guest-gid 0))