3
0
Fork 0
forked from mirrors/nixpkgs

nixos/virtualbox/hostonlyif: Fix writing to /root.

Creates unnecessary cruft in the root users home directory, which we
really don't need. Except the log, but therefore we now cat the log to
stderr and the private temporary directory is cleaned up afterwards.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
(cherry picked from commit d85fabd68c)
This commit is contained in:
aszlig 2014-12-15 19:12:58 +01:00
parent c141582aaf
commit 0a5535ffd6
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
2 changed files with 4 additions and 0 deletions

View file

@ -97,10 +97,13 @@ in
path = [ virtualbox ];
serviceConfig.RemainAfterExit = true;
serviceConfig.Type = "oneshot";
serviceConfig.PrivateTmp = true;
environment.VBOX_USER_HOME = "/tmp";
script =
''
if ! [ -e /sys/class/net/vboxnet0 ]; then
VBoxManage hostonlyif create
cat /tmp/VBoxSVC.log >&2
fi
'';
postStop =

View file

@ -348,6 +348,7 @@ in {
subtest "privilege-escalation", sub {
$machine->fail("test -e '/root/VirtualBox VMs'");
$machine->fail("test -e '/root/.config/VirtualBox'");
$machine->succeed("test -e '/home/alice/VirtualBox VMs'");
};