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;