[Logwatch] Output file permissions

MrC lists-logwatch at cappella.us
Thu Sep 20 13:34:44 MST 2007


Korthrun wrote:
>> Korthrun wrote:
>>> Hello,
>>>
>>>       Is there a configuration directive or the like that I'm not
>>> finding that affects the permissions of the html output file? I'd like
>>> to have it output into a .htaccess protected web accessible directory,
>>> but the file is written 0600 and I don't run Apache as root.
>>>
>>> Thanks
>>>
>> It doesn't appear that logwatch specifically sets permission when it
>> creates files.  Therefore, they are under control of the running user's
>> umask.  Before running logwatch, relax the umask restrictions to your
>> liking, such as:
>>
>>     umask 000
>>     logwatch ...
>>
>> or
>>     umask 022
>>     logwatch ...
>>
>> MrC
>>
> Hmm my version specificly sets it to 0177.
> Lines 781 and 782:
> #Set very strict permissions because we deal with security logs
> umask 0177;
> 
 > This is set for dealing with the temporary files from what I'm
 > reading, though I'm no perl champ.
 >

Sorry, I don't know how I missed that.  I must have not search upwards 
after my search for open calls.

> I tried changing it at the top of the "output" subroutine, to no avail.

The file is created in the last line I show here for initprint.

sub initprint {
    return if $printing;

    my $OStitle;
    $OStitle = $OSname;
    $OStitle = "Solaris" if ($OSname eq "SunOS" && $release >= 2);

    if ($Config{'output'} eq "stdout") { #8.0 start with others?
       *OUTFILE = *STDOUT;
    } elsif ($Config{'output'} eq "file") {
       open(OUTFILE,">>" . $Config{'filename'}) or die "Can't open 
output file: $Config{'filename'} $!\n";

But why not just run chmod after logwatch completes ?

MrC


More information about the Logwatch mailing list