PacketFence - BTS - PacketFence
View Issue Details
0001154PacketFencecorepublic2011-01-18 06:032011-10-25 09:01
maikel 
fgaudreault 
normaltweakalways
closedfixed 
2.0.0 
2.2.02.2.0 
81801f7674995800842eb8514a054f032034529f
0001154: Violation grace timer
In violations.conf the grace timer is set as 120m

Though in the class table in the database, that figure is stored as 120 instead of the expected 7200

Hence when a violation is closed. The user expects 2 hours grace time, instead he gets 2 minutes.

Storing the grace timer as 7200 seconds in the ui and in violations.conf fixes this issue.

Also interesting is that when a grace timer is edited. The class table only gets updated after packetfence gets restarted, while this should be a quite dynamical figure.



Code Review
patch 0001154.patch (3,788) 2011-03-23 17:26
https://www.packetfence.org/bugs/file_download.php?file_id=86&type=bug
Issue History
2011-01-18 06:03maikelNew Issue
2011-01-18 09:17obilodeauNote Added: 0001810
2011-01-18 09:17obilodeauTarget Version => 2.0.1
2011-01-26 15:30obilodeauTarget Version2.0.1 => 2.0.2
2011-03-03 15:19obilodeauTarget Version2.0.2 => +1
2011-03-23 17:03fgaudreaultNote Added: 0001985
2011-03-23 17:04fgaudreaultFile Added: 0001154.patch
2011-03-23 17:04fgaudreaultTag Attached: Code Review
2011-03-23 17:04fgaudreaultStatusnew => assigned
2011-03-23 17:04fgaudreaultAssigned To => fgaudreault
2011-03-23 17:04fgaudreaultStatusassigned => feedback
2011-03-23 17:26fgaudreaultFile Deleted: 0001154.patch
2011-03-23 17:26fgaudreaultFile Added: 0001154.patch
2011-03-23 17:26fgaudreaultNote Edited: 0001985
2011-03-23 17:27fgaudreaultNote Added: 0001986
2011-05-02 18:22obilodeaumtn revision => 81801f7674995800842eb8514a054f032034529f
2011-05-02 18:22obilodeauNote Added: 0002049
2011-05-02 18:22obilodeauStatusfeedback => resolved
2011-05-02 18:22obilodeauFixed in Version => trunk
2011-05-02 18:22obilodeauResolutionopen => fixed
2011-05-04 11:33obilodeauFixed in Versiontrunk => 2.2.0
2011-05-04 11:40obilodeauStatusresolved => closed
2011-10-25 09:01obilodeauTarget Version+1 => 2.2.0

Notes
(0001810)
obilodeau   
2011-01-18 09:17   
Thanks for the report! Targeted for 2.0.1.

As for the 'only gets updated after packetfence gets restarted', this is by current design. Config files are parsed and merged in the class tables (class, trigger, ...) only on the reload of a major packetfence daemon.

I know it's a hassle and it shouldn't be that way but it's not a bug. Please open an issue with feature severity and explain the behavior you would like to have.
(0001985)
fgaudreault   
2011-03-23 17:03   
(edited on: 2011-03-23 17:26)
Here is a patch I made to support those formats. Apply on vanilla 2.1.0 :
### (only numbers), we consider that it's in seconds
###s (numbers + trailing s), seconds
###m (numbers + trailing m), minutes
###h (numbers + trailing h), hours
###w (numbers + trailing m), months
###y (numbers + trailing y), years

If we have an unsupported grace timer (ie. 111patate), PF will break at start time.

Let me know what you think.

NB. Theres a bunch of code in lib/pf/pfcmd/checkup.pm that will overlap the patch from ticket 000992

(0001986)
fgaudreault   
2011-03-23 17:27   
Uploaded a new patch. I now use our global normalize_time sub instead of my own stuff.
(0002049)
obilodeau   
2011-05-02 18:22   
fix committed. Note that I have *not* committed the checkup portion because an empty grace would have generated an error.