mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-28 20:12:11 +02:00
environment: Create /etc/group in containers.
Reported by Pierre Neidhardt <mail@ambrevar.xyz>. * guix/scripts/environment.scm (launch-environment/container): Create GROUPS and call 'write-group'. * tests/guix-environment-container.sh: Test it.
This commit is contained in:
@@ -46,9 +46,15 @@ fi
|
||||
|
||||
if test "x$USER" = "x"; then USER="`id -un`"; fi
|
||||
|
||||
# Check whether /etc/passwd is valid.
|
||||
# Check whether /etc/passwd and /etc/group are valid.
|
||||
guix environment -C --ad-hoc --bootstrap guile-bootstrap \
|
||||
-- guile -c "(exit (string=? \"$USER\" (passwd:name (getpwuid (getuid)))))"
|
||||
guix environment -C --ad-hoc --bootstrap guile-bootstrap \
|
||||
-- guile -c '(exit (string? (group:name (getgrgid (getgid)))))'
|
||||
guix environment -C --ad-hoc --bootstrap guile-bootstrap \
|
||||
-- guile -c '(use-modules (srfi srfi-1))
|
||||
(exit (every group:name
|
||||
(map getgrgid (vector->list (getgroups)))))'
|
||||
|
||||
# Make sure file-not-found errors in mounts are reported.
|
||||
if guix environment --container --ad-hoc --bootstrap guile-bootstrap \
|
||||
|
||||
Reference in New Issue
Block a user