Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Log-Dispatch CPAN distribution.

Report information
The Basics
Id: 28151
Status: resolved
Priority: 0/
Queue: Log-Dispatch

People
Owner: Nobody in particular
Requestors: kevin [...] theconfused.co.uk
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 2.18
Fixed in: 2.19



Subject: Check if permissions have changed on a file before attemting to change them
Log-Dispatcher-File-1.22 Perl 5.6.0 Solaris 10 A Log::Dispatch::File dispatcher may take a permissions parameter. There is no check made to determine if the permissions need to be changed. This means that if the owner of the running process differs from the owner of the file then the process will die. The issue with this is that if there is a need for multiple users to log to a particular file then permissions cannot be used within the dispatcher configuration. This slightly undermines the use of permissions and the automatic creation of log files by the dispatcher as without a check on the permissions it is necessary to create the logfile manually and remove the permissions parameter from the dispatcher. Possible solution: *** Log/Dispatch/File.pm Sat May 12 12:52:53 2007 --- new/Log/Dispatch/File.pm Thu Jul 12 12:57:13 2007 *************** *** 93,100 **** if ( $self->{permissions} && ! $self->{chmodded} ) { ! chmod $self->{permissions}, $self->{filename} ! or die "Cannot chmod $self->{filename} to $self->{permissions}: $!"; $self->{chmodded} = 1; } --- 93,104 ---- if ( $self->{permissions} && ! $self->{chmodded} ) { ! my $filemode = (stat $self->{filename})[2] & 07777; ! if( $filemode ne $self->{permissions} ) ! { ! chmod $self->{permissions}, $self->{filename} ! or die "Cannot chmod $self->{filename} to $self->{permissions}: $!"; ! } $self->{chmodded} = 1; }