aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2022-06-25 09:29:10 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2022-06-25 09:31:03 -0700
commitfe4e279fb5adbb90e780dc13d1c7db9e94737d20 (patch)
tree5886e6180d64ed0a9d3a7047e8ee06a7118f6506
parentAdd the missing "second" to the closing time for voting. (diff)
downloadelections-fe4e279fb5adbb90e780dc13d1c7db9e94737d20.tar.gz
elections-fe4e279fb5adbb90e780dc13d1c7db9e94737d20.tar.bz2
elections-fe4e279fb5adbb90e780dc13d1c7db9e94737d20.zip
statify: fix chown
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xstatify5
1 files changed, 3 insertions, 2 deletions
diff --git a/statify b/statify
index 752c78d..b7c9396 100755
--- a/statify
+++ b/statify
@@ -108,14 +108,15 @@ for my $election_name (keys %open_elections) {
.sprintf("Pending Turnout: %02.3f%%\n", ($count_submit+$count_pending)*100.0/$count_voters);
print "$results_buffer\n";
- umask 057;
+ umask 077;
for my $officialname (@officials) {
my $fn = catfile('/home', $officialname, 'voter-turnout-'.$election_name);
open(F, '>', $fn) or
die("failed to open voter turnout file ($fn): $!");
print F $results_buffer;
close F;
- chown ((getpwnam($officialname))[2]), 0, ($fn) or
+ my $uid = (getpwnam($officialname))[2];
+ chown($uid, -1, $fn) or
die("failed to chown voter turnout file ($fn): $!");
}
}