From c6dfc16f12f10e43fae712ad3c97466870250c4f Mon Sep 17 00:00:00 2001 From: stan Date: Wed, 15 Jan 2003 17:47:58 +0000 Subject: [PATCH] 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 --- scripts/zmpkg.pl.z | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/zmpkg.pl.z b/scripts/zmpkg.pl.z index 164c33cba..947d157d4 100755 --- a/scripts/zmpkg.pl.z +++ b/scripts/zmpkg.pl.z @@ -36,6 +36,7 @@ use constant ZM_PATH_WEB => ""; use constant ZM_PATH_CGI => ""; use constant ZM_PATH_LOGS => ""; use constant ZM_WEB_USER => ""; +use constant ZM_WEB_GROUP => ""; use constant ZM_DB_SERVER => ""; use constant ZM_DB_NAME => ""; use constant ZM_DB_USERA => ""; @@ -87,6 +88,13 @@ open( STDERR, ">&LOG" ) || die( "Can't dup stderr: $!" ); select( STDERR ); $| = 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 $retval = 0;