diff --git a/deploy.pl b/deploy.pl index 4a4cc95..85f2dfd 100755 --- a/deploy.pl +++ b/deploy.pl @@ -28,6 +28,7 @@ # 2020/09/20 changed: add agentx option to vm.conf for OpenBSD 7.0 # 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 +# 2021/05/18 changes: restrict the install.conf files in /var/www # use 5.024; use strict; @@ -213,6 +214,8 @@ sub render_install_conf { printf $fh_install "Continue anyway = yes\n"; printf $fh_install "Continue without verification = yes\n"; close $fh_install; + chmod 0440, "$_htdocs/$_mac-install.conf"; + chown 67, 67, "$_htdocs/$_mac-install.conf"; printf "%16s %s created\n", $_instance, $_htdocs . "/" . $_mac . "-install.conf"; } elsif (-e $_disk && -e "$_htdocs/$_mac-install.conf") { unlink "$_htdocs/$_mac-install.conf" or warn "Unable to unlink file: $!\n"; diff --git a/notify.pl b/notify.pl index f97174e..6a67111 100755 --- a/notify.pl +++ b/notify.pl @@ -77,7 +77,7 @@ sub mailout { my $template = "$_tmpl/email-$function.txt"; my $server_number = $1 if $_server =~ /([0-9]+)/; - my $oddeven = $server_number % 2; + my $evenodd = $server_number % 2; my $year = strftime("%Y", localtime); my $month = strftime("%m", localtime); @@ -127,7 +127,7 @@ sub mailout { if ($row =~ /TIME\((.*)\)/) { my @TIMES = split(/,/, $1); - $row =~ s/TIME\(.*\)/$TIMES[$oddeven]/g; + $row =~ s/TIME\(.*\)/$TIMES[$evenodd]/g; } print $fh_email "$row\n"; }