Commit graph

44 commits

Author SHA1 Message Date
Doug Torrance c7834d29fd wmifs: Fix "overflow in implicit constant conversion" compiler warnings. 2015-05-28 00:36:23 +01:00
Doug Torrance 6f26dd2f99 wmifs: Fix "comparison between signed and unsigned integer expressions" compiler warning. 2015-05-28 00:36:23 +01:00
Doug Torrance 621457313e wmifs: Fix "suggest braces around empty body in an ‘if’ statement" compiler warning. 2015-05-28 00:36:23 +01:00
Doug Torrance 8a2de61837 wmifs: Update Makefile.
In particular,
- Drop unnecessary definition of DESTDIR.
- Drop LIBDIR; pointed to deprecated X11R6 directory.
- Honors CPPFLAGS and LDFLAGS build flags.
- Remove out-of-date version number from installation message.

Based in part on a patch from the Debian package [1].

[1] https://sources.debian.net/src/wmifs/1.4-2/debian/patches/hardening.patch/
2015-05-28 00:36:23 +01:00
Doug Torrance abe2c4431a wmifs: Fix "variable 'ppp_old" set but not used" compiler warning.
Based on a patch from the Debian package [1].

[1] https://sources.debian.net/src/wmifs/1.4-2/debian/patches/fix-compiler-warning.patch/
2015-05-28 00:36:23 +01:00
Doug Torrance e913422bb8 wmifs: Fix spelling error and escape hyphen in manpage.
Based on a patch in the Debian package [1].

[1] https://sources.debian.net/src/wmifs/1.4-2/debian/patches/fix-manpage.patch/
2015-05-28 00:36:23 +01:00
Doug Torrance d1193f2302 wmifs: Move source files to top directory. 2015-05-28 00:36:23 +01:00
Doug Torrance 2e2937620d wmgeneral: Add _POSIX_C_SOURCE #defines for strdup, pid_t, and getline. 2015-05-26 08:22:14 +01:00
Doug Torrance 7e04b6a890 wmgeneral: Fix "unused variable" warning. 2015-05-26 08:22:14 +01:00
Doug Torrance 624b2898fe wmgeneral: Don't call free on pointers we haven't malloced.
Could cause occasional segfaults.
2015-05-20 10:44:41 +01:00
Doug Torrance a9b73f2fd6 wmgeneral: Fix segfault if newline encountered in parse_rcfile.
From a patch for wmppp.app by Chris Gray <cgray@tribsoft.com> submitted to
Debian to fix several bugs [1].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=27997
2015-05-20 10:44:41 +01:00
Doug Torrance cd30d4127d wmgeneral: Add proper copyright headers; fix changelog formatting. 2015-05-20 10:44:41 +01:00
Doug Torrance afd3d56aea wmgeneral: Use #includes from include-what-you-use. 2015-05-20 10:44:41 +01:00
Doug Torrance 6b1ed40882 wmgeneral: Use field width limits for scanf.
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.
2015-05-20 10:44:41 +01:00
Doug Torrance a0f16b945a wmgeneral: Reduce scope of several variables.
Also took the opportunity to fix some whitespace formatting.
2015-05-20 10:44:41 +01:00
Doug Torrance 6dc4716c29 wmgeneral: Merge 2003-10-10 version from wmmon and wmtime.
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.
2015-05-20 10:44:41 +01:00
Doug Torrance a680f87666 wmgeneral: Bump to 1998-09-14 version found in wmckgmail, wmitime, wmsmp.app, wmSMPmon, and wmtz.
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 with its xpm; instead we patch its
xpm to work with wmgeneral.
2015-05-20 10:44:40 +01:00
Doug Torrance 6c8c14e710 wmgeneral: Bump to 1998-09-11 version found in wmcpufreq and wmppp.app.
We update the dockapps with the older 1998-05-02 version (wmfsm, wmifs, and
wmkeys), and also remove trailing whitespace from the wmcpufreq copy.
2015-05-20 10:44:40 +01:00
Doug Torrance 7d77c17cc1 wmgeneral: Remove inline keywords.
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 list.c, which does compile using C99 and later, then it no
longer compiles using gnu90, the default for gcc4.

To avoid this mess, we remove the inline keywords altogether.

Note that this fixes Debian bugs for wmifs [1], wmppp.app [2], and
wmtime [3].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=778170
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=778172
[3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=778174
2015-05-20 10:44:40 +01:00
Doug Torrance dae24a2f5d wmgeneral: Free pointer.
Fixes "(error) Memory leak: argv" found by cppcheck.
2015-05-20 10:44:40 +01:00
Doug Torrance 746c4b6b7c wmgeneral: Check if malloc fails.
Fixes "(error) Uninitialized variable: ret" found by cppcheck.
2015-05-20 10:44:40 +01:00
Doug Torrance 7e5fa243a6 wmifs: Bump to version 1.4. 2014-10-23 08:03:32 +01:00
Doug Torrance 6fb72da2ec wmifs: Add manpage.
Obtained from Debian:
http://sources.debian.net/data/main/w/wmifs/1.3b1-22/debian/wmifs.1
2014-10-23 08:03:32 +01:00
Doug Torrance 2a7a1a215d wmifs: Avoid NULL arguments to strdup.
This prevents several compiler warnings such as the following:
wmifs.c:422:3: warning: null argument where non-null required (argument 1) [-Wnonnull]
   left_action = strdup(LEFT_ACTION);
   ^
2014-10-23 08:03:32 +01:00
Doug Torrance 3b4c28b9bc wmifs: Use result of fgets.
Remove several compiler warnings of the form
wmifs.c:666:7: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
  fgets(temp, BUFFER_SIZE, fp);
       ^
2014-10-23 08:03:32 +01:00
Doug Torrance 55f6e28253 wmifs: Update email and homepage. 2014-10-23 08:03:32 +01:00
Doug Torrance bf67efc3c0 wmifs: Update FSF address. 2014-10-23 08:03:32 +01:00
Doug Torrance c605646c40 wmifs: Update COPYING from http://www.gnu.org/licenses/gpl-2.0.txt. 2014-10-23 08:03:32 +01:00
Doug Torrance c37f6eda98 wmifs: Use consistent formatting style.
Format to minimize warnings and errors from checkpatch.pl in the Window Maker
source tree.
2014-10-23 08:03:32 +01:00
Doug Torrance 6083e3f774 wmifs: Remove libc5 version.
libc6 was released in 1997...
2014-10-23 08:03:32 +01:00
Doug Torrance a62dcaebc7 wmifs: Delete trailing whitespace. 2014-10-23 08:03:32 +01:00
Doug Torrance 44300ffec2 wmifs: Remaining Debian patches.
This patch consists of all remaining differences between the Debian package
version 1.3b1-22 and the original upstream source.  They were not mentioned
in the Debian changelog.
2014-10-23 08:03:32 +01:00
Doug Torrance 9027310f87 wmifs: Add #defines not appearing on all archs.
Patch by Martin A. Godisch <godisch@debian.org>.  First appeared in Debian
package version 1.3b1-20.  Revised in version 1.3b1-21.
2014-10-23 08:03:31 +01:00
Doug Torrance 09ab3c0549 wmifs: Add auto interface.
Patch by Tom Marshall <tommy@home.tig-grr.com>.  First appeared in Debian
package version 1.3b1-15.

For more information, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=204873
2014-10-23 08:03:31 +01:00
Doug Torrance 279d4dee91 wmifs: Make sampling and scrolling intervals customizable.
Patch by Peter Samuelson <peter@samba-tng.org>.  First appeared in Debian
package version 1.3b1-14.

For more information, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=226689
2014-10-23 08:03:31 +01:00
Doug Torrance 49ecb83c8d wmifs: Display long interface names.
Patch by Davi Leal <davileal@terra.es>.  First appeared in Debian package
version 1.3b1-10.  Revised by Matyas Koszik <koszik@debijan.lonyay.edu.hu> for
version 1.3b1-11.

For more information, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=103083
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=126501
2014-10-23 08:03:31 +01:00
Doug Torrance 6e208d3f75 wmifs: Add lock mode.
Patch by Jorge García <Jorge.Garcia@uv.es>  First appeared in Debian package
version 1.3b1-7, revised in 1.3b1-8.

For more information, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=26870
2014-10-23 08:03:31 +01:00
Doug Torrance 44d68e454e wmifs: Update Makefile.
Patch by Jordi Mallach <jordi@debian.org>.  First appeared in Debian package
version 1.3b1-6.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=27458 for more
information.
2014-10-23 08:03:31 +01:00
Doug Torrance d40bd41287 wmifs: Update WMIFS_VERSION constant; update Changes.
Patch by Jordi Mallach <jordi@debian.org>.  First appeared in Debian package
version 1.3b1-6.
2014-10-23 08:03:31 +01:00
Doug Torrance 68555562b4 wmifs: Prevent crash when too many devices.
Patch by Chris Hanson <cph@martigny.ai.mit.edu>.  First appeared in Debian
package 1.3b1-6.

From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=39922:
wmifs crashes with a cryptic X error message when there are more than
4 net devices.  This occurs for me because I install vmware, which
installs 4 network devices for its bridging hack.

The bug is a loop that fills a fixed-length array, but doesn't stop
when the array is full.  The fix is to add a conditional break to the
loop.  A patch appears below.

I made two additional changes: (1) increased the size of the array,
and (2) changed a name comparison to compare all of the characters of
the name, rather than just the visible characters, since there may be
multiple net devices with the same first 4 characters (vmware does
this, too).
2014-10-23 08:03:31 +01:00
Doug Torrance c2155050c7 wmifs: Prevent speedy scrolling problem.
Patch by Barak Pearlmutter <bap@cs.unm.edu>.  First appeared in Debian package
version 1.3b1-6.

From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=83003:
On my laptop, following a suspend, wmifs scrolls like nuts for a long
time.  The scroll speed looks the same as for a wmifs that is paused
for a while using C-z.

Here is a patch that prevents this speedy scrolling problem.  I also
got rid of a couple unnecessary compiler warnings.
2014-10-23 08:03:31 +01:00
Doug Torrance ac2050270e wmifs: Remove "heyho!" debugging message.
Patch by Ben Gertzfield <che@debian.org>.  First appeared in Debian package
version 1.3b1-5.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=42297 for
more information.
2014-10-23 08:03:31 +01:00
Doug Torrance 3bd48a06c5 wmifs: Add BUFFER_SIZE constant.
Patch by Stephen Pitts <smpitts@midsouth.rr.com>.  First appeared in Debian
package version 1.3b1-4.

From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=41746:

wmifs started crashing on startup on my system,
so I grabbed the source, added -g to the
Makefile, and ran it through gdb.
(Wow, the wonders of Open Source!!).

I found out that it has the hard-coded assumption
that a line in  /proc/net/dev will be no longer
than 128 bytes. Since my ethernet card has over
1 GB in traffic , my eth0 line was 129 bytes long.
I added a new constant, BUFFER_SIZE, that
determines the size of the buffer used for fgets.

Right now, its at 512 bytes, so that gives it
a large margin of error, until we have petabyte
Ethernet! The patch is attached.
2014-10-23 08:03:31 +01:00
Doug Torrance 3e9e54c1e4 wmifs: Add version 1.3b1 to repository.
Source obtained from:
http://ftp.de.debian.org/debian/pool/main/w/wmifs/wmifs_1.3b1.orig.tar.gz
2014-10-23 08:03:31 +01:00