Closed leeps closed 2 years ago
Thanks. The unlimited 5 minute interval retentation was tested but not in combination with the graphical output which was implemented much later than the text output version. You are correct that it should still be allowed to output the graph even with -1
being selected. The configuration file parser takes care in https://github.com/vergoh/vnstat/blob/master/src/cfg.c#L236 to block any values less than -1
but that graph also needed additional sanity checks in order to ensure that all combination of the configuration values can result in a reasonable looking graph. That's why that section you correctly located exists.
When using unlimited retention of 5 minute intervals, you could not modify the limit and heigth of the fivegraph output because range checking for the fivegraph limit does not account for -1 as configured retention hours. This commit changes the range check by requiring that retention hours are positive before limiting them to the configured retention. I'm assuming that any negative values other than -1 either have the same "unlimited" effect or are caught in vnstatd.