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>
This commit is contained in:
parent
5d67b17901
commit
d85fabd68c
|
@ -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 =
|
||||
|
|
|
@ -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'");
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue