]> granicus.if.org Git - vnstat/log
vnstat
4 years agorefactor pull request changes to use common style and same function calls in tests... master
Teemu Toivola [Sun, 13 Oct 2019 11:12:19 +0000 (14:12 +0300)]
refactor pull request changes to use common style and same function calls in tests than what the daemon uses

4 years agoMerge pull request #140 from cgzones/san
Teemu Toivola [Sun, 13 Oct 2019 10:54:10 +0000 (13:54 +0300)]
Merge pull request #140 from cgzones/san

run testsuite with sanitizers

4 years agotravis: add build with sanitizers
Christian Göttsche [Sat, 5 Oct 2019 16:12:31 +0000 (18:12 +0200)]
travis: add build with sanitizers

4 years agotests: free datacaches
Christian Göttsche [Sat, 5 Oct 2019 16:01:28 +0000 (18:01 +0200)]
tests: free datacaches

Cleanup all datacache structures in testcases to be able to run the testsuite successfully with AddressSanitizer

Found by clang's AddressSanitizer

4 years agomisc.c: silence some safe implicit conversions
Christian Göttsche [Sat, 5 Oct 2019 15:38:20 +0000 (17:38 +0200)]
misc.c: silence some safe implicit conversions

Convert strlen(getrateunitprefix(...)) explicit to int as it is safe to be small

UBSan complains:

    src/misc.c:312:4: runtime error: implicit conversion from type 'unsigned long' of value 18446744073709551610 (64-bit, unsigned) to type 'int' changed the value to -6 (32-bit, signed)

Found by clang's UndefinedBehaviorSanitizer

4 years agogetqueryinterfacecount(): reorder sanitiy check to fix invalid read for empty input
Christian Göttsche [Sat, 5 Oct 2019 15:31:38 +0000 (17:31 +0200)]
getqueryinterfacecount(): reorder sanitiy check to fix invalid read for empty input

An empty string would lead to accessing one byte off to the left with `input[strlen(input) -1]`

Check for emptiness first

Found by clang's AddressSanitizer

4 years agodrawdonut_libgd_native() is only used by tests
Teemu Toivola [Mon, 16 Sep 2019 18:01:01 +0000 (21:01 +0300)]
drawdonut_libgd_native() is only used by tests

4 years agoremove unused getdirowner() function
Teemu Toivola [Mon, 16 Sep 2019 17:57:16 +0000 (20:57 +0300)]
remove unused getdirowner() function

4 years agoremove no longer needed removedb() function
Teemu Toivola [Mon, 16 Sep 2019 17:26:46 +0000 (20:26 +0300)]
remove no longer needed removedb() function

4 years agofix cppcheck unreadVariable findings
Teemu Toivola [Mon, 16 Sep 2019 17:24:59 +0000 (20:24 +0300)]
fix cppcheck unreadVariable findings

4 years agoremove redundant function parameter
Teemu Toivola [Sun, 15 Sep 2019 15:31:29 +0000 (18:31 +0300)]
remove redundant function parameter

4 years agoimprove test coverage
Teemu Toivola [Sun, 15 Sep 2019 15:26:24 +0000 (18:26 +0300)]
improve test coverage

4 years agorelocate parseargs() tests to separate file
Teemu Toivola [Sat, 14 Sep 2019 15:25:40 +0000 (18:25 +0300)]
relocate parseargs() tests to separate file

4 years agofix cppcheck findings
Teemu Toivola [Fri, 13 Sep 2019 21:56:17 +0000 (00:56 +0300)]
fix cppcheck findings

4 years agoimprove test coverage
Teemu Toivola [Fri, 13 Sep 2019 21:23:07 +0000 (00:23 +0300)]
improve test coverage

4 years agofix automatic interface selection not working for --traffic and --live
Teemu Toivola [Thu, 12 Sep 2019 19:10:19 +0000 (22:10 +0300)]
fix automatic interface selection not working for --traffic and --live

4 years agoimprove test coverage
Teemu Toivola [Thu, 12 Sep 2019 18:58:49 +0000 (21:58 +0300)]
improve test coverage

4 years agoimprove test coverage
Teemu Toivola [Thu, 12 Sep 2019 16:34:25 +0000 (19:34 +0300)]
improve test coverage

4 years agoimprove test coverage
Teemu Toivola [Thu, 12 Sep 2019 16:24:19 +0000 (19:24 +0300)]
improve test coverage

4 years agoautoformat
Teemu Toivola [Thu, 12 Sep 2019 14:35:13 +0000 (17:35 +0300)]
autoformat

4 years agosuppress unnecessary test output
Teemu Toivola [Thu, 12 Sep 2019 14:33:14 +0000 (17:33 +0300)]
suppress unnecessary test output

4 years agofix test execution flow to be as intended
Teemu Toivola [Wed, 11 Sep 2019 19:21:38 +0000 (22:21 +0300)]
fix test execution flow to be as intended

4 years agoimprove test coverage
Teemu Toivola [Wed, 11 Sep 2019 19:11:42 +0000 (22:11 +0300)]
improve test coverage

4 years agoimprove test coverage
Teemu Toivola [Wed, 11 Sep 2019 17:21:06 +0000 (20:21 +0300)]
improve test coverage

4 years agorefactor timeused() test to not expect specific range of system performance
Teemu Toivola [Fri, 6 Sep 2019 23:24:35 +0000 (02:24 +0300)]
refactor timeused() test to not expect specific range of system performance

4 years agoMerge pull request #137 from cgzones/devel
Teemu Toivola [Fri, 6 Sep 2019 21:03:26 +0000 (00:03 +0300)]
Merge pull request #137 from cgzones/devel

fix Coverity findings

4 years agofix double close in updatedirownerid
Christian Göttsche [Fri, 6 Sep 2019 15:59:57 +0000 (17:59 +0200)]
fix double close in updatedirownerid

after successfully passing 'dir_fd' to 'fdopendir' is must not be closed manually

found by Coverity

4 years agofix resource leak in db_getinterfaceinfo
Christian Göttsche [Fri, 6 Sep 2019 15:54:57 +0000 (17:54 +0200)]
fix resource leak in db_getinterfaceinfo

if 'ifaceidin' gets initialized but it's length is 0, it is not freed

found by Coverity

4 years agofix resource leak in db_getdata_range
Christian Göttsche [Fri, 6 Sep 2019 15:51:53 +0000 (17:51 +0200)]
fix resource leak in db_getdata_range

if an invalid 'table' is given the function returns without freeing 'ifaceidin'
postpone the initialization

found by Coverity

4 years agoMerge pull request #136 from hoexter/lintian-typo-unknown
Teemu Toivola [Wed, 4 Sep 2019 19:25:47 +0000 (22:25 +0300)]
Merge pull request #136 from hoexter/lintian-typo-unknown

fix small typo - reported by lintian during Debian package validation

4 years agofix small typo - reported by lintian during Debian package validation
Sven Höxter [Tue, 3 Sep 2019 06:56:57 +0000 (08:56 +0200)]
fix small typo - reported by lintian during Debian package validation

4 years agoimprove vnstat parseargs test coverage, fix minor findings
Teemu Toivola [Sat, 31 Aug 2019 13:38:12 +0000 (16:38 +0300)]
improve vnstat parseargs test coverage, fix minor findings

4 years agoimport kFreeBSD fix from Debian
Teemu Toivola [Wed, 21 Aug 2019 18:28:34 +0000 (21:28 +0300)]
import kFreeBSD fix from Debian

4 years agoimprove test coverage
Teemu Toivola [Wed, 21 Aug 2019 18:27:07 +0000 (21:27 +0300)]
improve test coverage

4 years agohandleshowdatabases() -> handleshowdata()
Teemu Toivola [Mon, 19 Aug 2019 18:17:42 +0000 (21:17 +0300)]
handleshowdatabases() -> handleshowdata()

4 years agorefactor vnstati.c
Teemu Toivola [Mon, 19 Aug 2019 17:40:06 +0000 (20:40 +0300)]
refactor vnstati.c

4 years agorefactor vnstatd.c
Teemu Toivola [Mon, 19 Aug 2019 17:31:55 +0000 (20:31 +0300)]
refactor vnstatd.c

4 years agoextract arg parser to separate function making vnstat main() much more readable
Teemu Toivola [Mon, 19 Aug 2019 17:19:37 +0000 (20:19 +0300)]
extract arg parser to separate function making vnstat main() much more readable

4 years agohide expected error message in interface rename test
Teemu Toivola [Mon, 19 Aug 2019 16:56:44 +0000 (19:56 +0300)]
hide expected error message in interface rename test

4 years agomove functions from vnstat.c to vnstat_func.c
Teemu Toivola [Mon, 19 Aug 2019 16:49:19 +0000 (19:49 +0300)]
move functions from vnstat.c to vnstat_func.c

4 years agoupdate vnstatd man page section reference in systemd service file examples
Teemu Toivola [Sun, 18 Aug 2019 20:41:35 +0000 (23:41 +0300)]
update vnstatd man page section reference in systemd service file examples

4 years agobump version to 2.5 beta
Teemu Toivola [Sun, 18 Aug 2019 20:02:33 +0000 (23:02 +0300)]
bump version to 2.5 beta

4 years agofinal preparations for version 2.4 release v2.4
Teemu Toivola [Sun, 18 Aug 2019 12:25:21 +0000 (15:25 +0300)]
final preparations for version 2.4 release

4 years agoimplement --rename for renaming interfaces already existing the database
Teemu Toivola [Wed, 14 Aug 2019 19:02:58 +0000 (22:02 +0300)]
implement --rename for renaming interfaces already existing the database

4 years agofix and rename tests
Teemu Toivola [Tue, 13 Aug 2019 20:59:45 +0000 (23:59 +0300)]
fix and rename tests

4 years agoimprove database error retry error message, increase retry count from 3 to 5, clarify...
Teemu Toivola [Tue, 13 Aug 2019 20:51:39 +0000 (23:51 +0300)]
improve database error retry error message, increase retry count from 3 to 5, clarify behaviour in comment, update changelog

4 years agoremove duplicated database transaction rollback
Teemu Toivola [Mon, 12 Aug 2019 20:55:46 +0000 (23:55 +0300)]
remove duplicated database transaction rollback

4 years agothere's only one database
Teemu Toivola [Wed, 31 Jul 2019 21:19:40 +0000 (00:19 +0300)]
there's only one database

4 years agohandle cleanup of top entries within a transaction
Teemu Toivola [Sun, 28 Jul 2019 17:16:10 +0000 (20:16 +0300)]
handle cleanup of top entries within a transaction

4 years agoimprove daemon resiliency against database locks caused by reads from other processes...
Teemu Toivola [Sun, 28 Jul 2019 15:11:17 +0000 (18:11 +0300)]
improve daemon resiliency against database locks caused by reads from other processes, fix possibility of transaction within transaction error after chain of other errors

4 years agovnstati: close database before writing output in order to reduce the time the databas...
Teemu Toivola [Sat, 27 Jul 2019 14:28:16 +0000 (17:28 +0300)]
vnstati: close database before writing output in order to reduce the time the database is being kept open

4 years agomove vnstatd man page from section 1 to section 8
Teemu Toivola [Mon, 22 Jul 2019 21:22:09 +0000 (00:22 +0300)]
move vnstatd man page from section 1 to section 8

4 years agomention the CHANGES file in readme files
Teemu Toivola [Thu, 18 Jul 2019 11:31:09 +0000 (14:31 +0300)]
mention the CHANGES file in readme files

4 years agoallow vnstatd to fork() when --daemon is used even when started by PID 1
Teemu Toivola [Thu, 18 Jul 2019 11:23:20 +0000 (14:23 +0300)]
allow vnstatd to fork() when --daemon is used even when started by PID 1

4 years agobump version to 2.4 beta
Teemu Toivola [Wed, 10 Jul 2019 19:54:23 +0000 (22:54 +0300)]
bump version to 2.4 beta

4 years agofinal preparations for version 2.3 release v2.3
Teemu Toivola [Wed, 10 Jul 2019 14:33:27 +0000 (17:33 +0300)]
final preparations for version 2.3 release

4 years agofix height allocation and spacing of some image outputs being a little bit too small...
Teemu Toivola [Wed, 10 Jul 2019 14:00:38 +0000 (17:00 +0300)]
fix height allocation and spacing of some image outputs being a little bit too small than intended

4 years agofix Travis configuration
Teemu Toivola [Sun, 7 Jul 2019 23:16:21 +0000 (02:16 +0300)]
fix Travis configuration

4 years agoshow error if Check doesn't have fork mode enabled when tests are executed
Teemu Toivola [Sun, 7 Jul 2019 23:10:51 +0000 (02:10 +0300)]
show error if Check doesn't have fork mode enabled when tests are executed

4 years agofix tests to work even if check has been compiled without fork support
Teemu Toivola [Sun, 7 Jul 2019 22:35:32 +0000 (01:35 +0300)]
fix tests to work even if check has been compiled without fork support

4 years agoremove some unused and no longer needed implementation, fix few cppcheck style warnings
Teemu Toivola [Sat, 6 Jul 2019 13:19:40 +0000 (16:19 +0300)]
remove some unused and no longer needed implementation, fix few cppcheck style warnings

4 years agoin tests, replace use of timelocal() with mktime(), timelocal() is a nonstandard...
Teemu Toivola [Tue, 2 Jul 2019 20:51:29 +0000 (23:51 +0300)]
in tests, replace use of timelocal() with mktime(), timelocal() is a nonstandard GNU extension and not supported by musl

4 years agomake test execution possible even when current user or group doesn't exist
Teemu Toivola [Sat, 29 Jun 2019 16:39:18 +0000 (19:39 +0300)]
make test execution possible even when current user or group doesn't exist

4 years agofix interface list ordering and simplify iflist structure
Teemu Toivola [Fri, 28 Jun 2019 22:22:09 +0000 (01:22 +0300)]
fix interface list ordering and simplify iflist structure

4 years agoseparate debug error prints from regular error prints
Teemu Toivola [Fri, 28 Jun 2019 15:19:31 +0000 (18:19 +0300)]
separate debug error prints from regular error prints

4 years agoremove redundant dirname variable
Teemu Toivola [Thu, 27 Jun 2019 20:28:47 +0000 (23:28 +0300)]
remove redundant dirname variable

4 years agofix interfaces having the possibility of staying marked as disabled after coming...
Teemu Toivola [Tue, 25 Jun 2019 19:37:18 +0000 (22:37 +0300)]
fix interfaces having the possibility of staying marked as disabled after coming back online while still getting correctly monitored

4 years agofilter out local and invalid interfaces from interface lists
Teemu Toivola [Sun, 16 Jun 2019 19:23:12 +0000 (22:23 +0300)]
filter out local and invalid interfaces from interface lists

4 years agofix bsd compiler warnings and errors
Teemu Toivola [Sun, 16 Jun 2019 15:12:11 +0000 (18:12 +0300)]
fix bsd compiler warnings and errors

4 years agoadd tests for iflist
Teemu Toivola [Sun, 16 Jun 2019 14:49:49 +0000 (17:49 +0300)]
add tests for iflist

4 years agoadd null check to database close
Teemu Toivola [Sun, 16 Jun 2019 14:30:32 +0000 (17:30 +0300)]
add null check to database close

4 years agorefactoring
Teemu Toivola [Sun, 16 Jun 2019 14:16:29 +0000 (17:16 +0300)]
refactoring

4 years agoautomatic interface selection when the Interface configuration setting is left empty...
Teemu Toivola [Sun, 16 Jun 2019 13:58:26 +0000 (16:58 +0300)]
automatic interface selection when the Interface configuration setting is left empty, eth0 is no longer the hardcoded default

4 years agocontinue daemon process execution with data caching if database writes fail due to...
Teemu Toivola [Sun, 19 May 2019 14:57:33 +0000 (17:57 +0300)]
continue daemon process execution with data caching if database writes fail due to disk being full

4 years agofix pid file path in debian and redhat init.d example files
Teemu Toivola [Thu, 16 May 2019 20:54:27 +0000 (23:54 +0300)]
fix pid file path in debian and redhat init.d example files

4 years agoremove unused includes
Teemu Toivola [Wed, 15 May 2019 17:06:52 +0000 (20:06 +0300)]
remove unused includes

4 years agorefactor daemon addinterfaces() to use interface list structure
Teemu Toivola [Tue, 14 May 2019 20:11:33 +0000 (23:11 +0300)]
refactor daemon addinterfaces() to use interface list structure

4 years agorefactor interface list output
Teemu Toivola [Tue, 14 May 2019 19:41:54 +0000 (22:41 +0300)]
refactor interface list output

4 years agorefactor interface list to improve reusability
Teemu Toivola [Tue, 14 May 2019 18:14:01 +0000 (21:14 +0300)]
refactor interface list to improve reusability

4 years agobump beta version
Teemu Toivola [Tue, 14 May 2019 17:47:09 +0000 (20:47 +0300)]
bump beta version

4 years agolog warning also when Write-Ahead Logging checkpoint is slow
Teemu Toivola [Mon, 13 May 2019 20:55:47 +0000 (23:55 +0300)]
log warning also when Write-Ahead Logging checkpoint is slow

4 years agorename configuration option WriteAheadLoggingDatabase -> DatabaseWriteAheadLogging...
Teemu Toivola [Mon, 13 May 2019 17:46:15 +0000 (20:46 +0300)]
rename configuration option WriteAheadLoggingDatabase -> DatabaseWriteAheadLogging in order to have a more consistent prefix with those options that control SQLite pragmas

4 years agoexpose SQLite synchronous flag as DatabaseSynchronous in configuration with default...
Teemu Toivola [Mon, 13 May 2019 17:25:11 +0000 (20:25 +0300)]
expose SQLite synchronous flag as DatabaseSynchronous in configuration with default value depending on the setting of WriteAheadLoggingDatabase

4 years agoreduce number of decimals in the warning output
Teemu Toivola [Sun, 12 May 2019 15:16:15 +0000 (18:16 +0300)]
reduce number of decimals in the warning output

4 years agomove timeout definition, mention addition in changes
Teemu Toivola [Sat, 11 May 2019 18:38:14 +0000 (21:38 +0300)]
move timeout definition, mention addition in changes

4 years agodb_walcheckpoint() is timed so no extra debug print is needed
Teemu Toivola [Sat, 11 May 2019 17:29:39 +0000 (20:29 +0300)]
db_walcheckpoint() is timed so no extra debug print is needed

4 years agoshow warning in log if writing cached data to database takes longer than 3 seconds...
Teemu Toivola [Fri, 10 May 2019 22:43:15 +0000 (01:43 +0300)]
show warning in log if writing cached data to database takes longer than 3 seconds, it should take less than a second normally

4 years agorefactor debugging of time used in functions
Teemu Toivola [Fri, 10 May 2019 22:23:35 +0000 (01:23 +0300)]
refactor debugging of time used in functions

4 years agofix missing break
Teemu Toivola [Fri, 10 May 2019 19:49:47 +0000 (22:49 +0300)]
fix missing break

4 years agoadd configure check for SQLite WAL mode support in order to support versions without...
Teemu Toivola [Fri, 10 May 2019 19:23:16 +0000 (22:23 +0300)]
add configure check for SQLite WAL mode support in order to support versions without it, add warning level logging support, show warning during daemon startup if WriteAheadLoggingDatabase is enabled but not supported

4 years agoreplace SQLITE_CHECKPOINT_TRUNCATE with SQLITE_CHECKPOINT_RESTART due to limited...
Teemu Toivola [Thu, 9 May 2019 20:43:58 +0000 (23:43 +0300)]
replace SQLITE_CHECKPOINT_TRUNCATE with SQLITE_CHECKPOINT_RESTART due to limited support in older SQLite versions

4 years agocheckpoint wal database every 4 hours, add debug timing for daemon startup sequence
Teemu Toivola [Thu, 9 May 2019 20:39:15 +0000 (23:39 +0300)]
checkpoint wal database every 4 hours, add debug timing for daemon startup sequence

5 years agoset/increase database busy timeout to 5 seconds when in read-only mode
Teemu Toivola [Wed, 8 May 2019 20:38:54 +0000 (23:38 +0300)]
set/increase database busy timeout to 5 seconds when in read-only mode

5 years agoremove strerror(errno) information from secondary error prints when opening the datab...
Teemu Toivola [Wed, 8 May 2019 20:19:59 +0000 (23:19 +0300)]
remove strerror(errno) information from secondary error prints when opening the database has failed, that information can be misleading when the error is sqlite related in which case the earlier error print has anyway the correct information

5 years agoignore anything that starts with the database name during legacy db import instead...
Teemu Toivola [Wed, 8 May 2019 20:10:59 +0000 (23:10 +0300)]
ignore anything that starts with the database name during legacy db import instead of the exact name of the database, this avoids possible issues with possible automatically created secondary sqlite files

5 years agoadd optional support for SQLite Write-Ahead Logging mode
Teemu Toivola [Tue, 7 May 2019 21:37:07 +0000 (00:37 +0300)]
add optional support for SQLite Write-Ahead Logging mode

5 years agoprovide alternative more simple systemd service file designed to work with also older...
Teemu Toivola [Mon, 6 May 2019 21:43:46 +0000 (00:43 +0300)]
provide alternative more simple systemd service file designed to work with also older systemd versions

5 years agoincrease example systemd service restart delay from default 100ms to 2s, configure...
Teemu Toivola [Mon, 6 May 2019 15:44:21 +0000 (18:44 +0300)]
increase example systemd service restart delay from default 100ms to 2s, configure start rate limits, define ReadWritePaths (which can't be /var/lib/vnstat) to support those systems with such systemd version which supports ProtectSystem=strict but not StateDirectory, closes #131

5 years agofix also summary estimates after previous commit
Teemu Toivola [Wed, 1 May 2019 21:09:14 +0000 (00:09 +0300)]
fix also summary estimates after previous commit

5 years agofix traffic rate not being shown for the last entry of most lists during the first...
Teemu Toivola [Wed, 1 May 2019 17:34:20 +0000 (20:34 +0300)]
fix traffic rate not being shown for the last entry of most lists during the first update of the next period