[PATCH 10/28] wmgeneral: Add proper copyright headers; fix changelog formatting.

2015-05-19 Thread Doug Torrance
--- wmSMPmon/wmgeneral/wmgeneral.c | 31 +++ wmSMPmon/wmgeneral/wmgeneral.h | 26 ++ wmckgmail/wmgeneral/misc.c | 7 --- wmckgmail/wmgeneral/misc.h | 22 ++ wmckgmail/wmgeneral/wmgeneral.c | 31

[PATCH 08/28] wmgeneral: Use field width limits for scanf.

2015-05-19 Thread Doug Torrance
This fixes (portability) scanf without field width limits can crash with huge input data on some versions of libc warning from cppcheck. We choose 10 as the field width limit as it is the number of characters in 2^31-1, the largest int. --- wmSMPmon/wmgeneral/wmgeneral.c | 4 ++--

[PATCH 07/28] wmgeneral: Reduce scope of several variables.

2015-05-19 Thread Doug Torrance
Also took the opportunity to fix some whitespace formatting. --- wmSMPmon/wmgeneral/wmgeneral.c | 59 - wmckgmail/wmgeneral/wmgeneral.c | 59 - wmcpufreq/wmgeneral/wmgeneral.c | 59

[PATCH 13/28] wmppp.app: Move source files to top directory.

2015-05-19 Thread Doug Torrance
This way, users need only type make to build instead of needing to cd wmppp first. --- wmppp.app/INSTALL | 11 +- wmppp.app/Makefile | 36 + wmppp.app/example-scripts/chap-secrets |2 +

[PATCH 14/28] wmppp.app: Fix spelling mistakes.

2015-05-19 Thread Doug Torrance
Used codespell -w. --- wmppp.app/BUGS| 2 +- wmppp.app/CHANGES | 8 wmppp.app/HINTS | 6 +++--- wmppp.app/INSTALL | 2 +- wmppp.app/README | 2 +- wmppp.app/wmppp.1 | 2 +- wmppp.app/wmppp.c | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git

[PATCH 16/28] wmppp.app: Switch ifs to #ifs for macros.

2015-05-19 Thread Doug Torrance
Fixes warning: null argument where non-null required compiler warnings by not passing NULL to strdup and (warning) Conversion of string literal to bool always evaluates to true found by cppcheck. --- wmppp.app/wmppp.c | 29 +++-- 1 file changed, 19 insertions(+), 10

[PATCH 15/28] wmppp.app: Reduce scope of several variables.

2015-05-19 Thread Doug Torrance
Fixes several (style) The scope of the variable 'p' can be reduced found by cppcheck. --- wmppp.app/wmppp.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 7e4ecdc..10e3ebe 100644 --- a/wmppp.app/wmppp.c +++

[PATCH 09/28] wmgeneral: Use #includes from include-what-you-use.

2015-05-19 Thread Doug Torrance
--- wmSMPmon/wmgeneral/wmgeneral.c | 20 +--- wmSMPmon/wmgeneral/wmgeneral.h | 10 +++--- wmckgmail/wmgeneral/wmgeneral.c | 20 +--- wmckgmail/wmgeneral/wmgeneral.h | 10 +++--- wmcpufreq/wmgeneral/wmgeneral.c | 20 +---

[PATCH 05/28] wmgeneral: Bump to 1998-09-14 version found in wmckgmail, wmitime, wmsmp.app, wmSMPmon, and wmtz.

2015-05-19 Thread Doug Torrance
Note that wmckgmail and wmtz were identical; this is the version we use. wmSMPmon differed only with some whitespace. wmitime differed only with a bugfix (a segfault when -display is given with no argument), but this will be fixed again in the next commit. wmsm.app had patched wmgeneral to work

[PATCH 11/28] wmgeneral: Fix segfault if newline encountered in parse_rcfile.

2015-05-19 Thread Doug Torrance
From a patch for wmppp.app by Chris Gray cg...@tribsoft.com submitted to Debian to fix several bugs [1]. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=27997 --- wmSMPmon/wmgeneral/wmgeneral.c | 7 ++- wmckgmail/wmgeneral/wmgeneral.c | 7 ++- wmcpufreq/wmgeneral/wmgeneral.c | 7

[PATCH 06/28] wmgeneral: Merge 2003-10-10 version from wmmon and wmtime.

2015-05-19 Thread Doug Torrance
Note that this was a fork of the earlier 1998-05-02 version and didn't contain the later changes. Therefore we merge the best of both versions. wmtime had some additional unnecessary dummy variables, so we use the wmmon version. --- wmSMPmon/wmgeneral/wmgeneral.c | 26

[PATCH 04/28] wmgeneral: Bump to 1998-09-11 version found in wmcpufreq and wmppp.app.

2015-05-19 Thread Doug Torrance
We update the dockapps with the older 1998-05-02 version (wmfsm, wmifs, and wmkeys), and also remove trailing whitespace from the wmcpufreq copy. --- wmcpufreq/wmgeneral/list.c | 14 +-- wmcpufreq/wmgeneral/list.h | 6 +- wmcpufreq/wmgeneral/misc.c | 26 ++---

[PATCH 18/28] wmppp.app: Replace deprecated caddr_t cast with void*.

2015-05-19 Thread Doug Torrance
--- wmppp.app/wmppp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 812a0de..932d1df 100644 --- a/wmppp.app/wmppp.c +++ b/wmppp.app/wmppp.c @@ -904,7 +904,7 @@ void get_ppp_stats(struct ppp_stats *cur) { memset(req, 0,

[PATCH 27/28] wmppp.app: Command line options take precedence over configuration files.

2015-05-19 Thread Doug Torrance
Since we now reread the configuration files on occasion, the options given at the command line could be overwritten. To avoid this, we save the command line options and always use them if present. --- wmppp.app/wmppp.c | 28 +++- 1 file changed, 23 insertions(+), 5

[PATCH 24/28] wmppp.app: Fix segfault if stop_action or start_action strings are NULL.

2015-05-19 Thread Doug Torrance
--- wmppp.app/wmppp.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 7758eee..a1f1196 100644 --- a/wmppp.app/wmppp.c +++ b/wmppp.app/wmppp.c @@ -637,7 +637,8 @@ void wmppp_routine(int argc, char **argv) {

[PATCH 28/28] wmppp.app: Bump to version 1.3.1.

2015-05-19 Thread Doug Torrance
--- wmppp.app/CHANGES | 126 ++ wmppp.app/README | 2 +- wmppp.app/wmppp.c | 2 +- 3 files changed, 128 insertions(+), 2 deletions(-) diff --git a/wmppp.app/CHANGES b/wmppp.app/CHANGES index 6ff7e68..89850fb 100644 --- a/wmppp.app/CHANGES

[PATCH 22/28] wmppp.app: Update Makefile.

2015-05-19 Thread Doug Torrance
Main change is to use $(INSTALL) instead of cp in install target along with $(DESTDIR) variable. We also remove installation of user ~/.wmppprc config file -- this isn't useful for sysadmins or package maintainers. We also update INSTALL to reflect the changes. --- wmppp.app/INSTALL | 7

[PATCH 23/28] wmppp.app: Fix segfault when HOME undefined.

2015-05-19 Thread Doug Torrance
Instead, we exit with an error message. This fixes Debian bug #716472 [1]. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716472 --- wmppp.app/wmppp.c | 5 + 1 file changed, 5 insertions(+) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 43fb696..7758eee 100644 ---

[PATCH 25/28] wmppp.app: Add new command line options.

2015-05-19 Thread Doug Torrance
We add command line options for the user to change the start, stop, speed, ifdown, and stampfile settings at runtime. This closes a Debian wishlist bug [1]. Note that, in order to have the command line options overwrite the defaults set in the configuration file, we split the command line

[PATCH 19/28] wmppp.app: Replace deprecated usleep with nanosleep.

2015-05-19 Thread Doug Torrance
--- wmppp.app/wmppp.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 932d1df..723864f 100644 --- a/wmppp.app/wmppp.c +++ b/wmppp.app/wmppp.c @@ -460,6 +460,7 @@ void wmppp_routine(int argc, char **argv) { while (1)

[PATCH 02/28] wmgeneral: Free pointer.

2015-05-19 Thread Doug Torrance
Fixes (error) Memory leak: argv found by cppcheck. --- wmckgmail/wmgeneral/misc.c | 1 + wmcpufreq/wmgeneral/misc.c | 1 + wmifs/wmgeneral/misc.c | 1 + wmitime/wmgeneral/misc.c | 1 + wmkeys/wmgeneral/misc.c| 1 + wmmon/wmgeneral/misc.c | 1 + wmppp.app/wmgeneral/misc.c | 1 +

[PATCH 00/28] wmgeneral and wmppp.app

2015-05-19 Thread Doug Torrance
This set of patches brings (almost) all of the dockapps in the repository which use the wmgeneral library together to share the same code. The one exception is wmbiff, which has diverged substantially from the rest and so I haven't touched it. (At some point, I would like to spend some time and

[PATCH 20/28] wmppp.app: Remove C++ style comments.

2015-05-19 Thread Doug Torrance
--- wmppp.app/wmppp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 723864f..6eede6d 100644 --- a/wmppp.app/wmppp.c +++ b/wmppp.app/wmppp.c @@ -625,7 +625,7 @@ void wmppp_routine(int argc, char **argv) {

[PATCH 26/28] wmppp.app: Reread configuration file.

2015-05-19 Thread Doug Torrance
Based in part on a patch by Chris Gray [1] to fix Debian bug #50181 [2]. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=12;filename=wmppp.diff;att=1;bug=50181 [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=50181 --- wmppp.app/wmppp.c | 58

[PATCH 21/28] wmppp.app: Use #includes from include-what-you-use.

2015-05-19 Thread Doug Torrance
We actually include sys/socket.h instead of bits/socket_type.h, as it returns an error: Never include bits/socket_type.h directly; use sys/socket.h instead. --- wmppp.app/wmppp.c | 43 +-- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git

[PATCH 01/28] wmgeneral: Check if malloc fails.

2015-05-19 Thread Doug Torrance
Fixes (error) Uninitialized variable: ret found by cppcheck. --- wmckgmail/wmgeneral/misc.c | 5 + wmcpufreq/wmgeneral/misc.c | 5 + wmifs/wmgeneral/misc.c | 5 + wmitime/wmgeneral/misc.c | 5 + wmkeys/wmgeneral/misc.c| 5 + wmmon/wmgeneral/misc.c | 5 +

[PATCH 03/28] wmgeneral: Remove inline keywords.

2015-05-19 Thread Doug Torrance
Previously, if we attempted to build using C99 or later, we got inline function declared but never defined warnings and eventual undefined reference errors. As a result, it fails to build from source using gcc5. However, if we move the definitions to list.h and add extern inline declarations to

[PATCH 12/28] wmgeneral: Don't call free on pointers we haven't malloced.

2015-05-19 Thread Doug Torrance
Could cause occasional segfaults. --- wmSMPmon/wmgeneral/wmgeneral.c | 4 wmckgmail/wmgeneral/wmgeneral.c | 4 wmcpufreq/wmgeneral/wmgeneral.c | 4 wmfsm/wmgeneral/wmgeneral.c | 4 wmifs/wmgeneral/wmgeneral.c | 4 wmitime/wmgeneral/wmgeneral.c | 4

[PATCH 17/28] wmppp.app: Remove unused parameter from get_statistics().

2015-05-19 Thread Doug Torrance
Fixes warning: unused parameter ‘devname’ compiler warning. --- wmppp.app/wmppp.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wmppp.app/wmppp.c b/wmppp.app/wmppp.c index 57d81cf..812a0de 100644 --- a/wmppp.app/wmppp.c +++ b/wmppp.app/wmppp.c @@ -269,7 +269,7 @@