diff options
-rwxr-xr-x | bin/mapsecrets2access_user | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/mapsecrets2access_user b/bin/mapsecrets2access_user index b34e0321a..3fcd5069b 100755 --- a/bin/mapsecrets2access_user +++ b/bin/mapsecrets2access_user @@ -46,7 +46,7 @@ unless ( $supergroup ) { my $supergroupnum = $supergroup->groupnum; my $mapsecrets = '/usr/local/etc/freeside/mapsecrets'; -open(MAPSECRETS, "<$mapsecrets"); +open(MAPSECRETS, "<$mapsecrets") or die $!; while (<MAPSECRETS>) { /([\w]+)\s+secrets\s*$/ or die "unparsable line in mapsecrets: $_"; my $username = $1; @@ -70,9 +70,10 @@ while (<MAPSECRETS>) { die $aug_error if $aug_error; } +close MAPSECRETS; # okay to clobber mapsecrets now i guess cp $mapsecrets, "$mapsecrets.bak$$"; -open(MAPSECRETS, ">$mapsecrets"); +open(MAPSECRETS, ">$mapsecrets") or die $!; print MAPSECRETS '* secrets'. "\n"; -close MAPSECRETS; +close MAPSECRETS or die $!; |