diff options
-rwxr-xr-x | statify | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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): $!"); } } |