View | Details | Raw Unified
Collapse All | Expand All

(-) dspam_logrotate (+10 lines)
 Lines 36-41    Link Here 
    my($printStats);
    my($printStats);
    ($filename, $cutoffTimestamp, $printStats) = @_;
    ($filename, $cutoffTimestamp, $printStats) = @_;
    #preserve timestamps and ownership of the files
    my ( $mode, $uid, $gid ) = ( stat($filename) )[ 2, 4, 5 ];
    $mode = $mode & 07777;
    # Generate names for the temporary files.
    # Generate names for the temporary files.
    my($tempInputFile) = $filename . ".in";
    my($tempInputFile) = $filename . ".in";
    my($tempOutputFile) = $filename . ".out";
    my($tempOutputFile) = $filename . ".out";
 Lines 79-84    Link Here 
    # Rename our temporary output file to the original log file name.
    # Rename our temporary output file to the original log file name.
    close OUTFILE;
    close OUTFILE;
    #apply previous permissions and ownerships to temp file before renaming
    chmod $mode, $tempOutputFile;
    chown $uid, $gid, $tempOutputFile;
    rename $tempOutputFile, $filename;
    rename $tempOutputFile, $filename;
    # Remove our temporary input file.
    # Remove our temporary input file.