Commit Graph

87 Commits

Author SHA1 Message Date
joerg a696160afc static + __dead 2011-08-29 14:12:29 +00:00
joerg b6d28c7f9d Use plain \* not \\*. Fix trailing whitespace 2010-05-14 01:57:21 +00:00
lukem c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
joerg 7ffbcccbf3 Don't use macros for the synopsis. Improve markup to break argument
groups together by not splitting opening and closing macro over lines.
2009-03-13 10:51:56 +00:00
lukem 0a0b8d1a16 Clean up the usage display to match reality.
Allow 'sum' to take '-a algorithm', so that its usage matches 'cksum'.
Per discussion with Igor Sobrado resulting from PR 39658.
2009-01-02 09:42:51 +00:00
christos 8225aca082 fix 64 bit time_t 2008-12-29 00:51:29 +00:00
lukem a1e399536b WARNS=4 2008-10-08 03:55:18 +00:00
lukem e9415a55f8 use a const struct hash pointer 2008-10-08 03:55:05 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
hubertf 48b31403c5 Remove duplicate #includes
From Slava Semushin <slava.semushin@gmail.com>, via private mail
2007-01-17 00:21:43 +00:00
christos 11c53ad61c kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
2006-10-30 20:22:53 +00:00
christos 2541a5f2fe use c99 initializer. 2006-10-22 16:14:07 +00:00
elad d4d70cef20 PR/34584: Geoff C. Wing: cksum not closing filescriptors after finishing
processing files.
Applied patch, thanks!
2006-09-22 22:35:57 +00:00
dsl 75469d03e1 Separate out the CRC functions in a manner that actually makes them useful
for other program binaries.
Fixes build of 'config' where I added code (commented out) to use the CRC
function - but didn't comment out the #include :-(
2006-09-04 20:01:10 +00:00
wiz 127e5ecbd6 Bump date for previous. 2006-09-02 23:27:45 +00:00
elad 0b20a6d87c mention we support sha2, pointed out by dieter roelants
okay hubertf
2006-08-25 10:40:25 +00:00
hubertf 97c6c066c2 Be more liberal about whitespaces when verifying checksums.
This allows checking md5/sha1 shecksums generates on Linux, which
add more whitespace.

Based on patch by Jukka Salmi (j+nbsd at 2006 dot salmi dot ch)
2006-05-07 12:22:55 +00:00
elad 00556c3786 remove -1, -2, -4, -5, -6, -m. 2006-05-05 22:07:22 +00:00
wiz 61152e3f56 Document more explicitly that -c takes an optional file argument. 2006-04-24 22:00:43 +00:00
hubertf 0b4add3077 Allow reading the checksum list from stdin if no file is given with -c.
This allows verifying the checksums e.g. after downloading a NetBSD
release:
		cat BSDSUM CKSUM MD5 SHA512 SYSVSUM | cksum -c
2006-04-24 21:07:43 +00:00
hubertf 1e8e9dee9c Try guessing hash types. Prefix output with hash type,
the output format was inspired by Linux & OpenBSD.

This now allows doing something like:

miyu% ( md4 *.c ; md5 *.c ; sha1 *.c ) > /tmp/x
miyu% md5 -c /tmp/x
miyu% cksum -c /tmp/x
miyu% echo $?
0
miyu% date >test.c
miyu% cksum -c /tmp/x
(MD4) test.c: FAILED
(MD5) test.c: FAILED
(SHA1) test.c: FAILED
miyu% echo $?
1
2006-04-24 19:41:41 +00:00
wiz f255a1f958 A fix for HTML output; punctuation nits. 2006-04-23 17:45:04 +00:00
hubertf 944a4820a3 Document -w, too. 2006-04-23 16:48:02 +00:00
hubertf f9e91b57ed Add a switch "-c file" to verify a list of checksums generated by the
cksum program and stored in file against files on disk.  E.g. first
run "md5 *.tgz >MD5" to generate a list of MD5 checksums in MD5, then
use the following command to verify them use "md5 -c MD5"

Inspired by Linux' md5sum,
called for by Jukka Salmi <j+nbsd@2006.salmi.ch>on netbsd-help@,
reviewed by rui@.
2006-04-23 16:40:16 +00:00
elad ba1244744f sync usage(). 2006-01-15 16:50:05 +00:00
elad a375b7cdb7 Use crypto/rmd160.h. 2005-09-24 22:40:32 +00:00
wiz 3025498c62 Use correct macro. From YOMURA Masanori in private mail. 2005-09-11 23:11:48 +00:00
wiz 775247d100 Punctuation nits. 2005-09-10 22:14:52 +00:00
elad 6383828527 Avoid defining max. hash length ugliness simply by passing NULL for the
buffer to the File routines.

Noted by pooka@.
2005-09-02 17:39:23 +00:00
elad 871155c6cf Forgot +1 for NUL termination. 2005-09-02 16:52:34 +00:00
elad 50b96d774b Use MAXHASHLEN to indicate largest possible hash.
Fixes buffer overflow found by xtraeme@.
2005-09-02 16:52:03 +00:00
tron a73f6299d6 Fix host tool build which got broken when SHA2 support was added. 2005-08-25 09:51:23 +00:00
elad 3722a15dc3 Add support for SHA2 in cksum. 2005-08-24 19:59:08 +00:00
elad eee731374f Fix some lint warnings. 2005-08-24 19:44:45 +00:00
elad d5f9e57cff Put back in information about the deprecated flags in the man-page. Be
explicit about them being removed, and suggest using the ``-a'' flag.
2005-08-23 15:29:48 +00:00
elad b4df0b712a Note about deprecated flags. 2005-08-22 14:47:55 +00:00
elad 7345c13cbb Add comments about intentionally not documenting the deprecated -1, -2, -4,
-5, -6, and -m flags so they are not mistakenly get documented again in the
future.
2005-08-21 19:33:10 +00:00
elad a7d7292dfa Some changes to cksum:
1. Deprecate the -1, -2, -4, -5, -6, and -m flags. For now, simply remove
   them from the documentation.

2. Add and document ``-a algorithm''.
2005-08-21 18:51:44 +00:00
simonb 61064aebe6 De-register. 2005-02-05 00:13:34 +00:00
xtraeme 691a36f2ea whitespace, remove main() prototype. 2005-01-20 15:44:59 +00:00
xtraeme ea13a7dd7d ANSIfy another function missed in previous. 2005-01-12 17:10:05 +00:00
xtraeme 5c1d419d06 * Kill __P()
* ANSIfy
* No parenthesis are needed around the return value
2005-01-12 17:04:35 +00:00
xtraeme b363f90b86 WARNS=3 2005-01-12 16:42:45 +00:00
wiz 5f59441cc8 -p, -s, -t, and -x are mutually exclusive -- make it obvious in
the SYNOPSIS.
2004-07-09 11:47:59 +00:00
wiz a82c1f4b83 Add missing -n, -1, -2, -4, -5, and -6 to cksum usage.
From Kouichirou Hiratsuka in PR 26195.
2004-07-09 11:44:30 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
simonb 9bc855a931 s/the the/the/ (only in sources that aren't regularly imported from
elsewhere).
2004-04-23 02:58:27 +00:00
kleink 4bd5e026a4 Update to keep file lengths in appropriate data types (off_t, as opposed
to u_int32_t).
2003-12-20 23:41:38 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00