[freeside-commits] freeside/bin mapsecrets2access_user,1.2,1.3
Ivan,,,
ivan at wavetail.420.am
Mon Jun 19 05:47:57 PDT 2006
Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail:/tmp/cvs-serv16721
Modified Files:
mapsecrets2access_user
Log Message:
better error checking for this thrown-together bootstrapping script
Index: mapsecrets2access_user
===================================================================
RCS file: /home/cvs/cvsroot/freeside/bin/mapsecrets2access_user,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mapsecrets2access_user 19 Jun 2006 12:22:09 -0000 1.2
+++ mapsecrets2access_user 19 Jun 2006 12:47:55 -0000 1.3
@@ -46,7 +46,7 @@
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 @@
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 $!;
More information about the freeside-commits
mailing list