Failure to open debug log only a warning.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1782 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
f018eb2246
commit
2fa83301f7
|
@ -235,16 +235,23 @@ sub _dbgOpenLog
|
||||||
if ( $dbg_to_log )
|
if ( $dbg_to_log )
|
||||||
{
|
{
|
||||||
$dbg_log_file = ZM_PATH_LOGS."/".$dbg_id.".log";
|
$dbg_log_file = ZM_PATH_LOGS."/".$dbg_id.".log";
|
||||||
open( LOG, ">>".$dbg_log_file ) or Fatal( "Can't open log file '$dbg_log_file': $!" );
|
if ( open( LOG, ">>".$dbg_log_file ) )
|
||||||
|
{
|
||||||
LOG->autoflush();
|
LOG->autoflush();
|
||||||
|
|
||||||
my $web_uid = (getpwnam( ZM_WEB_USER ))[2];
|
my $web_uid = (getpwnam( ZM_WEB_USER ))[2];
|
||||||
my $web_gid = (getgrnam( ZM_WEB_GROUP ))[2];
|
my $web_gid = (getgrnam( ZM_WEB_GROUP ))[2];
|
||||||
if ( $> != $web_uid )
|
if ( $> == 0 )
|
||||||
{
|
{
|
||||||
chown( $web_uid, $web_gid, $dbg_log_file ) or die( "Can't change permissions on log file: $!" )
|
chown( $web_uid, $web_gid, $dbg_log_file ) or die( "Can't change permissions on log file: $!" )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
warn( "Can't open log file '$dbg_log_file': $!" );
|
||||||
|
$dbg_to_log = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _dbgCloseLog
|
sub _dbgCloseLog
|
||||||
|
|
Loading…
Reference in New Issue