chiark / gitweb /
Use umask 007; preserve perms on logfiles
[modbot-mtm.git] / webstump / scripts / file-message.pl
index 59d5f172b7bd08a1de84dc27d7558b434c1412e4..a7a07d29edf7ad88dae599358999c1ebde2e80ea 100755 (executable)
@@ -7,7 +7,7 @@
 # Figure out the home directory
 #
 
-umask 022;
+umask 007;
 
 if( !($0 =~ /\/scripts\/file-message\.pl$/) ) {
   die "This script can only be called with full path name!!!";
@@ -77,16 +77,16 @@ chmod 0755, $queue_dir;
 die "$queue_dir does not exist or is not writable"
        if( ! -d $queue_dir || ! -w $queue_dir );
 
-open( PROLOG, ">$directory/stump-prolog.txt" );
-print PROLOG $prolog;
-close( PROLOG );
+open( PROLOG, ">$directory/stump-prolog.txt" ) or die $!;
+print PROLOG $prolog or die $!;
+close( PROLOG ) or die $!;
 
 #open( FULL, ">$directory/full_message.txt" );
 #print FULL $entity->as_string;
 #close( FULL );
 
 my $dir = "dir_$time" . "_$$";
-rename $directory, "$queue_dir/$dir";
+rename $directory, "$queue_dir/$dir" or die $!;
 
 &init_webstump;
 $request{"newsgroup"} = $newsgroup;