aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAnthony Paul <anthonypaul@gmail.com>2013-09-05 11:25:01 -0230
committerAnthony Paul <anthonypaul@gmail.com>2013-09-05 11:25:01 -0230
commit89825ac9d18e53227d5ff832292324393e494cc8 (patch)
tree38e936b895cdb7e373b65610da412f984be1b6e8 /config
parentd35e5eed06319c3fe4926316d4a3e9fd26fc063c (diff)
downloadpfsense-packages-89825ac9d18e53227d5ff832292324393e494cc8.tar.gz
pfsense-packages-89825ac9d18e53227d5ff832292324393e494cc8.tar.bz2
pfsense-packages-89825ac9d18e53227d5ff832292324393e494cc8.zip
old code looked for 2.0 to decide if this was 2+, changed to 2.
made sure some dirs were created and permissions set before trying to write to them
Diffstat (limited to 'config')
-rw-r--r--config/havp/havp.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/config/havp/havp.inc b/config/havp/havp.inc
index 36c053c9..29a109ba 100644
--- a/config/havp/havp.inc
+++ b/config/havp/havp.inc
@@ -79,7 +79,7 @@ define('HVDEF_PID_FILE', '/var/run/havp.pid');
define('HVDEF_WORK_DIR', '/usr/local/etc/havp');
$pfSversion = str_replace("\s", "", file_get_contents("/etc/version"));
-if(preg_match("/^2.0/",$pfSversion))
+if(preg_match("/^2./",$pfSversion))
define('HVDEF_LOG_DIR', '/var/log/havp');
else
define('HVDEF_LOG_DIR', '/var/log');
@@ -413,6 +413,10 @@ function havp_check_system()
havp_set_file_access(HVDEF_TEMPLATES, HVDEF_USER, '');
havp_set_file_access(HVDEF_TEMPLATES_EX, HVDEF_USER, '');
+ # havp log dir
+ if (!file_exists(HVDEF_LOG_DIR))
+ mwexec("mkdir -p " . HVDEF_LOG_DIR);
+ havp_set_file_access(HVDEF_LOG_DIR, HVDEF_USER, '');
# log files exists ?
if (!file_exists(HVDEF_HAVP_ACCESSLOG)) file_put_contents(HVDEF_HAVP_ACCESSLOG, '');
if (!file_exists(HVDEF_HAVP_ERRORLOG)) file_put_contents(HVDEF_HAVP_ERRORLOG, '');
@@ -427,12 +431,16 @@ function havp_check_system()
if (!file_exists(HVDEF_FRESHCLAM_CONF)) file_put_contents(HVDEF_FRESHCLAM_CONF, '');
havp_set_file_access(HVDEF_FRESHCLAM_CONF, HVDEF_AVUSER, '0664');
+ # clam log dir
+ if (!file_exists(HVDEF_AVLOG_DIR))
+ mwexec("mkdir -p " . HVDEF_AVLOG_DIR);
+ havp_set_file_access(HVDEF_AVLOG_DIR, HVDEF_USER, '');
# log files exists ?
if (!file_exists(HVDEF_CLAM_LOG)) file_put_contents(HVDEF_CLAM_LOG, '');
if (!file_exists(HVDEF_FRESHCLAM_LOG)) file_put_contents(HVDEF_FRESHCLAM_LOG, '');
# log dir permissions
- if (!file_exists(HVDEF_AVLOG_DIR))
- mwexec("mkdir -p " . HVDEF_AVLOG_DIR);
+ # if (!file_exists(HVDEF_AVLOG_DIR))
+ # mwexec("mkdir -p " . HVDEF_AVLOG_DIR);
havp_set_file_access(HVDEF_AVLOG_DIR, HVDEF_USER, '0777');
# =-= ClamAV =-=