Commit Graph

8705 Commits

Author SHA1 Message Date
christos 7d7dff8590 Coverity CID 2986: Free lines before returning. 2006-04-30 23:27:15 +00:00
liamjfoy 9a4f3f0f6e remove an unused variable
ok christos
2006-04-30 20:23:02 +00:00
liamjfoy 4ed54cf43d Remove Pflag variable. its unused.
ok christos@
2006-04-30 19:24:50 +00:00
christos 0f2aabcd39 Coverity CID 1858, 1857: Fix leaks. While here, pass lint use warn/warnx
instead of perror/fprintf. KNF.
2006-04-28 20:35:15 +00:00
christos 69f8117233 Coverity CID 873: Only align if we printed a string. 2006-04-28 20:07:57 +00:00
christos 61e04d677f Coverity CID 874: Don't check local; it cannot be NULL. 2006-04-28 20:06:50 +00:00
christos fc5177078a Coverity CID 875: local is not allowed to be NULL; don't check for it. 2006-04-28 20:05:43 +00:00
christos 32d85d8f66 Coverity CID 2194: Don't forget to free port. 2006-04-28 20:02:07 +00:00
christos 5c8a52b0f1 Coverity CID 2195: Free path in all code paths, not some. 2006-04-28 19:59:44 +00:00
christos e8877ca717 Coverity CID 1780, 1779: Fix memory leak. 2006-04-28 19:53:56 +00:00
simonb 47890115bd Unwrap a not too long line. 2006-04-27 09:04:41 +00:00
christos 63b0d1ab71 Coverity CID 2790: Always free tmp buffer, not somethimes. 2006-04-25 19:34:42 +00:00
christos 4d5030b7d4 Coverity CID 2969: Check for negative stack in the 'P' case like we do in
the 0 case.
2006-04-25 19:25:19 +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
jld c861d33e38 Make yes exit if a write fails (due to, e.g., EPIPE or revocation).
With advice from rillig@; discussed on tech-userlevel on 2005-11-18.
2006-04-24 05:24:03 +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
christos 328064d112 Redo the previous change so that we can ignore access errors from find,
but also tell when writing to the output file failed, by using a pipeline
to cat. While here change `` to $(). Otherwise this would always fail
since it is ran as nobody and therefore it cannot access some files. Reported
by smb.
2006-04-23 03:04:08 +00:00
christos 731b0f1073 Coverity CID 522: Clarify that there is no overrun here. 2006-04-22 20:51:09 +00:00
christos 3d5b8ce5a8 Coverity CID 529: Call VarFreeEnv to prevent leak. 2006-04-22 19:40:40 +00:00
christos ac5c384e1b Coverity CID 534: Free junk variables on return from Var_Parse. 2006-04-22 19:32:35 +00:00
christos bb46846e03 Coverity CID 533: Plug memory leak.
Add a new function VarFreeEnv() to free environment variables and use it.
2006-04-22 19:28:51 +00:00
christos 58c48be0b3 Coverity CID 526: Check for condTop < 0 where we decrement it, not later
when the damage is already done.
2006-04-22 18:53:32 +00:00
christos 1c603f6321 Coverity CID 527: Make it painfully obvious that av is freed. 2006-04-22 18:48:46 +00:00
christos 0f515a9e28 Coverity CID 528: Avoid NULL deref. 2006-04-22 18:47:10 +00:00
christos f2f8f4c25a Coverity CID 530: Don't leak the argument vector. 2006-04-22 18:43:06 +00:00
christos 1456136e74 Coverity CID 523: Fix off by one mistake. 2006-04-22 18:38:38 +00:00
christos d64e64f832 Coverity CID 545: Appease coverity. return early if the locally allocated
memory is not going to be used (this is an impossible case).
2006-04-22 18:16:13 +00:00
christos df780f7c38 Coverity CID 546: Add assertion before de-reference. 2006-04-22 18:08:13 +00:00
christos 2d84e02e2f Coverity CID 552: Close opened file. 2006-04-22 18:02:26 +00:00
christos ebd63cb6e2 Coverity CID 1748: Free alias on error. 2006-04-22 17:51:09 +00:00
christos 42bccc19d6 Coverity CID 2913: Check for EOF before using char as index to array. 2006-04-22 17:46:48 +00:00
christos 24f29ca641 Coverity CID 95: Fix resource leak. 2006-04-21 16:36:05 +00:00
yamt 1c625a0e79 remove unused files. 2006-04-21 13:45:42 +00:00
hubertf ce8f04b19d Don't try to determining the size of what's coming when reading from a pipe.
Instead of reporting some bogus values, print no progress at all.
(It's beyond me why stat(2) on a pipe returns funny values...
 see the PR below for some examples!)

Fixes PR bin/33207 by myself.

OK'd by mrg@
2006-04-20 23:20:55 +00:00
blymn 10df330c85 Prefix iostat structure elements with io_ 2006-04-20 12:13:51 +00:00
christos 862fe20f05 GC old signal handling and merge it in 4 places:
1. Immediately ignore all the signals we want to ignore and set the alarm.
    2. Before we exit on error, restore all signals we modified
    3. Before we exec a shell, restore all signals we modified and ignore TSTP.
       Job control aware shells know how to deal with this.
    4. Temporarily handle SIGINT while we read motd.
2006-04-17 16:29:44 +00:00
skrll 683ccd8e40 Add RCSId. 2006-04-17 06:53:06 +00:00
blymn e48af18bc5 Update to use new kernel io statistics. 2006-04-14 13:14:06 +00:00
blymn 7d866d268b Update statistics reporting to use new kernel framework, rename dkstats*
to a more generic name since it no longer just deals with disk.
2006-04-14 13:12:37 +00:00
wiz 3aec927b7b Bump date for previous.
New sentence, new line.
Remove trailing whitespace.
2006-04-13 21:15:50 +00:00
wiz afd4fdef89 Bump date for previous, slightly reword a sentencen. 2006-04-13 21:10:44 +00:00
sjg d7df397808 Change ReadMakefile to return 0 on success so that it better meets
the expectations of Lst_Find*.  This way we only read the first sys.mk
found via sysIncPath.
At the same time we need to add a ReadAllMakefiles() for the case
where multiple -f makefile args are provided (uncommon, but documented).
2006-04-12 20:32:27 +00:00
chuck 02ff9e80b9 fix .Xr to invalid man page that i put in by mistake 2006-04-10 16:20:46 +00:00
chuck d09fe2c467 modified man(1):
- avoid double slashes when displaying man pages (got tired
   of '/usr/share/man//cat1/man.0').
 - got rid of __P() while working on it.
 - incorporate some of my old notes explaining how manpath works into the
   comments of the code itself.
 - renamed some of the vars so that the code is consistent throughout
   (and hopefully clearer and easier to understand)
 - fixed relative man paths for multiple man pages (man did a chdir()
   on the first man page it had to format --- this broke any remaining
   relative path man pages left to process).   save old directory and
   fchdir() back to it after formatting.
 - improved doc on "man -h" which does more than just whatis(1) [e.g.
   "man -h fopen" prints the required include files and the prototypes
   rather than just the one-liner you get with whatis(1)]
 - manconf.c now fills in the "len" length field in the TAG/ENTRY
   structures (man now uses len).

revise man.conf file reading stuff to return error on failure in
addentry/gettag (fka getlist) rather than just err()ing out.   this
allows man(1) to call cleanup and delete its tmp files rather than
just leave them floating.  revise other apps using this code
(makewhatis, apropos, catman, whatis) to expect this.  also remove
__P on updated files.
2006-04-10 14:39:06 +00:00
chuck 82ad9348f2 rework the wording in these man pages (mainly in man.conf.5) based on
some old notes I found to make it clearer and easier to understand
how the man stuff works (hopefully!).
2006-04-10 14:02:57 +00:00
christos 857164eeb5 Coverity CID 2536: Clarify the error path further. 2006-04-09 20:01:40 +00:00