From b889edb33e4a09cc1f65d2fb9ad9f9ea16b1eae9 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Tue, 04 Sep 2012 11:42:42 -0400
Subject: [PATCH] - Ported changes from Apache plugin to nginx plugin. - Fixed errors in system.inc.php-

---
 server/scripts/vlogger |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/server/scripts/vlogger b/server/scripts/vlogger
index ce0ce02..5bc50f3 100755
--- a/server/scripts/vlogger
+++ b/server/scripts/vlogger
@@ -28,6 +28,7 @@
 # 1.1   bugfix release
 # 1.2   support for mod_logio
 # 1.3	various contributed bugfixes
+# 1.3ISPconfig1 This local version has been modified for ISPConfig. Namely: "Added better error handling to vlogger script in case the MySQL database connection is not available."
 #
 # 
 # TODO:
@@ -170,9 +171,9 @@
 # log directory
 my $LOGDIR;
 if ( $ARGV[0] ) {
-    if ( !-d $ARGV[0] ) {
+    if ( !-d $ARGV[0] || -l $ARGV[0]) {
         print STDERR
-          "[vlogger] target directory $ARGV[0] does not exist - exiting.\n\n";
+          "[vlogger] target directory $ARGV[0] does not exist or is a symlink - exiting.\n\n";
         exit;
     }
     $LOGDIR = $ARGV[0];
@@ -428,6 +429,11 @@
             unless ( -d "${vhost}" ) {
                 mkdir("${vhost}");
             }
+			
+			# Dont log to symlinks
+			if( -l "${vhost}/".time2str( $TEMPLATE, time() ) ) {
+				die("Log target is a symlink: $LOGDIR/${vhost}/".time2str( $TEMPLATE, time() ));
+			}
 
             # open the file using the template
             open $vhost, ">>${vhost}/" . time2str( $TEMPLATE, time() )

--
Gitblit v1.9.1