Changes permissions on it's log if started by root.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@345 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2003-01-15 17:47:58 +00:00
parent fc015bbc45
commit c6dfc16f12
1 changed files with 8 additions and 0 deletions

View File

@ -36,6 +36,7 @@ use constant ZM_PATH_WEB => "<from zmconfig>";
use constant ZM_PATH_CGI => "<from zmconfig>"; use constant ZM_PATH_CGI => "<from zmconfig>";
use constant ZM_PATH_LOGS => "<from zmconfig>"; use constant ZM_PATH_LOGS => "<from zmconfig>";
use constant ZM_WEB_USER => "<from zmconfig>"; use constant ZM_WEB_USER => "<from zmconfig>";
use constant ZM_WEB_GROUP => "<from zmconfig>";
use constant ZM_DB_SERVER => "<from zmconfig>"; use constant ZM_DB_SERVER => "<from zmconfig>";
use constant ZM_DB_NAME => "<from zmconfig>"; use constant ZM_DB_NAME => "<from zmconfig>";
use constant ZM_DB_USERA => "<from zmconfig>"; use constant ZM_DB_USERA => "<from zmconfig>";
@ -87,6 +88,13 @@ open( STDERR, ">&LOG" ) || die( "Can't dup stderr: $!" );
select( STDERR ); $| = 1; select( STDERR ); $| = 1;
select( LOG ); $| = 1; select( LOG ); $| = 1;
my $web_uid = (getpwnam( ZM_WEB_USER ))[2];
my $web_gid = (getgrnam( ZM_WEB_GROUP ))[2];
if ( $> != $web_uid )
{
chown( $web_uid, $web_gid, $log_file ) or die( "Can't change permissions on log file: $!" )
}
my $status = execute( ZM_PATH_BIN."/zmdc.pl check" ); my $status = execute( ZM_PATH_BIN."/zmdc.pl check" );
my $retval = 0; my $retval = 0;