X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?p=modbot-mtm.git;a=blobdiff_plain;f=webstump%2Fscripts%2Fwebstump.lib.pl;fp=webstump%2Fscripts%2Fwebstump.lib.pl;h=c76d25dfd1e9f48ca99ba0377af52aad5df1f3d2;hp=8397f8694cc8816fc4c94c81f5a5f68525b34280;hb=acff1ba7277dfa00ee47688742f2a3910ea6c106;hpb=0f086a3142fbd6951cea31e37cb20ebf2c895ba6 diff --git a/webstump/scripts/webstump.lib.pl b/webstump/scripts/webstump.lib.pl index 8397f86..c76d25d 100644 --- a/webstump/scripts/webstump.lib.pl +++ b/webstump/scripts/webstump.lib.pl @@ -185,8 +185,9 @@ sub init_webstump { next if ! -r $file; - open( FILE, $file ); + open( FILE, $file ) or die $!; $addr = ; + defined $addr or die $! chop $addr; close( FILE ); @@ -197,8 +198,9 @@ sub init_webstump { } close( NEWSGROUPS ); - open( LOG, ">>$webstump_home/log/webstump.log" ); - print LOG "Call from $ENV{'REMOTE_ADDR'}, QUERY_STRING=$ENV{'QUERY_STRING'}\n"; + open( LOG, ">>$webstump_home/log/webstump.log" ) or die $!; + LOG->autoflush(1); + print LOG "Call from $ENV{'REMOTE_ADDR'}, QUERY_STRING=$ENV{'QUERY_STRING'}\n" or die $!; } # gets the directory name for the newsgroup @@ -511,9 +513,10 @@ sub email_message { my $sendmail_command = "$sendmail $recipient"; $sendmail_command =~ /(^.*$)/; $sendmail_command = $1; # untaint - open_pipe_for_writing( SENDMAIL, "$sendmail_command > /dev/null " ); - print SENDMAIL $message; - close( SENDMAIL ); + open_pipe_for_writing( SENDMAIL, "$sendmail_command > /dev/null " ) + or die $!; + print SENDMAIL $message or die $!; + close( SENDMAIL ) or die "$? $!"; }