summaryrefslogtreecommitdiffstats
path: root/mailer.pl
diff options
context:
space:
mode:
Diffstat (limited to 'mailer.pl')
-rw-r--r--mailer.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/mailer.pl b/mailer.pl
index 2a74903..28b08f3 100644
--- a/mailer.pl
+++ b/mailer.pl
@@ -8,6 +8,7 @@ use Socket qw(AF_UNIX SOCK_STREAM PF_UNSPEC);
use OpenBSD::Pledge;
use OpenBSD::Unveil;
+my $base_dir = '/var/www/var/lex';
my $dict_dir = '/var/www/var/lex/dict';
my $state_file = '/var/www/var/lex/mailer.tsv';
my $to = 'me@example.com';
@@ -78,8 +79,7 @@ if ($pid == 0) {
# Parent process: spaced-repetition + fair scheduling
close($child_sock);
-unveil($dict_dir, 'r') or log_die("unveil $dict_dir: $!");
-unveil($state_file, 'rwc') or log_die("unveil $state_file: $!");
+unveil($base_dir, 'rwc') or log_die("unveil $base_dir: $!");
unveil('/dev/log', 'w') or log_die("unveil /dev/log: $!");
unveil(); # Lock unveil rules
@@ -283,4 +283,4 @@ if (!rename($tmp_file, $state_file)) {
}
syslog(LOG_INFO, "Mailed %s to %s (next due: %s)", $selected_file, $to, $item->{next_due});
-closelog(); \ No newline at end of file
+closelog();