chiark / gitweb /
Actual error messages
[modbot-mtm.git] / webstump / scripts / webstump.lib.pl
index 8397f8694cc8816fc4c94c81f5a5f68525b34280..c76d25dfd1e9f48ca99ba0377af52aad5df1f3d2 100644 (file)
@@ -185,8 +185,9 @@ sub init_webstump {
 
       next if ! -r $file;
 
-      open( FILE, $file );
+      open( FILE, $file ) or die $!;
       $addr = <FILE>;
+      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 "$? $!";
                 
 }