Bug #5340
closedIPsec logging - silent can't be configured, issues with defaults
0%
Description
Silent logging can't actually be configured on vpn_ipsec_settings.php, because 0 isn't stored in the config (PHP considers "0" to be empty). That quirk of PHP is also relied upon to set a "default" value.
Need to have a way of actually saving and applying "silent", and show correct defaults where log levels don't exist in the config.
Updated by Jim Thompson almost 9 years ago
- Assignee set to Matthew Smith
let's see if we can't find a work-around, or just push this to 2.3.
PHP is fucking stupid.
Updated by Chris Buechler almost 9 years ago
- Status changed from Confirmed to Feedback
should work in 2.2.5 now. Needs review, and merging to 2.3.
Updated by Chris Buechler almost 9 years ago
- Status changed from Feedback to Confirmed
- Assignee changed from Matthew Smith to Chris Buechler
better, couple remaining things I'm fixing now
Updated by Matthew Smith almost 9 years ago
If you are shifting the scale to the range 1..6, the statement where you set the default value to 2 is incorrect. When I copy it to a test box, it ends up setting the default to Audit, when the strongswan default is equivalent to control. The strongswan default on the range from -1 to 4 is 1 (the third value). Your new default should be 3.
The statements in the input validation section at the top will all need to have their ranges adjusted as well. You could probably replace those 16 if statements that check each individual log setting with a loop to do the same thing:
foreach ($ipsec_loglevels as $lkey => $ldescr) { if (isset($pconfig["ipsec_{$lkey}"]) && !in_array(intval($pconfig["ipsec_{$lkey}"]), range(-1, 4))) { $input_errors[] = "A valid value must be specified for {$ldescr} debug."; } }
Updated by Chris Buechler almost 9 years ago
- Status changed from Confirmed to Feedback
Thanks Matt, got both those too.
This seems to be ok now.