diff options
author | Leger Lance <laleger@gmail.com> | 2012-12-04 19:14:38 +0100 |
---|---|---|
committer | Leger Lance <laleger@gmail.com> | 2012-12-04 19:14:38 +0100 |
commit | 3402bcb2c692e8bf1d88c9dfceb37dcf56a9d692 (patch) | |
tree | 46f09af6b25cb69dc2886e3d21fbdf86641e099c /config/syslog-ng/syslog-ng.inc | |
parent | 644cbb0a785bd1f63bffe467125147423ab5d7e5 (diff) | |
download | pfsense-packages-3402bcb2c692e8bf1d88c9dfceb37dcf56a9d692.tar.gz pfsense-packages-3402bcb2c692e8bf1d88c9dfceb37dcf56a9d692.tar.bz2 pfsense-packages-3402bcb2c692e8bf1d88c9dfceb37dcf56a9d692.zip |
Changed objectparameters field to use base64 encoding
Diffstat (limited to 'config/syslog-ng/syslog-ng.inc')
-rw-r--r-- | config/syslog-ng/syslog-ng.inc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/config/syslog-ng/syslog-ng.inc b/config/syslog-ng/syslog-ng.inc index b56cef39..75d5bb4d 100644 --- a/config/syslog-ng/syslog-ng.inc +++ b/config/syslog-ng/syslog-ng.inc @@ -109,6 +109,7 @@ function syslogng_validate_advanced($post, $input_errors) { $input_errors[] = 'Creation or modification of \'_DEFAULT\' objects not permitted. Change default settings under \'General\' tab.'; } + $post['objectparameters'] = base64_encode($post['objectparameters']); $new_object[] = array("objecttype"=>$post['objecttype'], "objectname"=>$post['objectname'], "objectparameters"=>$post['objectparameters']); if(empty($objects)) { @@ -192,8 +193,11 @@ function syslogng_build_default_objects($settings) { } } $default_objects[0]['objectparameters'] .= "); };"; + $default_objects[0]['objectparameters'] = base64_encode($default_objects[0]['objectparameters']); $default_objects[1] = array("objecttype"=>"destination", "objectname"=>"_DEFAULT", "objectparameters"=>"{ file(\"$default_logdir/$default_logfile\"); };"); + $default_objects[1]['objectparameters'] = base64_encode($default_objects[1]['objectparameters']); $default_objects[2] = array("objecttype"=>"log", "objectname"=>"_DEFAULT", "objectparameters"=>"{ source(_DEFAULT); destination(_DEFAULT); };"); + $default_objects[2]['objectparameters'] = base64_encode($default_objects[2]['objectparameters']); return $default_objects; } @@ -231,7 +235,7 @@ function syslogng_get_log_files($objects) { foreach($objects as $object) { if($object['objecttype'] == 'destination') { - preg_match("/file\(['\"]([^'\"]*)['\"]/", $object['objectparameters'], $match); + preg_match("/file\(['\"]([^'\"]*)['\"]/", base64_decode($object['objectparameters']), $match); if($match) { $log_file = $match[1]; array_push($log_files, $log_file); @@ -249,9 +253,9 @@ function syslogng_build_conf($objects) { foreach($objects as $object) { if($object['objecttype'] == 'log' || $object['objecttype'] == 'options') { - $conf .= $object['objecttype'] . " " . $object['objectparameters'] . "\n"; + $conf .= $object['objecttype'] . " " . base64_decode($object['objectparameters']) . "\n"; } else { - $conf .= $object['objecttype'] . " " . $object['objectname'] . " " . $object['objectparameters'] . "\n"; + $conf .= $object['objecttype'] . " " . $object['objectname'] . " " . base64_decode($object['objectparameters']) . "\n"; } } |