mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
linux-container: Reset jailed root permissions.
* gnu/build/linux-container.scm (mount-file-systems): Add 'chmod' call. * tests/containers.scm ("call-with-container, mnt namespace, root permissions"): New test.
This commit is contained in:
parent
7dc19c33fc
commit
e748183538
2 changed files with 10 additions and 1 deletions
|
@ -170,7 +170,8 @@ (define* (mount* source target type #:optional (flags 0) options
|
|||
(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))
|
||||
|
|
|
@ -133,6 +133,14 @@ (define (skip-if-unsupported)
|
|||
(lambda ()
|
||||
(primitive-exit 0)))))
|
||||
|
||||
(skip-if-unsupported)
|
||||
(test-assert "call-with-container, mnt namespace, root permissions"
|
||||
(zero?
|
||||
(call-with-container '()
|
||||
(lambda ()
|
||||
(assert-exit (= #o755 (stat:perms (lstat "/")))))
|
||||
#:namespaces '(user mnt))))
|
||||
|
||||
(skip-if-unsupported)
|
||||
(test-assert "container-excursion"
|
||||
(call-with-temporary-directory
|
||||
|
|
Loading…
Reference in a new issue