freebsd-skq/sbin
brooks a7b7255dba Deprecate unmaintainable uses of strncmp to implement abbreviations.
This commit replaces those with two new functions that simplify the code
and produce warnings that the syntax is deprecated.  A small number of
sensible abbreviations may be explicitly added based on user feedback.

There were previously three types of strncmp use in ipfw:
 - Most commonly, strncmp(av, "string", sizeof(av)) was used to allow av
   to match string or any shortened form of it.  I have replaced this
   with a new function _substrcmp(av, "string") which returns 0 if av
   is a substring of "string", but emits a warning if av is not exactly
   "string".

 - The next type was two instances of strncmp(av, "by", 2) which allowed
   the abbreviation of bytes to "by", "byt", etc.  Unfortunately, it
   also supported "bykHUygh&*g&*7*ui".  I added a second new function
   _substrcmp2(av, "by", "bytes") which acts like the strncmp did, but
   complains if the user doesn't spell out the word "bytes".

 - There is also one correct use of strncmp to match "table(" which might
   have another token after it without a space.

Since I changed all the lines anyway, I also fixed the treatment of
strncmp's return as a boolean in many cases.  I also modified a few
strcmp cases as well to be fully consistent.
2005-01-15 01:46:41 +00:00
..
adjkerntz Invoke tzset(3) within the main loop to catch changes to /etc/localtime 2004-04-27 14:43:03 +00:00
atacontrol Distinguish between TCQ and NCQ type of tagged queing. 2004-09-15 11:22:05 +00:00
atm Back the warnings down from 9 to 6, since that is the highest we have. If 2004-12-13 15:42:46 +00:00
badsect The badsect(8) utility uses atol(), which doesn't allow very good error 2005-01-03 19:03:40 +00:00
bsdlabel Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
camcontrol Deal with double whitespace. 2004-07-03 00:13:43 +00:00
ccdconfig Replace link to nonexistent raid(4) with one to geom(8). I don't like 2004-10-31 05:28:15 +00:00
clri Remove advertising clause from University of California Regent's license, 2004-04-09 19:58:40 +00:00
comcontrol Reflect the cuaa->cuad namechange in documentation. 2004-11-13 00:09:19 +00:00
conscontrol Note that conscontrol set and unset are an interface for TIOCCONS. 2004-06-18 20:06:04 +00:00
devd Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
devfs Remove a useless use of cat, strip overzealous punctuation, and 2004-11-06 11:16:56 +00:00
dhclient Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
dmesg Print a usage message if a non-option is specified. 2004-10-13 20:33:18 +00:00
dump Clearer va-args usage. 2004-12-30 00:53:56 +00:00
dumpfs Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
dumpon Promote mediasize and physmem to uintmax_t when comparing them. 2004-10-04 06:54:19 +00:00
fdisk Add 0xbf as new partition id for Solaris. 2004-11-10 07:48:29 +00:00
fdisk_pc98 Merged from src/sbin/fdisk/fdisk.c revision 1.75. 2004-10-24 12:05:10 +00:00
ffsinfo The ffsinfo utility uses atol() to parse numeric values out of optarg 2005-01-03 18:59:04 +00:00
fsck Deal with double whitespace. 2004-07-03 00:13:43 +00:00
fsck_ffs Do not pass random bits as mount arguments. 2004-12-12 11:04:52 +00:00
fsck_msdosfs Assorted markup, grammar, and spelling fixes. 2004-05-17 08:35:43 +00:00
fsdb Make fsck WARNS=2 clean. 2004-10-09 15:56:34 +00:00
fsirand Avoid casts as lvalues. 2004-07-28 05:59:22 +00:00
gbde Fix a type bug which sometimes wrote unusable lock sectors on the disk. 2004-09-10 12:16:54 +00:00
geom Connect SHSEC GEOM class to the build. 2005-01-11 18:18:40 +00:00
ggate Fix a deadlock in ggatel(8) simlar to one which was fixed some time 2004-10-02 16:58:33 +00:00
gpt Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
growfs Cross-reference ffsinfo(8). 2004-12-26 07:00:10 +00:00
gvinum Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
idmapd Markup nits. 2004-05-17 21:05:39 +00:00
ifconfig Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
init Make WARNS=6 happy with our init(8): 2005-01-11 14:34:29 +00:00
ip6fw Make lookup_host function invocation parameter match its prototype. 2004-07-29 18:04:06 +00:00
ipf Link a couple of missing manpages 2005-01-07 09:22:02 +00:00
ipfs style.Makefile(5): 2004-02-23 20:25:27 +00:00
ipfstat style.Makefile(5): 2004-02-23 20:25:27 +00:00
ipfw Deprecate unmaintainable uses of strncmp to implement abbreviations. 2005-01-15 01:46:41 +00:00
ipmon style.Makefile(5): 2004-02-23 20:25:27 +00:00
ipnat style.Makefile(5): 2004-02-23 20:25:27 +00:00
kldconfig Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror) 2004-03-05 08:10:19 +00:00
kldload Use __FBSDID() to quiet GCC 3.3 warnings. 2003-05-03 18:41:59 +00:00
kldstat Use a better way to calculate POINTER_WIDTH suggested by pjd@. 2004-05-30 10:10:41 +00:00
kldunload Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
ldconfig Improve readability for the recently introduced changes by having 2005-01-14 15:49:05 +00:00
mca Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
md5 mdoc(7) fixes. 2004-07-07 19:57:16 +00:00
mdconfig Rewrite piece of code which I committed some time ago that allows to 2004-12-27 17:20:06 +00:00
mdmfs Assorted markup, grammar, and spelling fixes. 2004-05-17 08:35:43 +00:00
mknod Mark mknod(8) as deprecated. Add text in the 'COMPATIBILITY' section 2004-12-17 14:36:02 +00:00
mksnap_ffs Make sure we don't pass garbage to the kernel. 2004-12-08 11:54:50 +00:00
mount Fix typo. 2004-12-26 18:06:05 +00:00
mount_autofs WARNS=4 safe. 2004-09-12 07:06:48 +00:00
mount_cd9660 NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
mount_ext2fs Remove advertising clause from University of California Regent's license, 2004-04-09 19:58:40 +00:00
mount_hpfs style.Makefile(5): 2004-02-23 20:25:27 +00:00
mount_msdosfs NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
mount_nfs Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
mount_nfs4 Markup nits. 2004-05-17 21:24:06 +00:00
mount_ntfs NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
mount_nullfs Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
mount_std Fix the mount(8) status reporting, now that MNT_NODEV is a no-op (zero). 2004-11-29 09:35:01 +00:00
mount_udf NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
mount_ufs NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
mount_umapfs Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
mount_unionfs Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
natd Remove unused variable. 2005-01-08 22:47:10 +00:00
newfs Cast to intmax_t when using %jd format. 2005-01-08 17:19:56 +00:00
newfs_msdos Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
nfsiod Remove advertising clause from University of California Regent's license, 2004-04-09 19:58:40 +00:00
nos-tun Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
pfctl Remove -I from CFLAGS. This splipped in with the 3.5 import (as I was 2004-10-03 06:19:22 +00:00
pflogd Fixed misspelling of DPADD. 2004-10-24 14:25:53 +00:00
ping o Store timestamp in network byte order. 2004-09-30 07:35:56 +00:00
ping6 Fix build on all (hopefully) 64 bit architectures. 2005-01-09 09:10:24 +00:00
quotacheck Remove advertising clause from University of California Regent's license, 2004-04-09 19:58:40 +00:00
rcorder Deal with harmful leading whitespace. 2004-07-02 18:37:52 +00:00
reboot Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
recoverdisk Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
restore Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
route Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
routed Don't declare everything we find on a loopback interface for passive: 2004-08-14 08:36:35 +00:00
rtsol Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
savecore Initialize "he" in DoFile, so savecore(8) is WARNS=6 clean. 2005-01-10 10:44:56 +00:00
sconfig Fix typos. 2004-12-30 01:48:12 +00:00
setkey Reapply traditionally lost fixes, fixed some more. 2004-06-05 20:22:15 +00:00
shutdown Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
slattach Remove cross reference to uustat(1), which is no longer in the base 2005-01-02 12:40:40 +00:00
spppcontrol Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
startslip - Signal handlers must have an int argument. 2004-08-02 08:10:28 +00:00
sunlabel Fix indentation of continuation lines to (hopefully) comply with 2004-06-18 15:08:08 +00:00
swapon Don't include sys/user.h merely for its side-effect of recursively 2004-11-27 06:51:39 +00:00
sysctl Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
tunefs Remove advertising clause from University of California Regent's license, 2004-04-09 19:58:40 +00:00
umount Remove advertising clause from University of California Regent's license, 2004-04-09 19:58:40 +00:00
Makefile NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
Makefile.inc NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00