add format to vm.conf, potential CVE-2010-3851

This commit is contained in:
mischa 2021-01-19 19:59:07 +01:00
parent fd0e54e9e2
commit 90bafb5cf7

View File

@ -27,6 +27,7 @@
# 2020/05/24 changed: add staggered option to vm.conf, leave disable for now # 2020/05/24 changed: add staggered option to vm.conf, leave disable for now
# 2020/09/20 changed: add agentx option to vm.conf for OpenBSD 6.9 # 2020/09/20 changed: add agentx option to vm.conf for OpenBSD 6.9
# 2020/10/25 changes: doas.conf for pkill option, so it works again # 2020/10/25 changes: doas.conf for pkill option, so it works again
# 2021/01/19 changes: add format of disk images in vm.conf (CVE-2010-3851), thanx Johan Finnved
# #
use 5.024; use 5.024;
use strict; use strict;
@ -114,8 +115,8 @@ sub render_vm_conf {
printf $fh_vm "\towner %s\n", $_owner; printf $fh_vm "\towner %s\n", $_owner;
printf $fh_vm "\tmemory %s\n", $_memory if $_memory; printf $fh_vm "\tmemory %s\n", $_memory if $_memory;
printf $fh_vm "\tboot \"%s\"\n", $_boot if (! -e $_disk); printf $fh_vm "\tboot \"%s\"\n", $_boot if (! -e $_disk);
printf $fh_vm "\tdisk \"%s\"\n", $_disk; printf $fh_vm "\tdisk \"%s\" format %s\n", $_disk, $_disk_format;
printf $fh_vm "\tdisk \"%s\"\n", $_disk2 if $_disk2; printf $fh_vm "\tdisk \"%s\" format %s\n", $_disk2, $_disk_format if $_disk2;
printf $fh_vm "\tinterface tap {\n"; printf $fh_vm "\tinterface tap {\n";
printf $fh_vm "\t\tswitch \"%s\"\n", $_switch; printf $fh_vm "\t\tswitch \"%s\"\n", $_switch;
printf $fh_vm "\t\tlladdr %s\n", $_mac; printf $fh_vm "\t\tlladdr %s\n", $_mac;