summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/Makefile17
-rw-r--r--usr.bin/apply/Makefile1
-rw-r--r--usr.bin/apply/apply.c2
-rw-r--r--usr.bin/ar/Makefile4
-rw-r--r--usr.bin/ar/append.c2
-rw-r--r--usr.bin/ar/ar.c8
-rw-r--r--usr.bin/ar/archive.c4
-rw-r--r--usr.bin/ar/contents.c2
-rw-r--r--usr.bin/ar/delete.c2
-rw-r--r--usr.bin/ar/extract.c2
-rw-r--r--usr.bin/ar/misc.c2
-rw-r--r--usr.bin/ar/move.c2
-rw-r--r--usr.bin/ar/print.c2
-rw-r--r--usr.bin/ar/replace.c2
-rw-r--r--usr.bin/at/Makefile3
-rw-r--r--usr.bin/at/at.c2
-rw-r--r--usr.bin/at/panic.c3
-rw-r--r--usr.bin/at/parsetime.c5
-rw-r--r--usr.bin/at/perm.c2
-rw-r--r--usr.bin/banner/Makefile1
-rw-r--r--usr.bin/banner/banner.c4
-rw-r--r--usr.bin/basename/Makefile1
-rw-r--r--usr.bin/basename/basename.c4
-rw-r--r--usr.bin/biff/Makefile1
-rw-r--r--usr.bin/biff/biff.c6
-rw-r--r--usr.bin/brandelf/Makefile1
-rw-r--r--usr.bin/calendar/calendars/calendar.birthday4
-rw-r--r--usr.bin/cap_mkdb/Makefile1
-rw-r--r--usr.bin/cap_mkdb/cap_mkdb.c4
-rw-r--r--usr.bin/chat/Makefile3
-rw-r--r--usr.bin/chat/chat.c3
-rw-r--r--usr.bin/checknr/Makefile1
-rw-r--r--usr.bin/checknr/checknr.c4
-rw-r--r--usr.bin/chflags/Makefile1
-rw-r--r--usr.bin/chflags/chflags.c4
-rw-r--r--usr.bin/chpass/Makefile1
-rw-r--r--usr.bin/chpass/chpass.159
-rw-r--r--usr.bin/chpass/chpass.c12
-rw-r--r--usr.bin/chpass/edit.c4
-rw-r--r--usr.bin/chpass/field.c2
-rw-r--r--usr.bin/chpass/pw_copy.c4
-rw-r--r--usr.bin/chpass/pw_yp.c4
-rw-r--r--usr.bin/chpass/table.c2
-rw-r--r--usr.bin/chpass/util.c9
-rw-r--r--usr.bin/cksum/Makefile1
-rw-r--r--usr.bin/cksum/crc.c2
-rw-r--r--usr.bin/cksum/print.c2
-rw-r--r--usr.bin/cksum/sum1.c2
-rw-r--r--usr.bin/cksum/sum2.c2
-rw-r--r--usr.bin/cmp/Makefile1
-rw-r--r--usr.bin/cmp/cmp.c4
-rw-r--r--usr.bin/cmp/misc.c2
-rw-r--r--usr.bin/cmp/regular.c2
-rw-r--r--usr.bin/cmp/special.c2
-rw-r--r--usr.bin/col/Makefile1
-rw-r--r--usr.bin/col/col.c4
-rw-r--r--usr.bin/colcrt/Makefile1
-rw-r--r--usr.bin/colcrt/colcrt.c4
-rw-r--r--usr.bin/colldef/Makefile3
-rw-r--r--usr.bin/colldef/parse.y6
-rw-r--r--usr.bin/colrm/Makefile1
-rw-r--r--usr.bin/colrm/colrm.c6
-rw-r--r--usr.bin/column/Makefile1
-rw-r--r--usr.bin/column/column.c14
-rw-r--r--usr.bin/comm/Makefile1
-rw-r--r--usr.bin/comm/comm.c6
-rw-r--r--usr.bin/compile_et/compile_et.c30
-rw-r--r--usr.bin/compress/Makefile1
-rw-r--r--usr.bin/compress/compress.c12
-rw-r--r--usr.bin/compress/zopen.c5
-rw-r--r--usr.bin/ctags/Makefile1
-rw-r--r--usr.bin/ctags/ctags.c4
-rw-r--r--usr.bin/ctags/fortran.c2
-rw-r--r--usr.bin/ctags/lisp.c2
-rw-r--r--usr.bin/ctags/print.c2
-rw-r--r--usr.bin/ctags/tree.c2
-rw-r--r--usr.bin/ctags/yacc.c2
-rw-r--r--usr.bin/cut/Makefile1
-rw-r--r--usr.bin/cut/cut.c10
-rw-r--r--usr.bin/dirname/Makefile1
-rw-r--r--usr.bin/dirname/dirname.c4
-rw-r--r--usr.bin/doscmd/port.c23
-rw-r--r--usr.bin/du/Makefile1
-rw-r--r--usr.bin/du/du.c9
-rw-r--r--usr.bin/ee/Makefile1
-rw-r--r--usr.bin/ee/ee.c10
-rw-r--r--usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg4
-rw-r--r--usr.bin/enigma/Makefile8
-rw-r--r--usr.bin/enigma/enigma.1115
-rw-r--r--usr.bin/enigma/enigma.c183
-rw-r--r--usr.bin/env/Makefile1
-rw-r--r--usr.bin/env/env.c4
-rw-r--r--usr.bin/error/Makefile1
-rw-r--r--usr.bin/error/pi.c4
-rw-r--r--usr.bin/error/touch.c4
-rw-r--r--usr.bin/expand/Makefile1
-rw-r--r--usr.bin/expand/expand.c4
-rw-r--r--usr.bin/f2c/f2c.h12
-rw-r--r--usr.bin/f2c/proc.c4
-rw-r--r--usr.bin/fetch/fetch.152
-rw-r--r--usr.bin/fetch/fetch.h3
-rw-r--r--usr.bin/fetch/ftp.c16
-rw-r--r--usr.bin/fetch/http.c70
-rw-r--r--usr.bin/fetch/main.c13
-rw-r--r--usr.bin/file/Magdir/applix12
-rw-r--r--usr.bin/file/Magdir/cisco10
-rw-r--r--usr.bin/file/Magdir/flash10
-rw-r--r--usr.bin/file/Magdir/gimp32
-rw-r--r--usr.bin/file/Magdir/gnu9
-rw-r--r--usr.bin/file/Magdir/lecter4
-rw-r--r--usr.bin/file/Magdir/macintosh79
-rw-r--r--usr.bin/file/Magdir/mime7
-rw-r--r--usr.bin/file/Magdir/modem33
-rw-r--r--usr.bin/file/Magdir/ms-dos149
-rw-r--r--usr.bin/file/Magdir/octave4
-rw-r--r--usr.bin/file/Magdir/olf97
-rw-r--r--usr.bin/file/Magdir/os223
-rw-r--r--usr.bin/file/Magdir/os985
-rw-r--r--usr.bin/file/Magdir/riff93
-rw-r--r--usr.bin/file/Magdir/teapot4
-rw-r--r--usr.bin/file/Magdir/ti-8x36
-rw-r--r--usr.bin/file/Magdir/vicar16
-rw-r--r--usr.bin/file/Magdir/wordperfect91
-rw-r--r--usr.bin/find/extern.h2
-rw-r--r--usr.bin/find/find.133
-rw-r--r--usr.bin/find/find.c19
-rw-r--r--usr.bin/find/function.c1
-rw-r--r--usr.bin/find/main.c8
-rw-r--r--usr.bin/find/operator.c2
-rw-r--r--usr.bin/ftp/ftp.c7
-rw-r--r--usr.bin/gcore/Makefile3
-rw-r--r--usr.bin/gcore/elfcore.c514
-rw-r--r--usr.bin/gcore/extern.h4
-rw-r--r--usr.bin/gcore/gcore.c142
-rw-r--r--usr.bin/gencat/gencat.1148
-rw-r--r--usr.bin/global/Makefile.inc20
-rw-r--r--usr.bin/global/btreeop/Makefile6
-rw-r--r--usr.bin/global/gctags/Makefile10
-rw-r--r--usr.bin/global/global/Makefile6
-rw-r--r--usr.bin/global/gtags/Makefile6
-rw-r--r--usr.bin/global/lib/Makefile10
-rw-r--r--usr.bin/hexdump/display.c11
-rw-r--r--usr.bin/indent/indent.c8
-rw-r--r--usr.bin/kdump/mkioctls62
-rw-r--r--usr.bin/locate/locate/locate.rc4
-rw-r--r--usr.bin/locate/locate/mklocatedb.sh49
-rw-r--r--usr.bin/locate/locate/updatedb.sh16
-rw-r--r--usr.bin/login/Makefile26
-rw-r--r--usr.bin/login/klogin.c204
-rw-r--r--usr.bin/login/login.19
-rw-r--r--usr.bin/login/login.access.53
-rw-r--r--usr.bin/login/login.c470
-rw-r--r--usr.bin/m4/m4.14
-rw-r--r--usr.bin/mail/strings.c4
-rw-r--r--usr.bin/make/job.c4
-rw-r--r--usr.bin/make/main.c25
-rw-r--r--usr.bin/make/make.149
-rw-r--r--usr.bin/make/make.h3
-rw-r--r--usr.bin/make/parse.c6
-rw-r--r--usr.bin/mklocale/data/Makefile7
-rw-r--r--usr.bin/mklocale/data/lt_LN.DIS_8859-15.src47
-rw-r--r--usr.bin/mt/mt.c90
-rw-r--r--usr.bin/netstat/main.c26
-rw-r--r--usr.bin/netstat/mbuf.c4
-rw-r--r--usr.bin/netstat/mroute.c85
-rw-r--r--usr.bin/netstat/netstat.h4
-rw-r--r--usr.bin/nfsstat/nfsstat.c2
-rw-r--r--usr.bin/objformat/Makefile10
-rw-r--r--usr.bin/objformat/objformat.194
-rw-r--r--usr.bin/objformat/objformat.c124
-rw-r--r--usr.bin/passwd/passwd.14
-rw-r--r--usr.bin/printf/printf.c18
-rw-r--r--usr.bin/rwall/rwall.c7
-rw-r--r--usr.bin/rwho/rwho.12
-rw-r--r--usr.bin/sasc/INSTALL2
-rw-r--r--usr.bin/sed/Makefile1
-rw-r--r--usr.bin/sed/compile.c16
-rw-r--r--usr.bin/sed/extern.h2
-rw-r--r--usr.bin/sed/main.c18
-rw-r--r--usr.bin/sed/process.c4
-rw-r--r--usr.bin/systat/devs.h28
-rw-r--r--usr.bin/systat/systat.121
-rw-r--r--usr.bin/systat/vmstat.c2
-rw-r--r--usr.bin/tcopy/pathnames.h2
-rw-r--r--usr.bin/telnet/commands.c3
-rw-r--r--usr.bin/telnet/externs.h1
-rw-r--r--usr.bin/telnet/main.c5
-rw-r--r--usr.bin/telnet/telnet.15
-rw-r--r--usr.bin/telnet/telnet.c1
-rw-r--r--usr.bin/tftp/extern.h2
-rw-r--r--usr.bin/tftp/main.c6
-rw-r--r--usr.bin/tftp/tftp.c4
-rw-r--r--usr.bin/top/machine.c63
-rw-r--r--usr.bin/touch/touch.12
-rw-r--r--usr.bin/touch/touch.c5
-rw-r--r--usr.bin/truss/main.c3
-rw-r--r--usr.bin/vi/Makefile11
-rw-r--r--usr.bin/vmstat/vmstat.c2
-rw-r--r--usr.bin/w/pr_time.c9
-rw-r--r--usr.bin/w/w.c45
-rw-r--r--usr.bin/wall/wall.c14
-rw-r--r--usr.bin/xinstall/xinstall.c3
-rw-r--r--usr.bin/yacc/test/ftp.y4
203 files changed, 1251 insertions, 3146 deletions
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index b5c48ce095e1f..847bd321fc50c 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -1,5 +1,5 @@
# From: @(#)Makefile 8.3 (Berkeley) 1/7/94
-# $Id: Makefile,v 1.121 1998/11/09 11:08:48 dima Exp $
+# $Id: Makefile,v 1.116 1998/10/03 17:59:26 sef Exp $
# XXX MISSING: deroff diction graph learn plot
# spell spline struct xsend
@@ -32,12 +32,9 @@ SUBDIR= apply \
cpp \
ctags \
cut \
- dig \
dirname \
- dnsquery \
du \
ee \
- enigma \
env \
error \
expand \
@@ -53,7 +50,6 @@ SUBDIR= apply \
fpr \
from \
fsplit \
- fstat \
ftp \
gencat \
gensetdefs \
@@ -61,7 +57,6 @@ SUBDIR= apply \
global \
head \
hexdump \
- host \
id \
indent \
ipcrm \
@@ -145,7 +140,6 @@ SUBDIR= apply \
split \
su \
symorder \
- systat \
tail \
talk \
tconv \
@@ -178,7 +172,6 @@ SUBDIR= apply \
vgrind \
vi \
vis \
- vmstat \
w \
wall \
wc \
@@ -209,16 +202,22 @@ SUBDIR+=telnet
# Things that don't compile on alpha or are aout specific:
SUBDIR+=ar \
brandelf \
+ dig \
+ dnsquery \
+ fstat \
gcore \
gprof \
gprof4 \
+ host \
modstat \
nm \
ranlib \
sasc \
size \
strings \
- strip
+ strip \
+ systat \
+ vmstat
.endif
.include <bsd.subdir.mk>
diff --git a/usr.bin/apply/Makefile b/usr.bin/apply/Makefile
index 05823eaaa3014..59f358ed5292c 100644
--- a/usr.bin/apply/Makefile
+++ b/usr.bin/apply/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= apply
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c
index 3f0727d372c0f..37a77b7d05c93 100644
--- a/usr.bin/apply/apply.c
+++ b/usr.bin/apply/apply.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94";
+static char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94";
#endif /* not lint */
#include <sys/wait.h>
diff --git a/usr.bin/ar/Makefile b/usr.bin/ar/Makefile
index 7392d139db4de..ec9b2629eaa6e 100644
--- a/usr.bin/ar/Makefile
+++ b/usr.bin/ar/Makefile
@@ -1,8 +1,8 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $Id: Makefile,v 1.7 1998/10/10 12:48:48 bde Exp $
+# $Id$
PROG= ar
-CFLAGS+=-I${.CURDIR} -Wall
+CFLAGS+=-I${.CURDIR}
SRCS= append.c ar.c archive.c contents.c delete.c extract.c misc.c \
move.c print.c replace.c
MAN1aout=ar.1aout
diff --git a/usr.bin/ar/append.c b/usr.bin/ar/append.c
index 58c06b5e0a79a..ea2e04c64b074 100644
--- a/usr.bin/ar/append.c
+++ b/usr.bin/ar/append.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)append.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)append.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c
index b2c85fc795371..f27ff84c43bb8 100644
--- a/usr.bin/ar/ar.c
+++ b/usr.bin/ar/ar.c
@@ -33,17 +33,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ar.c,v 1.6 1997/06/23 06:41:30 charnier Exp $
+ * $Id$
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)ar.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)ar.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
@@ -80,7 +80,7 @@ main(argc, argv)
{
int c;
char *p;
- int (*fcall) __P((char **)) = NULL;
+ int (*fcall) __P((char **));
(void) setlocale(LC_TIME, "");;
diff --git a/usr.bin/ar/archive.c b/usr.bin/ar/archive.c
index 71606bd3efb6f..c8803cc0bc1c3 100644
--- a/usr.bin/ar/archive.c
+++ b/usr.bin/ar/archive.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)archive.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)archive.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
@@ -279,7 +279,7 @@ copy_ar(cfp, size)
{
static char pad = '\n';
off_t sz;
- int from, nr = 0, nw, off, to;
+ int from, nr, nw, off, to;
char buf[8*1024];
if (!(sz = size))
diff --git a/usr.bin/ar/contents.c b/usr.bin/ar/contents.c
index e31cd639acfa3..e000d535dc590 100644
--- a/usr.bin/ar/contents.c
+++ b/usr.bin/ar/contents.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)contents.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)contents.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/delete.c b/usr.bin/ar/delete.c
index 152395bef3a73..5824b61224847 100644
--- a/usr.bin/ar/delete.c
+++ b/usr.bin/ar/delete.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)delete.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)delete.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/extract.c b/usr.bin/ar/extract.c
index 89503f391c123..c80e37ce50c89 100644
--- a/usr.bin/ar/extract.c
+++ b/usr.bin/ar/extract.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)extract.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)extract.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/misc.c b/usr.bin/ar/misc.c
index 026c45dcf5988..bcd97118be228 100644
--- a/usr.bin/ar/misc.c
+++ b/usr.bin/ar/misc.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/move.c b/usr.bin/ar/move.c
index 3450ab44bf612..c2dba365dce53 100644
--- a/usr.bin/ar/move.c
+++ b/usr.bin/ar/move.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)move.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)move.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/print.c b/usr.bin/ar/print.c
index accc2e4e60e61..436762859eb6b 100644
--- a/usr.bin/ar/print.c
+++ b/usr.bin/ar/print.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/ar/replace.c b/usr.bin/ar/replace.c
index 0cbffd7c23f9d..b9a6cc6dc7c57 100644
--- a/usr.bin/ar/replace.c
+++ b/usr.bin/ar/replace.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)replace.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)replace.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/at/Makefile b/usr.bin/at/Makefile
index 393af83878757..55d78b9fbd126 100644
--- a/usr.bin/at/Makefile
+++ b/usr.bin/at/Makefile
@@ -1,9 +1,8 @@
-# $Id: Makefile,v 1.8 1998/09/19 22:42:03 obrien Exp $
+# $Id: Makefile,v 1.7 1998/06/09 04:07:08 imp Exp $
.include "${.CURDIR}/Makefile.inc"
PROG= at
-CFLAGS+=-Wall
SRCS= at.c panic.c parsetime.c perm.c
LINKS= ${BINDIR}/at ${BINDIR}/atq \
${BINDIR}/at ${BINDIR}/atrm \
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index 3264d5502a2de..daded161ad840 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -92,7 +92,7 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */
/* File scope variables */
-static const char rcsid[] = "$Id: at.c,v 1.14 1998/10/15 13:30:48 mckay Exp $";
+static char rcsid[] = "$Id: at.c,v 1.13 1997/03/29 04:27:56 imp Exp $";
char *no_export[] =
{
"TERM", "TERMCAP", "DISPLAY", "_"
diff --git a/usr.bin/at/panic.c b/usr.bin/at/panic.c
index c111dd8233846..7ef0e15d13b1f 100644
--- a/usr.bin/at/panic.c
+++ b/usr.bin/at/panic.c
@@ -37,8 +37,7 @@
/* File scope variables */
-static const char rcsid[] =
- "$Id: panic.c,v 1.7 1997/06/23 06:44:18 charnier Exp $";
+static char rcsid[] = "$Id: panic.c,v 1.6 1997/02/22 19:54:06 peter Exp $";
/* External variables */
diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c
index 8cde1dceeb01f..8ba6a149d822c 100644
--- a/usr.bin/at/parsetime.c
+++ b/usr.bin/at/parsetime.c
@@ -143,8 +143,7 @@ static size_t sc_len; /* scanner - lenght of token buffer */
static int sc_tokid; /* scanner - token id */
static int sc_tokplur; /* scanner - is token plural? */
-static const char rcsid[] =
- "$Id: parsetime.c,v 1.15 1998/08/30 17:33:05 steve Exp $";
+static char rcsid[] = "$Id: parsetime.c,v 1.14 1998/08/08 14:02:06 alex Exp $";
/* Local functions */
@@ -465,7 +464,7 @@ static void
month(struct tm *tm)
{
long year= (-1);
- long mday = 0, wday, mon;
+ long mday, wday, mon;
int tlen;
switch (sc_tokid) {
diff --git a/usr.bin/at/perm.c b/usr.bin/at/perm.c
index f1d435246a7d7..d52fd3db19901 100644
--- a/usr.bin/at/perm.c
+++ b/usr.bin/at/perm.c
@@ -48,7 +48,7 @@
/* File scope variables */
-static const char rcsid[] = "$Id: perm.c,v 1.5 1997/02/22 19:54:08 peter Exp $";
+static char rcsid[] = "$Id$";
/* Function declarations */
diff --git a/usr.bin/banner/Makefile b/usr.bin/banner/Makefile
index c04e68ae64b2c..54a3ad5cb20b1 100644
--- a/usr.bin/banner/Makefile
+++ b/usr.bin/banner/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= banner
-CFLAGS+=-Wall
MAN6= banner.6
.include <bsd.prog.mk>
diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c
index 15a2952ed1f4d..13a28497489d7 100644
--- a/usr.bin/banner/banner.c
+++ b/usr.bin/banner/banner.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)banner.c 8.4 (Berkeley) 4/29/95";
+static char sccsid[] = "@(#)banner.c 8.4 (Berkeley) 4/29/95";
#endif /* not lint */
/*
diff --git a/usr.bin/basename/Makefile b/usr.bin/basename/Makefile
index d74d67007e380..21354bd3a113d 100644
--- a/usr.bin/basename/Makefile
+++ b/usr.bin/basename/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= basename
-CFLAGS+=-Wall
MLINKS= basename.1 dirname.1
.include <bsd.prog.mk>
diff --git a/usr.bin/basename/basename.c b/usr.bin/basename/basename.c
index 1a6aa485be05f..596401311759f 100644
--- a/usr.bin/basename/basename.c
+++ b/usr.bin/basename/basename.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1991, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)basename.c 8.4 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)basename.c 8.4 (Berkeley) 5/4/95";
#endif /* not lint */
#include <stdio.h>
diff --git a/usr.bin/biff/Makefile b/usr.bin/biff/Makefile
index db26fc47fbbad..81cb86bc6afa7 100644
--- a/usr.bin/biff/Makefile
+++ b/usr.bin/biff/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= biff
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c
index 185d6349167e3..52f5229ff1a87 100644
--- a/usr.bin/biff/biff.c
+++ b/usr.bin/biff/biff.c
@@ -30,17 +30,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: biff.c,v 1.4 1997/12/29 00:08:50 alex Exp $
+ * $Id: biff.c,v 1.3 1997/06/23 06:45:38 charnier Exp $
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)biff.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)biff.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/brandelf/Makefile b/usr.bin/brandelf/Makefile
index 81d0039e47dfb..3561ec00cf755 100644
--- a/usr.bin/brandelf/Makefile
+++ b/usr.bin/brandelf/Makefile
@@ -1,4 +1,3 @@
PROG= brandelf
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/calendar/calendars/calendar.birthday b/usr.bin/calendar/calendars/calendar.birthday
index 10ea34328ca9e..99922af3402b5 100644
--- a/usr.bin/calendar/calendars/calendar.birthday
+++ b/usr.bin/calendar/calendars/calendar.birthday
@@ -1,7 +1,7 @@
/*
* Birthday
*
- * $Id: calendar.birthday,v 1.9 1998/10/22 07:56:22 torstenb Exp $
+ * $Id: calendar.birthday,v 1.6 1997/02/25 01:20:23 mpp Exp $
*/
#ifndef _calendar_birthday_
@@ -177,7 +177,6 @@
07/30 Henry Ford born, 1863
08/01 Herman Melville born, 1819
08/03 Lenny Bruce dies of a morphine overdose, 1966
-08/06 Jonathan B. Postel is born in Altadena, Calif.
08/08 Dustin Hoffman born in Los Angeles, 1937
08/12 Thomas Mann's Death, 1955
08/13 Annie Oakley born, 1860
@@ -230,7 +229,6 @@
10/15 Pelham Grenville Wodehouse born, 1881
10/16 Noah Webster born, 1758
10/16 Oscar (Fingal O'Flahertie Wills) Wilde born in Dublin, 1854
-10/16 Dr. Jonathan B. Postel dies at age 55, 1998
10/17 Richard Mentor Johnson born, 1780, 9th V.P. of U.S.
10/21 Alfred Nobel born in Stockholm, 1833
10/27 Gerald M. Weinberg born, 1933
diff --git a/usr.bin/cap_mkdb/Makefile b/usr.bin/cap_mkdb/Makefile
index 88a34d7dae450..0e403afc409ff 100644
--- a/usr.bin/cap_mkdb/Makefile
+++ b/usr.bin/cap_mkdb/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= cap_mkdb
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/cap_mkdb/cap_mkdb.c b/usr.bin/cap_mkdb/cap_mkdb.c
index f28d8db0805de..91c2222284561 100644
--- a/usr.bin/cap_mkdb/cap_mkdb.c
+++ b/usr.bin/cap_mkdb/cap_mkdb.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)cap_mkdb.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)cap_mkdb.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/chat/Makefile b/usr.bin/chat/Makefile
index 1154024e846f9..ab4129e050480 100644
--- a/usr.bin/chat/Makefile
+++ b/usr.bin/chat/Makefile
@@ -1,7 +1,6 @@
-# $Id: Makefile,v 1.5 1997/08/22 15:42:31 peter Exp $
+# $Id: Makefile,v 1.4 1997/02/22 19:54:21 peter Exp $
PROG= chat
-CFLAGS+=-Wall
SRCS= chat.c
MAN8= chat.8
diff --git a/usr.bin/chat/chat.c b/usr.bin/chat/chat.c
index c25b8cfd8775d..f3676aa02799d 100644
--- a/usr.bin/chat/chat.c
+++ b/usr.bin/chat/chat.c
@@ -78,8 +78,7 @@
*/
#ifndef lint
-static const char rcsid[] =
- "$Id: chat.c,v 1.12 1998/06/23 21:58:41 peter Exp $";
+static char rcsid[] = "$Id: chat.c,v 1.11 1998/03/21 20:47:04 peter Exp $";
#endif
#include <stdio.h>
diff --git a/usr.bin/checknr/Makefile b/usr.bin/checknr/Makefile
index 85e4c48e827d1..c26524876bd44 100644
--- a/usr.bin/checknr/Makefile
+++ b/usr.bin/checknr/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= checknr
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/checknr/checknr.c b/usr.bin/checknr/checknr.c
index 743ed04e24c54..f8531cc7da136 100644
--- a/usr.bin/checknr/checknr.c
+++ b/usr.bin/checknr/checknr.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)checknr.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)checknr.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
/*
diff --git a/usr.bin/chflags/Makefile b/usr.bin/chflags/Makefile
index d05ff81f8a1f9..d269255b6c656 100644
--- a/usr.bin/chflags/Makefile
+++ b/usr.bin/chflags/Makefile
@@ -3,7 +3,6 @@
NOSHARED?=yes
PROG= chflags
-CFLAGS+=-Wall
SRCS= chflags.c stat_flags.c
.PATH: ${.CURDIR}/../../bin/ls
diff --git a/usr.bin/chflags/chflags.c b/usr.bin/chflags/chflags.c
index 664609417ef51..f33f46eeccf3d 100644
--- a/usr.bin/chflags/chflags.c
+++ b/usr.bin/chflags/chflags.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1992, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)chflags.c 8.5 (Berkeley) 4/1/94";
+static char sccsid[] = "@(#)chflags.c 8.5 (Berkeley) 4/1/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/chpass/Makefile b/usr.bin/chpass/Makefile
index 3abed829d3ac7..f19a25730d1fd 100644
--- a/usr.bin/chpass/Makefile
+++ b/usr.bin/chpass/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.2 (Berkeley) 4/2/94
PROG= chpass
-CFLAGS+=-Wall
SRCS= chpass.c edit.c field.c pw_copy.c pw_scan.c pw_util.c pw_yp.c \
table.c util.c ypxfr_misc.c ${GENSRCS}
GENSRCS=yp.h yp_clnt.c yppasswd.h yppasswd_clnt.c yppasswd_private.h \
diff --git a/usr.bin/chpass/chpass.1 b/usr.bin/chpass/chpass.1
index 8bcd8c8263587..c810f9bffcadd 100644
--- a/usr.bin/chpass/chpass.1
+++ b/usr.bin/chpass/chpass.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)chpass.1 8.2 (Berkeley) 12/30/93
-.\" $Id: chpass.1,v 1.13 1998/12/13 02:48:43 dillon Exp $
+.\" $Id: chpass.1,v 1.7.2.4 1998/08/14 03:38:01 thepish Exp $
.\"
.Dd December 30, 1993
.Dt CHPASS 1
@@ -88,30 +88,26 @@ user's encrypted password
user's login
.It Gid:
user's login group
-.It Class:
-user's general classification
.It Change:
password change time
.It Expire:
account expiration time
+.It Class:
+user's general classification
+.It Home Directory:
+user's home directory
+.It Shell:
+user's login shell
.It Full Name:
user's real name
.It Location:
-user's normal location (1)
+user's normal location
.It Home Phone:
-user's home phone (1)
+user's home phone
.It Office Phone:
-user's office phone (1)
+user's office phone
.It Other Information:
-any locally defined parameters for user (1)
-.It Home Directory:
-user's home directory
-.It Shell:
-user's login shell
-.Pp
-.It NOTE(1) -
-In the actual master.passwd file, these fields are comma-delimited
-fields embedded in the FullName field.
+any locally defined parameters for user
.El
.Pp
The
@@ -145,13 +141,6 @@ This field may be filled in with either a number or a group name (see
.Xr group 5 ) .
.Pp
The
-.Ar class
-field references class descriptions in
-.Ar /etc/login.conf
-and is typically used to initialize the user's system resource limits
-when they login.
-.Pp
-The
.Ar change
field is the date by which the password must be changed.
.Pp
@@ -171,15 +160,12 @@ is the day of the month, and
.Ar year
is the year.
.Pp
-Five fields are available for storing the user's
-.Ar full name , office location ,
-.Ar work
-and
-.Ar home telephone
-numbers and finally
-.Ar other information
-which is a single comma delimited string to represent any additional
-gcos fields (typically used for site specific user information).
+The
+.Ar class
+field is currently unused. In the near future it will be a key to
+a
+.Xr termcap 5
+style database of user attributes.
.Pp
The user's
.Ar home directory
@@ -200,6 +186,16 @@ shell.
Non-standard is defined as a shell not found in
.Pa /etc/shells .
.Pp
+The last five fields are for storing the user's
+.Ar full name , office location ,
+.Ar work
+and
+.Ar home telephone
+numbers and finally
+.Ar other information
+which is a single comma delimited string to represent any additional
+gcos fields (typically used for site specific user information).
+.Pp
Once the information has been verified,
.Nm chpass
uses
@@ -402,7 +398,6 @@ The list of approved shells
.Xr login 1 ,
.Xr passwd 1 ,
.Xr getusershell 3 ,
-.Xr login.conf 5,
.Xr passwd 5 ,
.Xr pwd_mkdb 8 ,
.Xr vipw 8
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c
index 2809f8bef74f8..982548fa5a469 100644
--- a/usr.bin/chpass/chpass.c
+++ b/usr.bin/chpass/chpass.c
@@ -32,15 +32,15 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1988, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "From: @(#)chpass.c 8.4 (Berkeley) 4/2/94";
-static const char rcsid[] =
- "$Id: chpass.c,v 1.14 1997/03/29 04:28:38 imp Exp $";
+static char sccsid[] = "From: @(#)chpass.c 8.4 (Berkeley) 4/2/94";
+static char rcsid[] =
+ "$Id: chpass.c,v 1.13 1997/02/22 19:54:25 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -83,10 +83,10 @@ main(argc, argv)
char **argv;
{
enum { NEWSH, LOADENTRY, EDITENTRY, NEWPW, NEWEXP } op;
- struct passwd *pw = NULL, lpw;
+ struct passwd *pw, lpw;
char *username = NULL;
int ch, pfd, tfd;
- char *arg = NULL;
+ char *arg;
#ifdef YP
int force_local = 0;
int force_yp = 0;
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c
index 9cae42e753fc2..68dbc0ea50e38 100644
--- a/usr.bin/chpass/edit.c
+++ b/usr.bin/chpass/edit.c
@@ -30,11 +30,11 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: edit.c,v 1.11 1998/08/14 03:18:32 thepish Exp $
+ * $Id: edit.c,v 1.10 1997/06/25 06:59:55 charnier Exp $
*/
#ifndef lint
-static const char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/chpass/field.c b/usr.bin/chpass/field.c
index 997d21feed308..73fa4795a2e07 100644
--- a/usr.bin/chpass/field.c
+++ b/usr.bin/chpass/field.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)field.c 8.4 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)field.c 8.4 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/chpass/pw_copy.c b/usr.bin/chpass/pw_copy.c
index d60f75177492f..73e2da22115ce 100644
--- a/usr.bin/chpass/pw_copy.c
+++ b/usr.bin/chpass/pw_copy.c
@@ -66,8 +66,8 @@ pw_copy(ffd, tfd, pw)
snprintf(uidstr, sizeof(uidstr), "%d", pw->pw_uid);
snprintf(gidstr, sizeof(gidstr), "%d", pw->pw_gid);
- snprintf(chgstr, sizeof(chgstr), "%ld", (long)pw->pw_change);
- snprintf(expstr, sizeof(expstr), "%ld", (long)pw->pw_expire);
+ snprintf(chgstr, sizeof(chgstr), "%ld", pw->pw_change);
+ snprintf(expstr, sizeof(expstr), "%ld", pw->pw_expire);
if (!(from = fdopen(ffd, "r")))
pw_error(_PATH_MASTERPASSWD, 1, 1);
diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c
index 57542704392a9..777ec54d4633a 100644
--- a/usr.bin/chpass/pw_yp.c
+++ b/usr.bin/chpass/pw_yp.c
@@ -35,7 +35,7 @@
* Center for Telecommunications Research
* Columbia University, New York City
*
- * $Id: pw_yp.c,v 1.12 1997/12/18 15:27:43 bde Exp $
+ * $Id: pw_yp.c,v 1.11 1997/07/29 15:45:36 wpaul Exp $
*/
#ifdef YP
@@ -254,7 +254,7 @@ int use_yp (user, uid, which)
char ubuf[UT_NAMESIZE + 2];
if (which) {
- snprintf(ubuf, sizeof(ubuf), "%lu", (unsigned long)uid);
+ snprintf(ubuf, sizeof(ubuf), "%lu", uid);
user = (char *)&ubuf;
}
diff --git a/usr.bin/chpass/table.c b/usr.bin/chpass/table.c
index 1bc857b87ca8e..eed097eebad81 100644
--- a/usr.bin/chpass/table.c
+++ b/usr.bin/chpass/table.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)table.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)table.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/chpass/util.c b/usr.bin/chpass/util.c
index d8917f51bc965..132c1514f99aa 100644
--- a/usr.bin/chpass/util.c
+++ b/usr.bin/chpass/util.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)util.c 8.4 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
- "$Id: util.c,v 1.6 1998/03/23 07:41:49 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -115,12 +115,9 @@ atot(p, store)
year = atoi(t);
if (day < 1 || day > 31 || month < 1 || month > 12 || !year)
goto bad;
- /* Allow two digit years 1969-2068 */
- if (year < 69)
- year += 2000;
- else if (year < 100)
+ if (year < 100)
year += 1900;
- if (year < 1969)
+ if (year <= 1970)
bad: return (1);
lt->tm_year = year - 1900;
lt->tm_mon = month - 1;
diff --git a/usr.bin/cksum/Makefile b/usr.bin/cksum/Makefile
index 4c1d027c04b04..f4fa373c41b17 100644
--- a/usr.bin/cksum/Makefile
+++ b/usr.bin/cksum/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.2 (Berkeley) 4/28/95
PROG= cksum
-CFLAGS+=-Wall
SRCS= cksum.c crc.c print.c sum1.c sum2.c crc32.c
LINKS= ${BINDIR}/cksum ${BINDIR}/sum
MLINKS= cksum.1 sum.1
diff --git a/usr.bin/cksum/crc.c b/usr.bin/cksum/crc.c
index 0dde11d64b0a7..352639531c961 100644
--- a/usr.bin/cksum/crc.c
+++ b/usr.bin/cksum/crc.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93";
+static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cksum/print.c b/usr.bin/cksum/print.c
index b3a92d39a24f4..48c38aa9a2144 100644
--- a/usr.bin/cksum/print.c
+++ b/usr.bin/cksum/print.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)print.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cksum/sum1.c b/usr.bin/cksum/sum1.c
index a46a575b323f7..1975ee27fd9da 100644
--- a/usr.bin/cksum/sum1.c
+++ b/usr.bin/cksum/sum1.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)sum1.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)sum1.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cksum/sum2.c b/usr.bin/cksum/sum2.c
index 11abb2c84095a..792205044c501 100644
--- a/usr.bin/cksum/sum2.c
+++ b/usr.bin/cksum/sum2.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)sum2.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)sum2.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cmp/Makefile b/usr.bin/cmp/Makefile
index 1ff3af6e62627..1b84ce31b4922 100644
--- a/usr.bin/cmp/Makefile
+++ b/usr.bin/cmp/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= cmp
-CFLAGS+=-Wall
SRCS= cmp.c misc.c regular.c special.c
.include <bsd.prog.mk>
diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c
index a4f4d8860563e..da269d844a95f 100644
--- a/usr.bin/cmp/cmp.c
+++ b/usr.bin/cmp/cmp.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1987, 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cmp/misc.c b/usr.bin/cmp/misc.c
index 248ef93f0b741..d5a601daf01aa 100644
--- a/usr.bin/cmp/misc.c
+++ b/usr.bin/cmp/misc.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c
index 3b82bae11a690..f540ab4aebe8a 100644
--- a/usr.bin/cmp/regular.c
+++ b/usr.bin/cmp/regular.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/cmp/special.c b/usr.bin/cmp/special.c
index b843cc8fc9cc5..0a15fa1b28f4e 100644
--- a/usr.bin/cmp/special.c
+++ b/usr.bin/cmp/special.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/col/Makefile b/usr.bin/col/Makefile
index 9edab17f76982..efa0933830a2b 100644
--- a/usr.bin/col/Makefile
+++ b/usr.bin/col/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= col
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index 8d26faadc0a05..88d024e721775 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -35,13 +35,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)col.c 8.5 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)col.c 8.5 (Berkeley) 5/4/95";
#endif /* not lint */
#include <ctype.h>
diff --git a/usr.bin/colcrt/Makefile b/usr.bin/colcrt/Makefile
index 9bb24b735b8f1..e03ab0ca8a9fd 100644
--- a/usr.bin/colcrt/Makefile
+++ b/usr.bin/colcrt/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= colcrt
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/colcrt/colcrt.c b/usr.bin/colcrt/colcrt.c
index e6dc445435806..40fe5cef49b25 100644
--- a/usr.bin/colcrt/colcrt.c
+++ b/usr.bin/colcrt/colcrt.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)colcrt.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)colcrt.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#include <err.h>
diff --git a/usr.bin/colldef/Makefile b/usr.bin/colldef/Makefile
index ccb5e98f452eb..474bf7bd4da36 100644
--- a/usr.bin/colldef/Makefile
+++ b/usr.bin/colldef/Makefile
@@ -1,8 +1,7 @@
-# $Id: Makefile,v 1.13 1998/05/05 13:16:22 bde Exp $
+# $Id: Makefile,v 1.12 1998/05/04 20:09:02 bde Exp $
PROG = colldef
LFLAGS = -8 -i
-CFLAGS += -Wall
CFLAGS += -I. -I${.CURDIR}/../../lib/libc/locale -DCOLLATE_DEBUG
SRCS = parse.y scan.l y.tab.h
LDADD = -ll
diff --git a/usr.bin/colldef/parse.y b/usr.bin/colldef/parse.y
index cfc5642118f70..e316e1c899280 100644
--- a/usr.bin/colldef/parse.y
+++ b/usr.bin/colldef/parse.y
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: parse.y,v 1.10 1997/06/30 11:24:18 charnier Exp $
+ * $Id: parse.y,v 1.9 1997/06/26 11:25:17 charnier Exp $
*/
#include <err.h>
@@ -40,8 +40,6 @@
extern int line_no;
extern FILE *yyin;
void yyerror(char *fmt, ...);
-int yyparse(void);
-int yylex(void);
static void usage __P((void));
char map_name[FILENAME_MAX] = ".";
@@ -210,7 +208,6 @@ sec_sub_item : CHAR {
}
;
%%
-int
main(ac, av)
char **av;
{
@@ -271,7 +268,6 @@ void yyerror(char *fmt, ...)
}
#ifdef COLLATE_DEBUG
-void
collate_print_tables()
{
int i;
diff --git a/usr.bin/colrm/Makefile b/usr.bin/colrm/Makefile
index 7413d42562eb1..b9c8341100a68 100644
--- a/usr.bin/colrm/Makefile
+++ b/usr.bin/colrm/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= colrm
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index 2c9e0e496e6ef..1195300a8d299 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -30,17 +30,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: colrm.c,v 1.5 1997/12/29 00:08:59 alex Exp $
+ * $Id: colrm.c,v 1.4 1997/06/30 11:05:42 charnier Exp $
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)colrm.c 8.2 (Berkeley) 5/4/95";
#endif /* not lint */
#include <sys/types.h>
diff --git a/usr.bin/column/Makefile b/usr.bin/column/Makefile
index 33de9f61fe7ec..1c304e2b3927c 100644
--- a/usr.bin/column/Makefile
+++ b/usr.bin/column/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= column
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/column/column.c b/usr.bin/column/column.c
index 043ab9df24831..cf8c7a92f5e04 100644
--- a/usr.bin/column/column.c
+++ b/usr.bin/column/column.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)column.c 8.4 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)column.c 8.4 (Berkeley) 5/4/95";
#endif /* not lint */
#include <sys/types.h>
@@ -79,7 +79,7 @@ main(argc, argv)
char *p;
if (ioctl(1, TIOCGWINSZ, &win) == -1 || !win.ws_col) {
- if ((p = getenv("COLUMNS")))
+ if (p = getenv("COLUMNS"))
termwidth = atoi(p);
} else
termwidth = win.ws_col;
@@ -109,7 +109,7 @@ main(argc, argv)
if (!*argv)
input(stdin);
else for (; *argv; ++argv)
- if ((fp = fopen(*argv, "r"))) {
+ if (fp = fopen(*argv, "r")) {
input(fp);
(void)fclose(fp);
} else {
@@ -150,7 +150,7 @@ c_columnate()
endcol = maxlength;
putchar('\n');
} else {
- while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol) {
+ while ((cnt = (chcnt + TAB & ~(TAB - 1))) <= endcol) {
(void)putchar('\t');
chcnt = cnt;
}
@@ -178,7 +178,7 @@ r_columnate()
chcnt += printf("%s", list[base]);
if ((base += numrows) >= entries)
break;
- while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol) {
+ while ((cnt = (chcnt + TAB & ~(TAB - 1))) <= endcol) {
(void)putchar('\t');
chcnt = cnt;
}
@@ -218,7 +218,7 @@ maketbl()
cols = emalloc((maxcols = DEFCOLS) * sizeof(char *));
lens = emalloc(maxcols * sizeof(int));
for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) {
- for (coloff = 0, p = *lp; (cols[coloff] = strtok(p, separator));
+ for (coloff = 0, p = *lp; cols[coloff] = strtok(p, separator);
p = NULL)
if (++coloff == maxcols) {
if (!(cols = realloc(cols, (u_int)maxcols +
diff --git a/usr.bin/comm/Makefile b/usr.bin/comm/Makefile
index d311527dfd3ad..694202339b32e 100644
--- a/usr.bin/comm/Makefile
+++ b/usr.bin/comm/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= comm
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/comm/comm.c b/usr.bin/comm/comm.c
index 70e7c0d016165..debbb0b6f6d0c 100644
--- a/usr.bin/comm/comm.c
+++ b/usr.bin/comm/comm.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "From: @(#)comm.c 8.4 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
- "$Id: comm.c,v 1.4 1997/09/07 15:09:17 joerg Exp $";
+ "$Id$";
#endif /* not lint */
#include <err.h>
@@ -69,7 +69,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- int comp, file1done = 0, file2done = 0, read1, read2;
+ int comp, file1done, file2done, read1, read2;
int ch, flag1, flag2, flag3, iflag;
FILE *fp1, *fp2;
char *col1, *col2, *col3;
diff --git a/usr.bin/compile_et/compile_et.c b/usr.bin/compile_et/compile_et.c
index 92fd0c2c1132c..055a9b6e611fd 100644
--- a/usr.bin/compile_et/compile_et.c
+++ b/usr.bin/compile_et/compile_et.c
@@ -26,7 +26,7 @@ static const char copyright[] =
"Copyright 1987,1988 by MIT Student Information Processing Board";
static const char rcsid_compile_et_c[] =
- "$Header: /home/ncvs/src/usr.bin/compile_et/compile_et.c,v 1.5 1998/12/15 12:20:27 des Exp $";
+ "$Header: /home/ncvs/src/usr.bin/compile_et/compile_et.c,v 1.3 1996/07/12 19:05:17 jkh Exp $";
#endif
extern char *gensym();
@@ -73,13 +73,19 @@ static const char *const language_names[] = {
0,
};
-static const char * const noargs_def[] = {
+static const char * const c_src_prolog[] = {
+ "static const char * const text[] = {\n",
+ 0,
+};
+
+static const char * const krc_src_prolog[] = {
"#ifdef __STDC__\n",
"#define NOARGS void\n",
"#else\n",
"#define NOARGS\n",
"#define const\n",
"#endif\n\n",
+ "static const char * const text[] = {\n",
0,
};
@@ -215,12 +221,14 @@ int main (argc, argv) int argc; char **argv; {
fprintf (cfile, warning, c_file);
/* prologue */
- for (cpp = noargs_def; *cpp; cpp++) {
- fputs (*cpp, cfile);
- fputs (*cpp, hfile);
- }
-
- fputs("static const char * const text[] = {\n", cfile);
+ if (language == lang_C)
+ cpp = c_src_prolog;
+ else if (language == lang_KRC)
+ cpp = krc_src_prolog;
+ else
+ abort ();
+ while (*cpp)
+ fputs (*cpp++, cfile);
/* parse it */
yyparse();
@@ -234,8 +242,8 @@ int main (argc, argv) int argc; char **argv; {
table_number, current);
fputs("static struct et_list link = { 0, 0 };\n\n",
cfile);
- fprintf(cfile, "void initialize_%s_error_table (NOARGS) {\n",
- table_name);
+ fprintf(cfile, "void initialize_%s_error_table (%s) {\n",
+ table_name, (language == lang_C) ? "void" : "NOARGS");
fputs(" if (!link.table) {\n", cfile);
fputs(" link.next = _et_list;\n", cfile);
fputs(" link.table = &et;\n", cfile);
@@ -244,7 +252,7 @@ int main (argc, argv) int argc; char **argv; {
fputs("}\n", cfile);
fclose(cfile);
- fprintf (hfile, "extern void initialize_%s_error_table (NOARGS);\n",
+ fprintf (hfile, "extern void initialize_%s_error_table ();\n",
table_name);
fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%dL)\n",
table_name, table_number);
diff --git a/usr.bin/compress/Makefile b/usr.bin/compress/Makefile
index 02f7fbbd88101..0f6f5ddab9ce0 100644
--- a/usr.bin/compress/Makefile
+++ b/usr.bin/compress/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.2 (Berkeley) 4/17/94
PROG= compress
-CFLAGS+=-Wall
SRCS= compress.c zopen.c
LINKS= ${BINDIR}/compress ${BINDIR}/uncompress
MLINKS= compress.1 uncompress.1
diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c
index e81963527cbd5..32d94960eb9de 100644
--- a/usr.bin/compress/compress.c
+++ b/usr.bin/compress/compress.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94";
+static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94";
#endif /* not lint */
#include <sys/param.h>
@@ -80,7 +80,6 @@ main(argc, argv)
int bits, cat, ch;
char *p, newname[MAXPATHLEN];
- cat = 0;
if ((p = rindex(argv[0], '/')) == NULL)
p = argv[0];
else
@@ -89,13 +88,10 @@ main(argc, argv)
style = DECOMPRESS;
else if (!strcmp(p, "compress"))
style = COMPRESS;
- else if (!strcmp(p, "zcat")) {
- cat = 1;
- style = DECOMPRESS;
- } else
+ else
errx(1, "unknown program name");
- bits = 0;
+ bits = cat = 0;
while ((ch = getopt(argc, argv, "b:cdfv")) != -1)
switch(ch) {
case 'b':
diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c
index abe31f2de63f3..5e5357b74b9ed 100644
--- a/usr.bin/compress/zopen.c
+++ b/usr.bin/compress/zopen.c
@@ -388,7 +388,7 @@ output(zs, ocode)
* Since ocode is always >= 8 bits, only need to mask the first
* hunk on the left.
*/
- *bp = (*bp & rmask[r_off]) | ((ocode << r_off) & lmask[r_off]);
+ *bp = (*bp & rmask[r_off]) | (ocode << r_off) & lmask[r_off];
bp++;
bits -= (8 - r_off);
ocode >>= 8 - r_off;
@@ -698,7 +698,7 @@ zopen(fname, mode, bits)
{
struct s_zstate *zs;
- if ((mode[0] != 'r' && mode[0] != 'w') || mode[1] != '\0' ||
+ if (mode[0] != 'r' && mode[0] != 'w' || mode[1] != '\0' ||
bits < 0 || bits > BITS) {
errno = EINVAL;
return (NULL);
@@ -738,5 +738,4 @@ zopen(fname, mode, bits)
return (funopen(zs, NULL, zwrite, NULL, zclose));
}
/* NOTREACHED */
- return (NULL);
}
diff --git a/usr.bin/ctags/Makefile b/usr.bin/ctags/Makefile
index db595aa38b749..7a8ebce3971c6 100644
--- a/usr.bin/ctags/Makefile
+++ b/usr.bin/ctags/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= ctags
-CFLAGS+=-Wall
CFLAGS+=-I${.CURDIR}
SRCS= C.c ctags.c fortran.c lisp.c print.c tree.c yacc.c
diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c
index dc44ba67ad4b2..421d819fe3115 100644
--- a/usr.bin/ctags/ctags.c
+++ b/usr.bin/ctags/ctags.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1987, 1993, 1994, 1995\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)ctags.c 8.4 (Berkeley) 2/7/95";
+static char sccsid[] = "@(#)ctags.c 8.4 (Berkeley) 2/7/95";
#endif /* not lint */
#include <err.h>
diff --git a/usr.bin/ctags/fortran.c b/usr.bin/ctags/fortran.c
index d4b2723fe239b..0706b49a0070e 100644
--- a/usr.bin/ctags/fortran.c
+++ b/usr.bin/ctags/fortran.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)fortran.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)fortran.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <ctype.h>
diff --git a/usr.bin/ctags/lisp.c b/usr.bin/ctags/lisp.c
index f86e218f44f22..5f99984b906ef 100644
--- a/usr.bin/ctags/lisp.c
+++ b/usr.bin/ctags/lisp.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)lisp.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)lisp.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <ctype.h>
diff --git a/usr.bin/ctags/print.c b/usr.bin/ctags/print.c
index 65d6737fc2dab..bebdeb1bc90ba 100644
--- a/usr.bin/ctags/print.c
+++ b/usr.bin/ctags/print.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)print.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <limits.h>
diff --git a/usr.bin/ctags/tree.c b/usr.bin/ctags/tree.c
index 8e1ec22dd1b0e..61decd23048c2 100644
--- a/usr.bin/ctags/tree.c
+++ b/usr.bin/ctags/tree.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)tree.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)tree.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <err.h>
diff --git a/usr.bin/ctags/yacc.c b/usr.bin/ctags/yacc.c
index 7a27a6e47a687..1ed4c7d310387 100644
--- a/usr.bin/ctags/yacc.c
+++ b/usr.bin/ctags/yacc.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char sccsid[] = "@(#)yacc.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)yacc.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <ctype.h>
diff --git a/usr.bin/cut/Makefile b/usr.bin/cut/Makefile
index a3467c80ea78f..19b01009cedec 100644
--- a/usr.bin/cut/Makefile
+++ b/usr.bin/cut/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= cut
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c
index 168e7b626d4e3..cc57685ead21f 100644
--- a/usr.bin/cut/cut.c
+++ b/usr.bin/cut/cut.c
@@ -35,13 +35,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95";
#endif /* not lint */
#include <ctype.h>
@@ -70,7 +70,7 @@ main(argc, argv)
char *argv[];
{
FILE *fp;
- void (*fcn) __P((FILE *, char *)) = NULL;
+ void (*fcn) __P((FILE *, char *));
int ch;
dchar = '\t'; /* default delimiter is \t */
@@ -139,7 +139,7 @@ get_list(list)
* overlapping lists. We also handle "-3-5" although there's no
* real reason too.
*/
- for (; (p = strtok(list, ", \t")); list = NULL) {
+ for (; p = strtok(list, ", \t"); list = NULL) {
setautostart = start = stop = 0;
if (*p == '-') {
++p;
@@ -186,7 +186,7 @@ c_cut(fp, fname)
FILE *fp;
char *fname;
{
- register int ch = 0, col;
+ register int ch, col;
register char *pos;
for (;;) {
diff --git a/usr.bin/dirname/Makefile b/usr.bin/dirname/Makefile
index 0350db6690b98..76b4089abb80b 100644
--- a/usr.bin/dirname/Makefile
+++ b/usr.bin/dirname/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= dirname
-CFLAGS+=-Wall
NOMAN= noman
.include <bsd.prog.mk>
diff --git a/usr.bin/dirname/dirname.c b/usr.bin/dirname/dirname.c
index 056dc510737ae..c6ca32682b558 100644
--- a/usr.bin/dirname/dirname.c
+++ b/usr.bin/dirname/dirname.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1991, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)dirname.c 8.4 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)dirname.c 8.4 (Berkeley) 5/4/95";
#endif /* not lint */
#include <stdio.h>
diff --git a/usr.bin/doscmd/port.c b/usr.bin/doscmd/port.c
index c9a06b29957f7..7bcc539f2691a 100644
--- a/usr.bin/doscmd/port.c
+++ b/usr.bin/doscmd/port.c
@@ -29,7 +29,7 @@
*
* BSDI port.c,v 2.2 1996/04/08 19:33:03 bostic Exp
*
- * $Id: port.c,v 1.1 1997/08/09 01:42:54 dyson Exp $
+ * $Id: port.c,v 1.2 1996/09/22 05:53:08 miff Exp $
*/
#include "doscmd.h"
@@ -59,30 +59,15 @@ u_long ioports[MAXPORT/32];
static void
iomap(int port, int cnt)
{
- if (port + cnt >= MAXPORT) {
- errno = ERANGE;
- goto bad;
- }
- if (i386_set_ioperm(port, cnt, 1) < 0) {
- bad:
- perror("iomap");
- quit(1);
- }
+ fatal("iomap not supported");
}
static void
iounmap(int port, int cnt)
{
- if (port + cnt >= MAXPORT) {
- errno = ERANGE;
- goto bad;
- }
- if (i386_set_ioperm(port, cnt, 0) < 0) {
- bad:
- perror("iounmap");
- quit(1);
- }
+ fatal("iomap not supported");
}
+
#else
static void
iomap(int port, int cnt)
diff --git a/usr.bin/du/Makefile b/usr.bin/du/Makefile
index 0911b8fc9e6d1..3b5f1358d5a27 100644
--- a/usr.bin/du/Makefile
+++ b/usr.bin/du/Makefile
@@ -1,6 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= du
-CFLAGS+=-Wall
.include <bsd.prog.mk>
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index ee19f4588d11f..041c1a619b422 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -35,13 +35,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1989, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)du.c 8.5 (Berkeley) 5/4/95";
+static char sccsid[] = "@(#)du.c 8.5 (Berkeley) 5/4/95";
#endif /* not lint */
@@ -112,7 +112,7 @@ main(argc, argv)
errno = 0;
depth = atoi(optarg);
if (errno == ERANGE || depth < 0) {
- (void) fprintf(stderr, "Invalid argument to option d: %s\n", optarg);
+ (void) fprintf(stderr, "Invalid argument to option d: %s", optarg);
usage();
}
break;
@@ -120,6 +120,7 @@ main(argc, argv)
cflag = 1;
break;
case '?':
+ case 'h':
default:
usage();
}
@@ -262,6 +263,6 @@ static void
usage()
{
(void)fprintf(stderr,
- "usage: du [-H | -L | -P] [-a | -s | -d depth] [-c] [-k] [-x] [file ...]\n");
+ "usage: du [-H | -L | -P] [-a | -s | -d depth] [-k] [-x] [file ...]\n");
exit(1);
}
diff --git a/usr.bin/ee/Makefile b/usr.bin/ee/Makefile
index 859d53b92d7a4..08488471f6ad3 100644
--- a/usr.bin/ee/Makefile
+++ b/usr.bin/ee/Makefile
@@ -2,7 +2,6 @@ CFLAGS+= -DCAP -DHAS_NCURSES -DHAS_UNISTD -DHAS_STDARG -DHAS_STDLIB \
-DHAS_CTYPE -DHAS_SYS_IOCTL -DHAS_SYS_WAIT -DSLCT_HDR
PROG= ee
-CFLAGS+=-Wall
LINKS= ${BINDIR}/ee ${BINDIR}/ree
MLINKS= ee.1 ree.1
DPADD= ${LIBNCURSES} ${LIBMYTINFO}
diff --git a/usr.bin/ee/ee.c b/usr.bin/ee/ee.c
index bb38c7007d166..485afeab73b36 100644
--- a/usr.bin/ee/ee.c
+++ b/usr.bin/ee/ee.c
@@ -52,7 +52,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: ee.c,v 1.11 1998/10/01 21:18:18 obrien Exp $";
+ "$Id: ee.c,v 1.10 1998/04/30 12:49:11 ache Exp $";
#endif /* not lint */
char *ee_copyright_message =
@@ -64,7 +64,7 @@ char *ee_long_notice[] = {
"copyright. All rights are reserved."
};
-char *version = "@(#) ee, version 1.3 $Revision: 1.11 $";
+char *version = "@(#) ee, version 1.3 $Revision: 1.10 $";
#ifdef NCURSE
#include "new_curse.h"
@@ -1897,7 +1897,7 @@ char *cmd_str;
int number;
int i;
char *ptr;
- char *direction = NULL;
+ char *direction;
struct text *t_line;
ptr = cmd_str;
@@ -1968,7 +1968,7 @@ char *arguments[];
{
char *buff;
int count;
- struct files *temp_names = NULL;
+ struct files *temp_names;
char *name;
char *ptr;
@@ -3192,7 +3192,7 @@ struct menu_entries menu_list[];
int counter;
int length;
int input;
- int temp = 0;
+ int temp;
int list_size;
int top_offset; /* offset from top where menu items start */
int vert_pos; /* vertical position */
diff --git a/usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg b/usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg
index 10c3255c5dfb2..47c9f665b8357 100644
--- a/usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg
+++ b/usr.bin/ee/nls/fr_FR.ISO_8859-1/ee.msg
@@ -3,7 +3,7 @@ $ ee.i18n.guide for more information
$
$ For ee patchlevel 3
$
-$ $Id: ee.msg,v 1.7 1998/01/12 07:53:05 charnier Exp $
+$ $Id: ee.msg,v 1.6 1997/02/22 19:54:54 peter Exp $
$
$set 1
$quote "
@@ -173,7 +173,7 @@ $quote "
164 "sauvegarde configuration de l'éditeur"
165 "sauvegarde configuration de ee"
166 "sauvegarde dans le répertoire courant"
-167 "sauvegarde dans le répertoire d'accueil"
+167 "sauvegarde dans le répertoire d'acceuil"
168 "configuration de ee non sauvée"
169 "nom de fichier manquant pour ree"
170 "appuyez sur échap. pour annuler"
diff --git a/usr.bin/enigma/Makefile b/usr.bin/enigma/Makefile
deleted file mode 100644
index 6936b7e7feb1a..0000000000000
--- a/usr.bin/enigma/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-PROG= enigma
-CFLAGS+=-Wall
-MAN1= enigma.1
-
-LINKS= ${BINDIR}/enigma ${BINDIR}/crypt
-MLINKS= enigma.1 crypt.1
-
-.include <bsd.prog.mk>
diff --git a/usr.bin/enigma/enigma.1 b/usr.bin/enigma/enigma.1
deleted file mode 100644
index a8d05f34c1cb1..0000000000000
--- a/usr.bin/enigma/enigma.1
+++ /dev/null
@@ -1,115 +0,0 @@
-.\"
-.\" enigma (aka. crypt) man page written by Joerg Wunsch.
-.\"
-.\" Since enigma itself is distributed in the Public Domain, this file
-.\" is also.
-.\"
-.\" $Id$
-.\" "
-.Dd October 30, 1998
-.Os
-.Dt enigma 1
-.Sh NAME
-.Nm enigma
-.Nd very simple file encryption
-.Sh SYNOPSIS
-.Nm
-.Op Fl s
-.Op Fl k
-.Op Ar password
-.Nm crypt
-.Op Fl s
-.Op Fl k
-.Op Ar password
-.Sh DESCRIPTION
-.Nm Enigma ,
-also known as
-.Nm crypt
-is a
-.Em very
-simple encryption program, working on a
-.Dq secret-key
-basis. It operates as a filter, i. e. it encrypts or decrypts a
-stream of data from standard input, and writes the result to standard
-output. It automatically detects whether the input data stream is
-already encrypted, and switches into decryption mode in this case.
-.Pp
-There are several ways to provide the secret key to the program. By
-default, the program prompts the user on the controlling terminal for
-the key, using
-.Xr getpass 3 .
-This is the only safe way of providing it.
-.Pp
-Alternatively, the key can be provided as the sole command-line
-argument
-.Ar password
-when starting the program. Obviously, this way the key can easily be
-spotted by other users running
-.Xr ps 1 .
-As yet another alternative,
-.Nm
-can be given the option
-.Fl k ,
-and it will take the key from the environment variable
-.Ev CrYpTkEy .
-While this at a first glance seems to be more secure than the previous
-option, it actually isn't since environment variables can also be
-examined with
-.Xr ps 1 .
-Thus this option is mainly provided for compatibility with other
-implementations of
-.Nm enigma .
-.Pp
-When specifying the option
-.Fl s ,
-.Nm
-modifies the encryption engine in a way that is supposed to make it a
-little more secure, but incompatible with other implementations.
-.Pp
-.Ss Warning
-The cryptographic value of
-.Nm
-is rather small. This program is only provided here for compatibility
-with other operating systems that also provide an implementation. For
-real encryption, refer to
-.Xr bdes 1
-(from the DES distribution package), or
-.Xr pgp 1
-(from the ports collection). Hoewever, restrictions for exporting,
-importing or using such tools might exist in some countries, so those
-stronger programs are not being shipped as part of the operating
-system by default.
-.Sh ENVIRONMENT
-.Bl -tag -offset indent -width "XXCrYpTkEy"
-.It Ev CrYpTkEy
-used to obtain the secret key when option
-.Fl k
-has been given
-.El
-.Sh EXAMPLES
-.Bd -literal -offset indent
-man enigma | enigma > encrypted
-Enter key: (XXX \(em key not echoed)
-.Ed
-.Pp
-This will create an encrypted form of this man page, and store it in
-the file
-.Ql encrypted .
-.Bd -literal -offset indent
-enigma XXX < encrypted
-.Ed
-.Pp
-This displays the previously created file on the terminal.
-.Sh SEE ALSO
-.Xr bdes 1 ,
-.Xr pgp 1 ,
-.Xr ps 1 ,
-.Xr getpass 3
-.Sh HISTORY
-Implementations of
-.Nm crypt
-are very common among
-.Ux
-operating systems. This implementation has been taken from the
-.Em Cryptbreakers Workbench
-which is in the public domain.
diff --git a/usr.bin/enigma/enigma.c b/usr.bin/enigma/enigma.c
deleted file mode 100644
index 3b1560c3b5f91..0000000000000
--- a/usr.bin/enigma/enigma.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * "enigma.c" is in file cbw.tar from
- * anonymous FTP host watmsg.waterloo.edu: pub/crypt/cbw.tar.Z
- *
- * A one-rotor machine designed along the lines of Enigma
- * but considerably trivialized.
- *
- * A public-domain replacement for the UNIX "crypt" command.
- *
- * Upgraded to function properly on 64-bit machines.
- */
-
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define MINUSKVAR "CrYpTkEy"
-
-#define ECHO 010
-#define ROTORSZ 256
-#define MASK 0377
-char t1[ROTORSZ];
-char t2[ROTORSZ];
-char t3[ROTORSZ];
-char deck[ROTORSZ];
-char buf[13];
-
-void shuffle(char *);
-
-void
-setup(pw)
- char *pw;
-{
- int ic, i, k, temp, pf[2], pid;
- unsigned random;
- long seed;
-
- strncpy(buf, pw, 8);
- while (*pw)
- *pw++ = '\0';
- buf[8] = buf[0];
- buf[9] = buf[1];
- pipe(pf);
- if ((pid=fork())==0) {
- close(0);
- close(1);
- dup(pf[0]);
- dup(pf[1]);
- execlp("makekey", "-", 0);
- execl("/usr/libexec/makekey", "-", 0); /* BSDI */
- execl("/usr/lib/makekey", "-", 0);
- execl("/usr/bin/makekey", "-", 0); /* IBM */
- execl("/lib/makekey", "-", 0);
- perror("makekey");
- fprintf(stderr, "enigma: cannot execute 'makekey', aborting\n");
- exit(1);
- }
- write(pf[1], buf, 10);
- close(pf[1]);
- i=wait((int *)NULL);
- if (i<0) perror("enigma: wait");
- if (i!=pid) {
- fprintf(stderr, "enigma: expected pid %d, got pid %d\n", pid, i);
- exit(1);
- }
- if ((i=read(pf[0], buf, 13)) != 13) {
- fprintf(stderr, "enigma: cannot generate key, read %d\n",i);
- exit(1);
- }
- seed = 123;
- for (i=0; i<13; i++)
- seed = seed*buf[i] + i;
- for(i=0;i<ROTORSZ;i++) {
- t1[i] = i;
- deck[i] = i;
- }
- for(i=0;i<ROTORSZ;i++) {
- seed = 5*seed + buf[i%13];
- if( sizeof(long) > 4 ) {
- /* Force seed to stay in 32-bit signed math */
- if( seed & 0x80000000 )
- seed = seed | (-1L & ~0xFFFFFFFFL);
- else
- seed &= 0x7FFFFFFF;
- }
- random = seed % 65521;
- k = ROTORSZ-1 - i;
- ic = (random&MASK)%(k+1);
- random >>= 8;
- temp = t1[k];
- t1[k] = t1[ic];
- t1[ic] = temp;
- if(t3[k]!=0) continue;
- ic = (random&MASK) % k;
- while(t3[ic]!=0) ic = (ic+1) % k;
- t3[k] = ic;
- t3[ic] = k;
- }
- for(i=0;i<ROTORSZ;i++)
- t2[t1[i]&MASK] = i;
-}
-
-int
-main(argc, argv)
- char *argv[];
-{
- register int i, n1, n2, nr1, nr2;
- int secureflg = 0, kflag = 0;
- char *cp;
-
- if (argc > 1 && argv[1][0] == '-') {
- if (argv[1][1] == 's') {
- argc--;
- argv++;
- secureflg = 1;
- } else if (argv[1][1] == 'k') {
- argc--;
- argv++;
- kflag = 1;
- }
- }
- if (kflag) {
- if ((cp = getenv(MINUSKVAR)) == NULL) {
- fprintf(stderr, "%s not set\n", MINUSKVAR);
- exit(1);
- }
- setup(cp);
- } else if (argc != 2) {
- setup(getpass("Enter key:"));
- }
- else
- setup(argv[1]);
- n1 = 0;
- n2 = 0;
- nr2 = 0;
-
- while((i=getchar()) != -1) {
- if (secureflg) {
- nr1 = deck[n1]&MASK;
- nr2 = deck[nr1]&MASK;
- } else {
- nr1 = n1;
- }
- i = t2[(t3[(t1[(i+nr1)&MASK]+nr2)&MASK]-nr2)&MASK]-nr1;
- putchar(i);
- n1++;
- if(n1==ROTORSZ) {
- n1 = 0;
- n2++;
- if(n2==ROTORSZ) n2 = 0;
- if (secureflg) {
- shuffle(deck);
- } else {
- nr2 = n2;
- }
- }
- }
-
- return 0;
-}
-
-void
-shuffle(deck)
- char deck[];
-{
- int i, ic, k, temp;
- unsigned random;
- static long seed = 123;
-
- for(i=0;i<ROTORSZ;i++) {
- seed = 5*seed + buf[i%13];
- random = seed % 65521;
- k = ROTORSZ-1 - i;
- ic = (random&MASK)%(k+1);
- temp = deck[k];
- deck[k] = deck[ic];
- deck[ic] = temp;
- }
-}
diff --git a/usr.bin/env/Makefile b/usr.bin/env/Makefile
index fadfd080aa69c..6b67b73111b8a 100644
--- a/usr.bin/env/Makefile
+++ b/usr.bin/env/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= env
-CFLAGS+=-Wall
NOMAN= noman
.include <bsd.prog.mk>
diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c
index a5083fbc681e3..8894dd070b6da 100644
--- a/usr.bin/env/env.c
+++ b/usr.bin/env/env.c
@@ -32,13 +32,13 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1988, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <err.h>
diff --git a/usr.bin/error/Makefile b/usr.bin/error/Makefile
index 3bd5adf89b6b7..4ec0ba0473e53 100644
--- a/usr.bin/error/Makefile
+++ b/usr.bin/error/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= error
-CFLAGS+=-Wall
SRCS= main.c input.c pi.c subr.c filter.c touch.c
.include <bsd.prog.mk>
diff --git a/usr.bin/error/pi.c b/usr.bin/error/pi.c
index c5c1ffb9145cc..5984bcabe4c8e 100644
--- a/usr.bin/error/pi.c
+++ b/usr.bin/error/pi.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)pi.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: pi.c,v 1.3 1997/11/03 07:44:15 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <ctype.h>
@@ -208,7 +208,7 @@ extern char **wordv;
Errorclass pi()
{
- char **nwordv = NULL;
+ char **nwordv;
if (wordc < 2)
return (C_UNKNOWN);
diff --git a/usr.bin/error/touch.c b/usr.bin/error/touch.c
index 08952f7b593d5..cef09fddcaf78 100644
--- a/usr.bin/error/touch.c
+++ b/usr.bin/error/touch.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)touch.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: touch.c,v 1.5 1998/02/25 02:24:04 bde Exp $";
+ "$Id: touch.c,v 1.4 1997/11/03 07:44:25 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -512,7 +512,7 @@ execvarg(n_pissed_on, r_argc, r_argv)
char ***r_argv;
{
Eptr p;
- char *sep = NULL;
+ char *sep;
int fi;
(*r_argv) = (char **)Calloc(n_pissed_on + 3, sizeof(char *));
diff --git a/usr.bin/expand/Makefile b/usr.bin/expand/Makefile
index 8e1369c98dbda..751df256add6b 100644
--- a/usr.bin/expand/Makefile
+++ b/usr.bin/expand/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/9/93
PROG= expand
-CFLAGS+=-Wall
MLINKS= expand.1 unexpand.1
.include <bsd.prog.mk>
diff --git a/usr.bin/expand/expand.c b/usr.bin/expand/expand.c
index a8014f9a44a25..37c9464461734 100644
--- a/usr.bin/expand/expand.c
+++ b/usr.bin/expand/expand.c
@@ -32,7 +32,7 @@
*/
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1980, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)expand.c 8.1 (Berkeley) 6/9/93";
#else
static const char rcsid[] =
- "$Id: expand.c,v 1.3 1998/02/02 07:10:59 cwt Exp $";
+ "$Id: expand.c,v 1.2 1997/07/01 06:34:31 charnier Exp $";
#endif
#endif /* not lint */
diff --git a/usr.bin/f2c/f2c.h b/usr.bin/f2c/f2c.h
index 61f72aff44612..6514cd913e873 100644
--- a/usr.bin/f2c/f2c.h
+++ b/usr.bin/f2c/f2c.h
@@ -7,15 +7,15 @@
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
-typedef int integer;
-typedef unsigned int uinteger;
+typedef long int integer;
+typedef unsigned long uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
-typedef int logical;
+typedef long int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
@@ -42,9 +42,9 @@ typedef short flag;
typedef short ftnlen;
typedef short ftnint;
#else
-typedef int flag;
-typedef int ftnlen;
-typedef int ftnint;
+typedef long int flag;
+typedef long int ftnlen;
+typedef long int ftnint;
#endif
/*external read, write*/
diff --git a/usr.bin/f2c/proc.c b/usr.bin/f2c/proc.c
index e3afb81ef5fdc..2273e24951a48 100644
--- a/usr.bin/f2c/proc.c
+++ b/usr.bin/f2c/proc.c
@@ -920,8 +920,8 @@ dim_check(Namep q)
else if (!ONEOF(nelt->headblock.vtype, MSKINT|MSKREAL))
bad_dimtype(q);
else if (ISINT(nelt->headblock.vtype)
- ? nelt->constblock.Const.ci <= 0
- : nelt->constblock.Const.cd[0] <= 0.)
+ && nelt->constblock.Const.ci <= 0
+ || nelt->constblock.Const.cd[0] <= 0)
dclerr("nonpositive dimension", q);
}
diff --git a/usr.bin/fetch/fetch.1 b/usr.bin/fetch/fetch.1
index f3be659841fa9..20be53dd2f696 100644
--- a/usr.bin/fetch/fetch.1
+++ b/usr.bin/fetch/fetch.1
@@ -1,20 +1,19 @@
-.\" $Id: fetch.1,v 1.26 1998/12/08 13:00:48 cracauer Exp $
-.Dd January 15, 1999
+.\" $Id: fetch.1,v 1.23 1998/05/09 21:39:49 wollman Exp $
+.Dd July 2, 1996
.Dt FETCH 1
-.Os FreeBSD 3.1
+.Os FreeBSD 2.2
.Sh NAME
.Nm fetch
.Nd retrieve a file by Uniform Resource Locator
.Sh SYNOPSIS
.Nm fetch
-.Op Fl MPablmnpqrtv
+.Op Fl MPabmnpqr
.Op Fl S Ar size
-.Op Fl T Ar timeout
.Op Fl o Ar file
.Ar URL
.Op Ar ...
.Nm fetch
-.Op Fl MPRlmnpqrv
+.Op Fl MPRmnpqr
.Op Fl S Ar size
.Op Fl o Ar file
.Op Fl c Ar dir
@@ -103,7 +102,7 @@ under any circumstances, even if the transfer failed or was incomplete.
.It Fl r
Restart a previously interrupted transfer.
.It Fl S Ar bytes
-Require the file size reported by
+Require file size reported by
.Tn FTP
or
.Tn HTTP
@@ -115,9 +114,10 @@ This option is useful to prevent
.Nm fetch
from downloading a file that is either incomplete or the wrong version,
given the correct size of the file in advance.
-.It Fl s
-Ask server for size of file in bytes and print it to stdout. Do not
-actually fetch the file.
+.It Fl t
+Work around a different set of buggy
+.Tn TCP
+implementations.
.It Fl T Ar seconds
Set timeout value to
.Ar seconds.
@@ -126,10 +126,6 @@ Overrides the environment variables
for ftp transfers or
.Ev HTTP_TIMEOUT
for http transfers if set.
-.It Fl t
-Work around a different set of buggy
-.Tn TCP
-implementations.
.It Fl v
Increase verbosity. More
.Fl v Ns \&'s
@@ -316,16 +312,6 @@ connection.
.Sh SEE ALSO
.Xr ftp 1 ,
.Xr tftp 1
-.Rs
-.%A R. Fielding
-.%A J. Gettys
-.%A J. Mogul
-.%A H. Frystyk
-.%A T. Berners-Lee
-.%T "Hypertext Transfer Protocol \-\- HTTP/1.1"
-.%O RFC 2068
-.%D January 1997
-.Re
.Sh HISTORY
The
.Nm fetch
@@ -381,21 +367,3 @@ and
.Fl b
involves a minimum of two round trips (for small replies), one less than
other implementations.
-.Pp
-The
-.Tn HTTP
-standard requires interpretation of the
-.Tn RFC 850
-date format, which does not provide a century indication. Versions of
-.Nm fetch
-prior to
-.Fx 3.1
-would interpret all such dates as being in the 1900s. This version of
-.Nm fetch
-interprets such dates according to the rule given in
-.Tn RFC 2068 :
-.Bd -literal -offset indent
- o HTTP/1.1 clients and caches should assume that an RFC-850 date
- which appears to be more than 50 years in the future is in fact
- in the past (this helps solve the "year 2000" problem).
-.Ed
diff --git a/usr.bin/fetch/fetch.h b/usr.bin/fetch/fetch.h
index 685fdd6730426..aac3fbcb34f7e 100644
--- a/usr.bin/fetch/fetch.h
+++ b/usr.bin/fetch/fetch.h
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: fetch.h,v 1.6 1998/09/20 00:01:26 jkh Exp $
+ * $Id: fetch.h,v 1.5 1997/08/05 20:18:38 ache Exp $
*/
#ifndef fetch_h
@@ -52,7 +52,6 @@ struct fetch_state {
int fs_linux_bug; /* -b option */
int fs_use_connect; /* -t option */
off_t fs_expectedsize; /* -S option */
- int fs_reportsize; /* -s option */
time_t fs_modtime;
void *fs_proto;
int (*fs_retrieve)(struct fetch_state *);
diff --git a/usr.bin/fetch/ftp.c b/usr.bin/fetch/ftp.c
index 45c8ecfc508a0..6c6c71c10b747 100644
--- a/usr.bin/fetch/ftp.c
+++ b/usr.bin/fetch/ftp.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ftp.c,v 1.10 1998/09/20 00:01:26 jkh Exp $
+ * $Id: ftp.c,v 1.9 1997/10/08 18:43:53 fenner Exp $
*/
#include <sys/types.h>
@@ -375,20 +375,6 @@ ftp_retrieve(struct fetch_state *fs)
}
}
size = ftpGetSize(ftp, ftps->ftp_remote_file);
-
- if (fs->fs_reportsize) {
- fclose(ftp);
- if (size == -1) {
- warnx("%s: size not known\n", fs->fs_outputfile);
- printf("Unknown\n");
- return 1;
- }
- else {
- printf("%qd\n", (quad_t)size);
- return 0;
- }
- }
-
if (size > 0 && fs->fs_expectedsize != -1 && size != fs->fs_expectedsize) {
warnx("%s: size mismatch, expected=%lu / actual=%lu",
ftps->ftp_remote_path,
diff --git a/usr.bin/fetch/http.c b/usr.bin/fetch/http.c
index 2f08c1d2be0f0..ecade4ef19ea6 100644
--- a/usr.bin/fetch/http.c
+++ b/usr.bin/fetch/http.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: http.c,v 1.23 1999/01/15 16:56:22 wollman Exp $
+ * $Id: http.c,v 1.19 1998/07/12 09:07:36 se Exp $
*/
#include <sys/types.h>
@@ -440,7 +440,6 @@ http_retrieve(struct fetch_state *fs)
char *base64ofmd5;
int to_stdout, restarting, redirection, retrying, autherror, chunked;
char rangebuf[sizeof("Range: bytes=18446744073709551616-\r\n")];
- int tried_head;
setup_http_auth();
@@ -449,7 +448,6 @@ http_retrieve(struct fetch_state *fs)
restarting = fs->fs_restart;
redirection = 0;
retrying = 0;
- tried_head = 0;
/*
* Figure out the timeout. Prefer the -T command-line value,
@@ -509,14 +507,7 @@ http_retrieve(struct fetch_state *fs)
} while(0)
retry:
- if (fs->fs_reportsize && !tried_head) {
- addstr(iov, n, "HEAD ");
- tried_head = 1;
- }
- else {
- addstr(iov, n, "GET ");
- tried_head = 0;
- }
+ addstr(iov, n, "GET ");
addstr(iov, n, https->http_remote_request);
addstr(iov, n, " HTTP/1.1\r\n");
/*
@@ -747,16 +738,6 @@ got100reply:
else
autherror = 407;
break;
- case 501: /* Not Implemented */
- /* If we tried HEAD, retry with GET */
- if (tried_head) {
- n = 0;
- goto retry;
- }
- else {
- errstr = safe_strdup(line);
- break;
- }
case 503: /* Service Unavailable */
if (!fs->fs_auto_retry)
errstr = safe_strdup(line);
@@ -964,23 +945,6 @@ spewerror:
fs->fs_status = "retrieving file from HTTP/1.x server";
- if (fs->fs_reportsize) {
- if (total_length == -1) {
- warnx("%s: size not known\n",
- fs->fs_outputfile);
- printf("Unknown\n");
- status = 1;
- }
- else {
- printf("%qd\n", (quad_t)total_length);
- status = 0;
- }
- fclose(remote);
- unsetup_sigalrm();
- return status;
- }
-
-
/*
* OK, if we got here, then we have finished parsing the header
* and have read the `\r\n' line which denotes the end of same.
@@ -1072,29 +1036,18 @@ http_suck(struct fetch_state *fs, FILE *remote, FILE *local,
{
static char buf[BUFFER_SIZE];
ssize_t readresult, writeresult;
- off_t remain = total_length;
-
- if (total_length == -1)
- remain = 1; /*XXX*/
do {
alarm(timo);
readresult = fread(buf, 1, sizeof buf, remote);
alarm(0);
- /*
- * If know the content-length, ignore anything more the
- * the server chooses to send us.
- */
- if (total_length != -1 && ((remain -= readresult) < 0))
- readresult += remain;
-
if (readresult == 0)
return 0;
display(fs, total_length, readresult);
writeresult = fwrite(buf, 1, readresult, local);
- } while (writeresult == readresult && remain > 0);
+ } while (writeresult == readresult);
return 0;
}
@@ -1394,14 +1347,6 @@ parse_http_date(char *string)
tm.tm_year = i - 1900;
} else {
/* Monday, 27-Jan-97 14:31:09 stuffwedon'tcareabout */
- /* Quoth RFC 2068:
- o HTTP/1.1 clients and caches should assume that an RFC-850 date
- which appears to be more than 50 years in the future is in fact
- in the past (this helps solve the "year 2000" problem).
- */
- time_t now;
- struct tm *tmnow;
- int this2dyear;
char *comma = strchr(string, ',');
char mname[4];
@@ -1423,15 +1368,6 @@ parse_http_date(char *string)
if (i >= 12)
return -1;
tm.tm_mon = i;
- /*
- * RFC 2068 year interpretation.
- */
- time(&now);
- tmnow = gmtime(&now);
- this2dyear = tmnow->tm_year % 100;
- tm.tm_year += tmnow->tm_year - this2dyear;
- if (tm.tm_year - tmnow->tm_year >= 50)
- tm.tm_year -= 100;
}
#undef digit
diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c
index 8b24dad4f5c1a..6669ad03be379 100644
--- a/usr.bin/fetch/main.c
+++ b/usr.bin/fetch/main.c
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/* $Id: main.c,v 1.48 1998/11/08 23:18:48 des Exp $ */
+/* $Id: main.c,v 1.46 1998/05/09 08:56:07 des Exp $ */
#include <sys/types.h>
@@ -52,7 +52,7 @@ static void
usage()
{
fprintf(stderr, "%s\n%s\n",
- "usage: fetch [-DHILMNPRTVablmnpqrstv] [-o outputfile] [-S bytes]",
+ "usage: fetch [-DHILMNPRTValmnpqrv] [-o outputfile] [-S bytes]",
" [-f file -h host [-c dir] | URL]");
exit(EX_USAGE);
}
@@ -71,13 +71,12 @@ main(int argc, char *const *argv)
init_schemes();
fs = clean_fetch_state;
fs.fs_verbose = 1;
- fs.fs_reportsize = 0;
fs.fs_expectedsize = -1;
change_to_dir = file_to_get = hostname = 0;
- while ((c = getopt(argc, argv, "abc:D:f:h:HIlLmMnNo:pPqRrS:stT:vV:")) != -1) {
+ while ((c = getopt(argc, argv, "abc:D:f:h:HilLmMnNo:pPqRrS:tT:vV:")) != -1) {
switch (c) {
- case 'D': case 'H': case 'I': case 'L': case 'N': case 'V':
+ case 'D': case 'H': case 'I': case 'N': case 'L': case 'V':
break; /* ncftp compatibility */
case 'a':
@@ -136,10 +135,6 @@ main(int argc, char *const *argv)
fs.fs_use_connect = 1;
break;
- case 's':
- fs.fs_reportsize = 1;
- break;
-
case 'S':
/* strtol sets errno to ERANGE in the case of overflow */
errno = 0;
diff --git a/usr.bin/file/Magdir/applix b/usr.bin/file/Magdir/applix
deleted file mode 100644
index 9d348d1524509..0000000000000
--- a/usr.bin/file/Magdir/applix
+++ /dev/null
@@ -1,12 +0,0 @@
-
-#------------------------------------------------------------------------------
-# applix: file(1) magic for Applixware
-# From: Peter Soos <sp@osb.hu>
-#
-0 string *BEGIN Applixware
->7 string WORDS Words Document
->7 string GRAPHICS Graphic
->7 string RASTER Bitmap
->7 string SPREADSHEETS Spreadsheet
->7 string MACRO Macro
->7 string BUILDER Builder Object
diff --git a/usr.bin/file/Magdir/cisco b/usr.bin/file/Magdir/cisco
deleted file mode 100644
index 77e3efb5e39d7..0000000000000
--- a/usr.bin/file/Magdir/cisco
+++ /dev/null
@@ -1,10 +0,0 @@
-#------------------------------------------------------------------------------
-# cisco: file(1) magic for cisco Systems routers
-#
-# Most cisco file-formats are covered by the generic elf code
-#
-# Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha.
-0 belong&0xffffff00 0x85011400 cisco IOS microcode
->7 string >\0 for '%s'
-0 belong&0xffffff00 0x8501cb00 cisco IOS experimental microcode
->7 string >\0 for '%s'
diff --git a/usr.bin/file/Magdir/flash b/usr.bin/file/Magdir/flash
deleted file mode 100644
index 1d6f7b766cd14..0000000000000
--- a/usr.bin/file/Magdir/flash
+++ /dev/null
@@ -1,10 +0,0 @@
-
-#------------------------------------------------------------------------------
-# flash: file(1) magic for Macromedia Flash file format
-#
-# See
-#
-# http://www.macromedia.com/software/flash/open/
-#
-0 string FWS Macromedia Flash data,
->3 byte x version %d
diff --git a/usr.bin/file/Magdir/gimp b/usr.bin/file/Magdir/gimp
deleted file mode 100644
index 286fa9c3448b9..0000000000000
--- a/usr.bin/file/Magdir/gimp
+++ /dev/null
@@ -1,32 +0,0 @@
-#------------------------------------------------------------------------------
-# GIMP Gradient: file(1) magic for the GIMP's gradient data files
-# by Federico Mena <federico@nuclecu.unam.mx>
-
-0 string GIMP\ Gradient GIMP gradient data
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the XCF image format used in the GIMP developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-0 string gimp\ xcf\ file GIMP XCF image data,
->14 belong x %ld x
->18 belong x %ld,
->22 belong 0 RGB Color
->22 belong 1 Greyscale
->22 belong 2 Indexed Color
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the patterns used in the GIMP, developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-20 string GPAT GIMP pattern data,
->24 string x %s
-
-#------------------------------------------------------------------------------
-# XCF: file(1) magic for the brushes used in the GIMP, developed
-# by Spencer Kimball and Peter Mattis
-# ('Bucky' LaDieu, nega@vt.edu)
-
-20 string GIMP GIMP brush data
diff --git a/usr.bin/file/Magdir/gnu b/usr.bin/file/Magdir/gnu
deleted file mode 100644
index 85af567020daf..0000000000000
--- a/usr.bin/file/Magdir/gnu
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# GNU nlsutils message catalog file format
-#
-0 string \336\22\4\225 GNU message catalog (little endian),
->4 lelong x revision %d,
->8 lelong x %d messages
-0 string \225\4\22\336 GNU message catalog (big endian),
->4 belong x revision %d,
->8 belong x %d messages
diff --git a/usr.bin/file/Magdir/lecter b/usr.bin/file/Magdir/lecter
deleted file mode 100644
index 87c186bab3632..0000000000000
--- a/usr.bin/file/Magdir/lecter
+++ /dev/null
@@ -1,4 +0,0 @@
-#------------------------------------------------------------------------------
-# DEC SRC Virtual Paper: Lectern files
-# Karl M. Hegbloom <karlheg@inetarena.com>
-0 string lect DEC SRC Virtual Paper Lectern file
diff --git a/usr.bin/file/Magdir/macintosh b/usr.bin/file/Magdir/macintosh
deleted file mode 100644
index 81f8117bca115..0000000000000
--- a/usr.bin/file/Magdir/macintosh
+++ /dev/null
@@ -1,79 +0,0 @@
-
-#------------------------------------------------------------------------------
-# macintosh description
-#
-# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
-# Daniel Quinlan, quinlan@yggdrasil.com
-11 string must\ be\ converted\ with\ BinHex BinHex binary text
->41 string x \b, version %.3s
-
-# Stuffit archives are the de facto standard of compression for Macintosh
-# files obtained from most archives. (franklsm@tuns.ca)
-0 string SIT! StuffIt Archive (data)
->2 string x : %s
-65 string SIT! StuffIt Archive (rsrc + data)
->2 string x : %s
-0 string SITD StuffIt Deluxe (data)
->2 string x : %s
-65 string SITD StuffIt Deluxe (rsrc + data)
->2 string x : %s
-0 string Seg StuffIt Deluxe Segment (data)
->2 string x : %s
-65 string Seg StuffIt Deluxe Segment (rsrc + data)
->2 string x : %s
-
-# Macintosh Applications and Installation binaries (franklsm@tuns.ca)
-0 string APPL Macintosh Application (data)
->2 string x : %s
-65 string APPL Macintosh Application (rsrc + data)
->2 string x : %s
-
-# Macintosh System files (franklsm@tuns.ca)
-0 string zsys Macintosh System File (data)
-65 string zsys Macintosh System File(rsrc + data)
-0 string FNDR Macintosh Finder (data)
-65 string FNDR Macintosh Finder(rsrc + data)
-0 string libr Macintosh Library (data)
->2 string x : %s
-65 string libr Macintosh Library(rsrc + data)
->2 string x : %s
-0 string shlb Macintosh Shared Library (data)
->2 string x : %s
-65 string shlb Macintosh Shared Library(rsrc + data)
->2 string x : %s
-0 string cdev Macintosh Control Panel (data)
->2 string x : %s
-65 string cdev Macintosh Control Panel(rsrc + data)
->2 string x : %s
-0 string INIT Macintosh Extension (data)
->2 string x : %s
-65 string INIT Macintosh Extension(rsrc + data)
->2 string x : %s
-0 string FFIL Macintosh Truetype Font (data)
->2 string x : %s
-65 string FFIL Macintosh Truetype Font(rsrc + data)
->2 string x : %s
-0 string LWFN Macintosh Postscript Font (data)
->2 string x : %s
-65 string LWFN Macintosh Postscript Font(rsrc + data)
->2 string x : %s
-
-# Additional Macintosh Files (franklsm@tuns.ca)
-
-0 string PACT Macintosh Compact Pro Archive (data)
->2 string x : %s
-65 string PACT Macintosh Compact Pro Archive(rsrc + data)
->2 string x : %s
-0 string ttro Macintosh TeachText File (data)
->2 string x : %s
-65 string ttro Macintosh TeachText File(rsrc + data)
->2 string x : %s
-0 string TEXT Macintosh TeachText File (data)
->2 string x : %s
-65 string TEXT Macintosh TeachText File(rsrc + data)
->2 string x : %s
-0 string PDF Macintosh PDF File (data)
->2 string x : %s
-65 string PDF Macintosh PDF File(rsrc + data)
->2 string x : %s
-
diff --git a/usr.bin/file/Magdir/mime b/usr.bin/file/Magdir/mime
deleted file mode 100644
index 0102709191a5d..0000000000000
--- a/usr.bin/file/Magdir/mime
+++ /dev/null
@@ -1,7 +0,0 @@
-#------------------------------------------------------------------------------
-# mime: file(1) magic for MIME encoded files
-#
-0 string Content-Type:\
->14 string >\0 %s
-0 string Content-Type:
->13 string >\0 %s
diff --git a/usr.bin/file/Magdir/modem b/usr.bin/file/Magdir/modem
deleted file mode 100644
index 73e747e161dcf..0000000000000
--- a/usr.bin/file/Magdir/modem
+++ /dev/null
@@ -1,33 +0,0 @@
-#------------------------------------------------------------------------------
-# modem: file(1) magic for modem programs
-#
-# From: Florian La Roche <florian@knorke.saar.de>
-4 string Research, Digifax-G3-File
->29 byte 1 , fine resolution
->29 byte 0 , normal resolution
-
-0 short 0x0100 raw G3 data, byte-padded
-0 short 0x1400 raw G3 data
-#
-# Magic data for vgetty voice formats
-# (Martin Seine & Marc Eberhard)
-
-#
-# raw modem data version 1
-#
-0 string RMD1 raw modem data
->4 string >\0 (%s /
->20 short >0 compression type 0x%04x)
-
-#
-# portable voice format 1
-#
-0 string PVF1\n portable voice format
->5 string >\0 (binary %s)
-
-#
-# portable voice format 2
-#
-0 string PVF2\n portable voice format
->5 string >\0 (ascii %s)
-
diff --git a/usr.bin/file/Magdir/ms-dos b/usr.bin/file/Magdir/ms-dos
index 54204acc0d500..db2c03edfe09e 100644
--- a/usr.bin/file/Magdir/ms-dos
+++ b/usr.bin/file/Magdir/ms-dos
@@ -6,124 +6,10 @@
# .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
0 string @echo\ off MS-DOS batch file text
-# WinNT/WinCE PE files (Warner Losh, imp@village.org)
-#
-128 string PE\000\000 MS Windows PE
->132 leshort 0x0000 Unknown CPU
->132 leshort 0x14c Intel 386
->132 leshort 0x14d Intel 486
->132 leshort 0x14e Intel 586
->132 leshort 0x162 MIPS ISA I
->132 leshort 0x163 MIPS ISA II
->132 leshort 0x166 MIPS ISA III
->132 leshort 0x184 Digital Alpha
->132 leshort 0x1a2 Hitachi SH3
->132 leshort 0x1a6 Hitachi SH4
->132 leshort 0x1c0 ARM
->132 leshort 0x1f0 Power PC
->132 leshort 0x268 Motorola 68000 series
->132 leshort 0x290 PA-RISC
->148 leshort >27
->>220 leshort 0 unknown subsystem
->>220 leshort 1 native
->>220 leshort 2 GUI
->>220 leshort 3 console
->>220 leshort 7 POSIX
->150 leshort&0x2000 =0 executable
-#>>136 ledate x stamp %s,
->>150 leshort&0x0001 >0 not relocatable
-#>>150 leshort&0x0004 =0 with line numbers,
-#>>150 leshort&0x0008 =0 with local symbols,
-#>>150 leshort&0x0200 =0 with debug symbols,
->>150 leshort&0x1000 >0 system file
-#>>148 leshort >0
-#>>>154 byte x linker %d
-#>>>155 byte x \b.%d,
-#>>148 leshort >27
-#>>>192 leshort x requires OS %d
-#>>>194 leshort x \b.%d,
-#>>>196 leshort x user version %d
-#>>>198 leshort x \b.%d,
-#>>>200 leshort x subsystem version %d
-#>>>202 leshort x \b.%d,
->150 leshort&0x2000 >0 DLL
-#>>136 ledate x stamp %s,
->>150 leshort&0x0001 >0 not relocatable
-#>>150 leshort&0x0004 =0 with line numbers,
-#>>150 leshort&0x0008 =0 with local symbols,
-#>>150 leshort&0x0200 =0 with debug symbols,
->>150 leshort&0x1000 >0 system file
-#>>148 leshort >0
-#>>>154 byte x linker %d
-#>>>155 byte x \b.%d,
-#>>148 leshort >27
-#>>>192 leshort x requires OS %d
-#>>>194 leshort x \b.%d,
-#>>>196 leshort x user version %d
-#>>>198 leshort x \b.%d,
-#>>>200 leshort x subsystem version %d
-#>>>202 leshort x \b.%d,
-0 string PE\000\000 MS Windows PE (no DOS header)
->4 leshort 0x0000 Unknown CPU
->4 leshort 0x14c Intel 386
->4 leshort 0x14d Intel 486
->4 leshort 0x14e Intel 586
->4 leshort 0x162 MIPS ISA I
->4 leshort 0x163 MIPS ISA II
->4 leshort 0x166 MIPS ISA III
->4 leshort 0x184 Digital Alpha
->4 leshort 0x1a2 Hitachi SH3
->4 leshort 0x1a6 Hitachi SH4
->4 leshort 0x1c0 ARM
->4 leshort 0x1f0 Power PC
->4 leshort 0x268 Motorola 68000 series
->4 leshort 0x290 PA-RISC
-# It would appear that the debugger information is in basically the same
-# format as what binutils calls PEI files.
-0 string DI\000\000 Microsoft PE Debugger Information
->4 leshort 0x0000 Unknown CPU
->4 leshort 0x14c Intel 386
->4 leshort 0x14d Intel 486
->4 leshort 0x14e Intel 586
->4 leshort 0x162 MIPS ISA I
->4 leshort 0x163 MIPS ISA II
->4 leshort 0x166 MIPS ISA III
->4 leshort 0x184 Digital Alpha
->4 leshort 0x1a2 Hitachi SH3
->4 leshort 0x1a6 Hitachi SH4
->4 leshort 0x1c0 ARM
->4 leshort 0x1f0 Power PC
->4 leshort 0x268 Motorola 68000 series
->4 leshort 0x290 PA-RISC
-
-0 leshort 0x0000 MS Windows COFF Unknown CPU
-0 leshort 0x14c MS Windows COFF Intel 386
-0 leshort 0x14d MS Windows COFF Intel 486
-0 leshort 0x14e MS Windows COFF Intel 586
-0 leshort 0x162 MS Windows COFF MIPS ISA I
-0 leshort 0x163 MS Windows COFF MIPS ISA II
-0 leshort 0x166 MS Windows COFF MIPS ISA III
-0 leshort 0x184 MS Windows COFF Digital Alpha
-0 leshort 0x1a2 MS Windows COFF Hitachi SH3
-0 leshort 0x1a6 MS Windows COFF Hitachi SH4
-0 leshort 0x1c0 MS Windows COFF ARM
-0 leshort 0x1f0 MS Windows COFF Power PC
-0 leshort 0x268 MS Windows COFF Motorola 68000 series
-0 leshort 0x290 MS Windows COFF PA-RISC
-
# .EXE formats (Greg Roelofs, newt@uchicago.edu)
#
0 string MZ MS-DOS executable (EXE)
->24 string @ \b, OS/2 or MS Windows
->>0xe7 string LH/2\ Self-Extract \b, %s
->>0xe9 string PKSFX2 \b, %s
->0x1c string RJSX\xff\xff \b, ARJ SFX
->0x1c string diet\xf9\x9c \b, diet compressed
->0x1e string Copyright\ 1989-1990\ PKWARE\ Inc. \b, PKSFX
-# JM: 0x1e "PKLITE Copr. 1990-92 PKWARE Inc. All Rights Reserved\7\0\0\0"
->0x1e string PKLITE\ Copr. \b, %.6s compressed
->0x24 string LHa's\ SFX \b, %.15s
->0x24 string LHA's\ SFX \b, %.15s
+>24 string @ \b, OS/2 or Windows
>1638 string -lh5- \b, LHa SFX archive v2.13S
>7195 string Rar! \b, RAR self-extracting archive
#
@@ -159,7 +45,6 @@
# but it isn't feasible to match all COM files since there must be at least
# two dozen different one-byte "magics".
#0 byte 0xe9 MS-DOS executable (COM)
-#>6 string SFX\ of\ LHarc (%s)
#0 byte 0x8c MS-DOS executable (COM)
# 0xeb conflicts with "sequent" magic
#0 byte 0xeb MS-DOS executable (COM)
@@ -170,39 +55,19 @@
#0 byte 0xf0 MS-DOS program library data
#
-#
-# Windows NT Registry files.
-#
-0 string regf Windows NT Registry file
-
# Popular applications
2080 string Microsoft\ Word\ 6.0\ Document %s
-2080 string Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
-# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
-2112 string MSWordDoc Microsoft Word document data
#
0 belong 0x31be0000 Microsoft Word Document
#
-0 string PO^Q` Microsoft Word 6.0 Document
-#
2080 string Microsoft\ Excel\ 5.0\ Worksheet %s
#
-# Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
-2114 string Biff5 Microsoft Excel 5.0 Worksheet
-#
0 belong 0x00001a00 Lotus 1-2-3
->4 belong 0x00100400 wk3 document data
->4 belong 0x02100400 wk4 document data
->4 belong 0x07800100 fm3 or fmb document data
->4 belong 0x07800000 fm3 or fmb document data
+>4 belong 0x00100400 wk3 document
+>4 belong 0x02100400 wk4 document
+>4 belong 0x07800100 fm3 or fmb document
+>4 belong 0x07800000 fm3 or fmb document
#
0 belong 0x00000200 Lotus 1-2-3
->4 belong 0x06040600 wk1 document data
->4 belong 0x06800200 fmt document data
-
-# WordPerfect documents - Trevor Johnson <trevor@jpj.net>
-#
-1 string WPC WordPerfect document
-
-# Help files
-0 string ?_\3\0 MS Windows Help Data
+>4 belong 0x06040600 wk1 document
+>4 belong 0x06800200 fmt document
diff --git a/usr.bin/file/Magdir/octave b/usr.bin/file/Magdir/octave
deleted file mode 100644
index 309314820e45b..0000000000000
--- a/usr.bin/file/Magdir/octave
+++ /dev/null
@@ -1,4 +0,0 @@
-#------------------------------------------------------------------------------
-# octave binary data file(1) magic, from Dirk Eddelbuettel <edd@debian.org>
-0 string Octave-1-L Octave binary data (little endian)
-0 string Octave-1-B Octave binary data (big endian)
diff --git a/usr.bin/file/Magdir/olf b/usr.bin/file/Magdir/olf
deleted file mode 100644
index e698c36a49eea..0000000000000
--- a/usr.bin/file/Magdir/olf
+++ /dev/null
@@ -1,97 +0,0 @@
-
-#------------------------------------------------------------------------------
-# olf: file(1) magic for OLF executables
-#
-# We have to check the byte order flag to see what byte order all the
-# other stuff in the header is in.
-#
-# MIPS R3000 may also be for MIPS R2000.
-# What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
-#
-# Created by Erik Theisen <etheisen@openbsd.org>
-# Based on elf from Daniel Quinlan <quinlan@yggdrasil.com>
-0 string \177OLF OLF
->4 byte 0 invalid class
->4 byte 1 32-bit
->4 byte 2 64-bit
->7 byte 0 invalid os
->7 byte 1 OpenBSD
->7 byte 2 NetBSD
->7 byte 3 FreeBSD
->7 byte 4 4.4BSD
->7 byte 5 Linux
->7 byte 6 SVR4
->7 byte 7 esix
->7 byte 8 Solaris
->7 byte 9 Irix
->7 byte 10 SCO
->7 byte 11 Dell
->7 byte 12 NCR
->5 byte 0 invalid byte order
->5 byte 1 LSB
->>16 leshort 0 no file type,
->>16 leshort 1 relocatable,
->>16 leshort 2 executable,
->>16 leshort 3 shared object,
-# Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
-# corrections by Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
->>16 leshort 4 core file
->>>(0x38+0xcc) string >\0 of '%s'
->>>(0x38+0x10) lelong >0 (signal %d),
->>16 leshort &0xff00 processor-specific,
->>18 leshort 0 no machine,
->>18 leshort 1 AT&T WE32100 - invalid byte order,
->>18 leshort 2 SPARC - invalid byte order,
->>18 leshort 3 Intel 80386,
->>18 leshort 4 Motorola 68000 - invalid byte order,
->>18 leshort 5 Motorola 88000 - invalid byte order,
->>18 leshort 6 Intel 80486,
->>18 leshort 7 Intel 80860,
->>18 leshort 8 MIPS R3000_BE - invalid byte order,
->>18 leshort 9 Amdahl - invalid byte order,
->>18 leshort 10 MIPS R3000_LE,
->>18 leshort 11 RS6000 - invalid byte order,
->>18 leshort 15 PA-RISC - invalid byte order,
->>18 leshort 16 nCUBE,
->>18 leshort 17 VPP500,
->>18 leshort 18 SPARC32PLUS,
->>18 leshort 20 PowerPC,
->>18 leshort 0x9026 Alpha,
->>20 lelong 0 invalid version
->>20 lelong 1 version 1
->>36 lelong 1 MathCoPro/FPU/MAU Required
->8 string >\0 (%s)
->5 byte 2 MSB
->>16 beshort 0 no file type,
->>16 beshort 1 relocatable,
->>16 beshort 2 executable,
->>16 beshort 3 shared object,
->>16 beshort 4 core file,
->>>(0x38+0xcc) string >\0 of '%s'
->>>(0x38+0x10) belong >0 (signal %d),
->>16 beshort &0xff00 processor-specific,
->>18 beshort 0 no machine,
->>18 beshort 1 AT&T WE32100,
->>18 beshort 2 SPARC,
->>18 beshort 3 Intel 80386 - invalid byte order,
->>18 beshort 4 Motorola 68000,
->>18 beshort 5 Motorola 88000,
->>18 beshort 6 Intel 80486 - invalid byte order,
->>18 beshort 7 Intel 80860,
->>18 beshort 8 MIPS R3000_BE,
->>18 beshort 9 Amdahl,
->>18 beshort 10 MIPS R3000_LE - invalid byte order,
->>18 beshort 11 RS6000,
->>18 beshort 15 PA-RISC,
->>18 beshort 16 nCUBE,
->>18 beshort 17 VPP500,
->>18 beshort 18 SPARC32PLUS,
->>18 beshort 20 PowerPC or cisco 4500,
->>18 beshort 21 cisco 7500,
->>18 beshort 24 cisco SVIP,
->>18 beshort 25 cisco 7200,
->>18 beshort 36 cisco 12000,
->>18 beshort 0x9026 Alpha,
->>20 belong 0 invalid version
->>20 belong 1 version 1
->>36 belong 1 MathCoPro/FPU/MAU Required
diff --git a/usr.bin/file/Magdir/os2 b/usr.bin/file/Magdir/os2
deleted file mode 100644
index 91ea9e23df71b..0000000000000
--- a/usr.bin/file/Magdir/os2
+++ /dev/null
@@ -1,23 +0,0 @@
-
-#------------------------------------------------------------------------------
-# os2: file(1) magic for OS/2 files
-#
-
-# Provided 1998/08/22 by
-# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
-1 string InternetShortcut MS Windows 95 Internet shortcut text
->24 string >\ (URL=<%s>)
-
-# OS/2 URL objects
-# Provided 1998/08/22 by
-# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
-0 string http: OS/2 URL object text
->5 string >\ (WWW) <http:%s>
-0 string mailto: OS/2 URL object text
->7 string >\ (email) <%s>
-0 string news: OS/2 URL object text
->5 string >\ (Usenet) <%s>
-0 string ftp: OS/2 URL object text
->4 string >\ (FTP) <ftp:%s>
-0 string file: OS/2 URL object text
->5 string >\ (Local file) <%s>
diff --git a/usr.bin/file/Magdir/os9 b/usr.bin/file/Magdir/os9
deleted file mode 100644
index f493fe26fed06..0000000000000
--- a/usr.bin/file/Magdir/os9
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-#
-# Copyright (c) 1996 Ignatios Souvatzis. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Ignatios Souvatzis for
-# the NetBSD project.
-# 4. The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-#
-#
-# OS9/6809 module descriptions:
-#
-0 beshort 0x87CD OS9/6809 module:
-#
->6 byte&0x0f 0x00 non-executable
->6 byte&0x0f 0x01 machine language
->6 byte&0x0f 0x02 BASIC I-code
->6 byte&0x0f 0x03 P-code
->6 byte&0x0f 0x04 C I-code
->6 byte&0x0f 0x05 COBOL I-code
->6 byte&0x0f 0x06 FORTRAN I-code
-#
->6 byte&0xf0 0x10 program executable
->6 byte&0xf0 0x20 subroutine
->6 byte&0xf0 0x30 multi-module
->6 byte&0xf0 0x40 data module
-#
->6 byte&0xf0 0xC0 system module
->6 byte&0xf0 0xD0 file manager
->6 byte&0xf0 0xE0 device driver
->6 byte&0xf0 0xF0 device descriptor
-#
-# OS9/m68k stuff (to be continued)
-#
-0 beshort 0x4AFC OS9/68K module:
-#
-# attr
->14 byte&0x80 0x80 re-entrant
->14 byte&0x40 0x40 ghost
->14 byte&0x20 0x20 system-state
-#
-# lang:
-#
->13 byte 1 machine language
->13 byte 2 BASIC I-code
->13 byte 3 P-code
->13 byte 4 C I-code
->13 byte 5 COBOL I-code
->13 byte 6 Fortran I-code
-#
-#
-# type:
-#
->12 byte 1 program executable
->12 byte 2 subroutine
->12 byte 3 multi-module
->12 byte 4 data module
->12 byte 11 trap library
->12 byte 12 system module
->12 byte 13 file manager
->12 byte 14 device driver
->12 byte 15 device descriptor
diff --git a/usr.bin/file/Magdir/riff b/usr.bin/file/Magdir/riff
deleted file mode 100644
index 6bf127d41f0b4..0000000000000
--- a/usr.bin/file/Magdir/riff
+++ /dev/null
@@ -1,93 +0,0 @@
-
-#------------------------------------------------------------------------------
-# riff: file(1) magic for RIFF format
-# See
-#
-# http://www.seanet.com/users/matts/riffmci/riffmci.htm
-#
-# and
-#
-# http://www.ora.com/centers/gff/formats/micriff/index.htm
-#
-# and
-#
-# http://www.jtauber.com/music/encoding/niff/spec/
-#
-0 string RIFF RIFF (little-endian) data
-# RIFF Palette format
->8 string PAL \b, palette
->>16 leshort x \b, version %d
->>18 leshort x \b, %d entries
-# RIFF Device Independent Bitmap format
->8 string RDIB \b, device-independent bitmap
->>16 string BM
->>>30 leshort 12 \b, OS/2 1.x format
->>>>34 leshort x \b, %d x
->>>>36 leshort x %d
->>>30 leshort 64 \b, OS/2 2.x format
->>>>34 leshort x \b, %d x
->>>>36 leshort x %d
->>>30 leshort 40 \b, Windows 3.x format
->>>>34 lelong x \b, %d x
->>>>38 lelong x %d x
->>>>44 leshort x %d
-# RIFF MIDI format
->8 string RMID \b, MIDI
-# RIFF Multimedia Movie File format
->8 string RMMP \b, multimedia movie
-# Microsoft WAVE format (*.wav)
->8 string WAVE \b, WAVE audio
->>20 leshort 1 \b, Microsoft PCM
->>>34 leshort >0 \b, %d bit
->>22 leshort =1 \b, mono
->>22 leshort =2 \b, stereo
->>22 leshort >2 \b, %d channels
->>24 lelong >0 %d Hz
-# AVI == Audio Video Interleave
->8 string AVI\ \b, AVI
-# Animated Cursor format
->8 string ACON \b, animated cursor
-
-#
-# XXX - some of the below may only appear in little-endian form.
-#
-# Also "MV93" appears to be for one form of Macromedia Director
-# files, and "GDMF" appears to be another multimedia format.
-#
-0 string RIFX RIFF (big-endian) data
-# RIFF Palette format
->8 string PAL \b, palette
->>16 beshort x \b, version %d
->>18 beshort x \b, %d entries
-# RIFF Device Independent Bitmap format
->8 string RDIB \b, device-independent bitmap
->>16 string BM
->>>30 beshort 12 \b, OS/2 1.x format
->>>>34 beshort x \b, %d x
->>>>36 beshort x %d
->>>30 beshort 64 \b, OS/2 2.x format
->>>>34 beshort x \b, %d x
->>>>36 beshort x %d
->>>30 beshort 40 \b, Windows 3.x format
->>>>34 belong x \b, %d x
->>>>38 belong x %d x
->>>>44 beshort x %d
-# RIFF MIDI format
->8 string RMID \b, MIDI
-# RIFF Multimedia Movie File format
->8 string RMMP \b, multimedia movie
-# Microsoft WAVE format (*.wav)
->8 string WAVE \b, WAVE audio
->>20 leshort 1 \b, Microsoft PCM
->>>34 leshort >0 \b, %d bit
->>22 beshort =1 \b, mono
->>22 beshort =2 \b, stereo
->>22 beshort >2 \b, %d channels
->>24 belong >0 %d Hz
-# AVI == Audio Video Interleave
->8 string AVI\ \b, AVI
-# Animated Cursor format
->8 string ACON \b, animated cursor
-# Notation Interchange File Format (big-endian only)
->8 string NIFF \b, Notation Interchange File Format
-
diff --git a/usr.bin/file/Magdir/teapot b/usr.bin/file/Magdir/teapot
deleted file mode 100644
index d9554bfb738e8..0000000000000
--- a/usr.bin/file/Magdir/teapot
+++ /dev/null
@@ -1,4 +0,0 @@
-#------------------------------------------------------------------------------
-# teapot: file(1) magic for "teapot" spreadsheet
-#
-0 string #!teapot\012xdr teapot work sheet (XDR format)
diff --git a/usr.bin/file/Magdir/ti-8x b/usr.bin/file/Magdir/ti-8x
deleted file mode 100644
index d740060a5b442..0000000000000
--- a/usr.bin/file/Magdir/ti-8x
+++ /dev/null
@@ -1,36 +0,0 @@
-# ------------------------------------------------------------------------
-# ti-8x: file(1) magic for the TI-8x and TI-92 Graphing Calculators.
-#
-# From: Ryan McGuire (rmcguire@freenet.columbus.oh.us).
-#
-# NOTE: This list is not complete.
-#
-# Magic Numbers for the TI-82
-#
-0 string **TI82** TI-82 Graphing Calculator
->0x000037 byte 0x0B TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-83
-#
-0 string **TI83** TI-83 Graphing Calculator
->0x000037 byte 0x0B TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-85
-#
-0 string **TI85** TI-85 Graphing Calculator
->11 string Backup Backup File.
->0x000032 string ZS4 - ZShell Version 4 File.
->0x000032 string ZS3 - ZShell Version 3 File.
->0x00000B string GDatabase Graphics Database.
->0x00003B byte 0x12 TI-BASIC Group/Program File.
-#
-# Magic Numbers for the TI-92
-#
-0 string **TI92** TI-92 Graphing Calculator
->0x000058 byte 0x12 TI-BASIC Group File.
->0x000012 string Function Function.
->0x000048 byte 0x12 TI-BASIC Program.
-# Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the
-# program/group magic numbers in here because I cannot find any.
-0 string **TI80** TI-80 Graphing Calculator File.
-0 string **TI81** TI-81 Graphing Calculator File.
diff --git a/usr.bin/file/Magdir/vicar b/usr.bin/file/Magdir/vicar
deleted file mode 100644
index ab216eeea8161..0000000000000
--- a/usr.bin/file/Magdir/vicar
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#------------------------------------------------------------------------------
-# vicar: file(1) magic for VICAR files.
-#
-# From: Ossama Othman <othman@astrosun.tn.cornell.edu
-# VICAR is JPL's in-house spacecraft image processing program
-# VICAR image
-0 string LBLSIZE= VICAR image data
->32 string BYTE \b, 8 bits = VAX byte
->32 string HALF \b, 16 bits = VAX word = Fortran INTEGER*2
->32 string FULL \b, 32 bits = VAX longword = Fortran INTEGER*4
->32 string REAL \b, 32 bits = VAX longword = Fortran REAL*4
->32 string DOUB \b, 64 bits = VAX quadword = Fortran REAL*8
->32 string COMPLEX \b, 64 bits = VAX quadword = Fortran COMPLEX*8
-# VICAR label file
-43 string SFDU_LABEL VICAR label file
diff --git a/usr.bin/file/Magdir/wordperfect b/usr.bin/file/Magdir/wordperfect
deleted file mode 100644
index c77ac8d1b8881..0000000000000
--- a/usr.bin/file/Magdir/wordperfect
+++ /dev/null
@@ -1,91 +0,0 @@
-#WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
-0 string \377WPC\020\000\000\000\022\012\001\001\000\000\000\000 (WP) loadable text
->15 byte 0 Optimized for Intel
->15 byte 1 Optimized for Non-Intel
-1 string WPC (Corel/WP)
->8 short 257 WordPerfect macro
->8 short 258 WordPerfect help file
->8 short 259 WordPerfect keyboard file
->8 short 266 WordPerfect document
->8 short 267 WordPerfect dictionary
->8 short 268 WordPerfect thesaurus
->8 short 269 WordPerfect block
->8 short 270 WordPerfect rectangular block
->8 short 271 WordPerfect column block
->8 short 272 WordPerfect printer data
->8 short 275 WordPerfect printer data
->8 short 276 WordPerfect driver resource data
->8 short 279 WordPerfect hyphenation code
->8 short 280 WordPerfect hyphenation data
->8 short 281 WordPerfect macro resource data
->8 short 283 WordPerfect hyphenation lex
->8 short 285 WordPerfect wordlist
->8 short 286 WordPerfect equation resource data
->8 short 289 WordPerfect spell rules
->8 short 290 WordPerfect dictionary rules
->8 short 295 WordPerfect spell rules (Microlytics)
->8 short 299 WordPerfect settings file
->8 short 301 WordPerfect 4.2 document
->8 short 325 WordPerfect dialog file
->8 short 332 WordPerfect button bar
->8 short 513 Shell macro
->8 short 522 Shell definition
->8 short 769 Notebook macro
->8 short 770 Notebook help file
->8 short 771 Notebook keyboard file
->8 short 778 Notebook definition
->8 short 1026 Calculator help file
->8 short 1538 Calendar help file
->8 short 1546 Calendar data file
->8 short 1793 Editor macro
->8 short 1794 Editor help file
->8 short 1795 Editor keyboard file
->8 short 1817 Editor macro resource file
->8 short 2049 Macro editor macro
->8 short 2050 Macro editor help file
->8 short 2051 Macro editor keyboard file
->8 short 2305 PlanPerfect macro
->8 short 2306 PlanPerfect help file
->8 short 2307 PlanPerfect keyboard file
->8 short 2314 PlanPerfect worksheet
->8 short 2319 PlanPerfect printer definition
->8 short 2322 PlanPerfect graphic definition
->8 short 2323 PlanPerfect data
->8 short 2324 PlanPerfect temporary printer
->8 short 2329 PlanPerfect macro resource data
->8 byte 11 Mail
->8 short 2818 help file
->8 short 2821 distribution list
->8 short 2826 out box
->8 short 2827 in box
->8 short 2836 users archived mailbox
->8 short 2837 archived message database
->8 short 2838 archived attachments
->8 short 3083 Printer temporary file
->8 short 3330 Scheduler help file
->8 short 3338 Scheduler in file
->8 short 3339 Scheduler out file
->8 short 3594 GroupWise settings file
->8 short 3601 GroupWise directory services
->8 short 3627 GroupWise settings file
->8 short 4362 Terminal resource data
->8 short 4363 Terminal resource data
->8 short 4395 Terminal resource data
->8 short 4619 GUI loadable text
->8 short 4620 graphics resource data
->8 short 4621 printer settings file
->8 short 4622 port definition file
->8 short 4623 print queue parameters
->8 short 4624 compressed file
->8 short 5130 Network service msg file
->8 short 5131 Network service msg file
->8 short 5132 Async gateway login msg
->8 short 5134 GroupWise message file
->8 short 7956 GroupWise admin domain database
->8 short 7957 GroupWise admin host database
->8 short 7959 GroupWise admin remote host database
->8 short 7960 GroupWise admin ADS deferment data file
->8 short 8458 IntelliTAG (SGML) compiled DTD
->8 long 18219264 WordPerfect graphic image (1.0)
->8 long 18219520 WordPerfect graphic image (2.0)
-#end of WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
diff --git a/usr.bin/find/extern.h b/usr.bin/find/extern.h
index cf2d959d5bdf6..a11183d21dc62 100644
--- a/usr.bin/find/extern.h
+++ b/usr.bin/find/extern.h
@@ -83,4 +83,4 @@ PLAN *c_mtime __P((char *));
PLAN *c_not __P((void));
PLAN *c_or __P((void));
-extern int ftsoptions, isdeprecated, isdepth, isoutput, issort, isxargs;
+extern int ftsoptions, isdeprecated, isdepth, isoutput, isxargs;
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1
index ed958c4f784a7..97578885de6d1 100644
--- a/usr.bin/find/find.1
+++ b/usr.bin/find/find.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)find.1 8.7 (Berkeley) 5/9/95
-.\" $Id: find.1,v 1.17 1998/11/29 12:00:06 bde Exp $
+.\" $Id: find.1,v 1.14 1997/10/27 14:25:54 steve Exp $
.\"
.Dd May 9, 1995
.Dt FIND 1
@@ -44,7 +44,7 @@
.Sh SYNOPSIS
.Nm find
.Op Fl H | Fl L | Fl P
-.Op Fl Xdsx
+.Op Fl Xdx
.Op Fl f Ar file
.Op Ar file ...
.Ar expression
@@ -68,8 +68,7 @@ option causes the file information and file type (see
returned for each symbolic link specified on the command line to be
those of the file referenced by the link, not the link itself.
If the referenced file does not exist, the file information and type will
-be for the link itself.
-File information of all symbolic links not on
+be for the link itself. File information of all symbolic links not on
the command line is that of the link itself.
.It Fl L
The
@@ -122,20 +121,6 @@ option specifies a file hierarchy for
to traverse.
File hierarchies may also be specified as the operands immediately
following the options.
-.It Fl s
-The
-.Fl s
-option causes
-.Nm find
-to traverse the file hierarchies in lexicographical order,
-i.e., alphabetical order within each directory.
-Note:
-.Sq find -s
-and
-.So
-find | sort
-.Sc
-may give different results.
.It Fl x
The
.Fl x
@@ -173,13 +158,10 @@ was started, rounded up to the next full 24\-hour period, is
.Ar n
24\-hour periods.
.It Ic -delete
-Delete found files and/or directories.
-Always returns true.
-This executes
+Delete found files and/or directories. Always returns True. This executes
from the current working directory as
.Nm
-recurses down the tree.
-It will not attempt to delete a filename with a ``/''
+recurses down the tree. It will not attempt to delete a filename with a ``/''
character in its pathname relative to "." for security reasons.
Depth\-first traversal processing is implied by this option.
.It Ic -exec Ar utility Op argument ... ;
@@ -202,8 +184,7 @@ primary is identical to the
primary with the exception that
.Ar Utility
will be executed from the directory that holds
-the current file.
-The filename substituted for
+the current file. The filename substituted for
the string ``{}'' is not qualified.
.It Ic -fstype Ar type
True if the file is contained in a file system of type
@@ -526,7 +507,7 @@ option and the
.Pp
The
.Ic -delete
-primary does not interact well with other options that cause the filesystem
+primary do not interact well with other options that cause the filesystem
tree traversal options to be changed.
.Sh HISTORY
A
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c
index 56e2340345860..8afadf8b2ef13 100644
--- a/usr.bin/find/find.c
+++ b/usr.bin/find/find.c
@@ -50,22 +50,6 @@ static char sccsid[] = "@(#)find.c 8.5 (Berkeley) 8/5/94";
#include "find.h"
-static int find_compare __P((const FTSENT **s1, const FTSENT **s2));
-
-/*
- * find_compare --
- * tell fts_open() how to order the traversal of the hierarchy.
- * This variant gives lexicographical order, i.e., alphabetical
- * order within each directory.
- */
-static int
-find_compare(s1, s2)
- const FTSENT **s1, **s2;
-{
-
- return (strcoll((*s1)->fts_name, (*s2)->fts_name));
-}
-
/*
* find_formplan --
* process the command line and create a "plan" corresponding to the
@@ -171,8 +155,7 @@ find_execute(plan, paths)
PLAN *p;
int rval;
- tree = fts_open(paths, ftsoptions, (issort ? find_compare : NULL));
- if (tree == NULL)
+ if ((tree = fts_open(paths, ftsoptions, (int (*)())NULL)) == NULL)
err(1, "ftsopen");
for (rval = 0; (entry = fts_read(tree)) != NULL;) {
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index d8a590e4e58f0..1ffdd5236186c 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -949,7 +949,6 @@ c_perm(perm)
err(1, "-perm: %s: illegal mode string", perm);
new->m_data = getmode(set, 0);
- free(set);
return (new);
}
diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c
index 21770fbcf4779..49ad226c57eda 100644
--- a/usr.bin/find/main.c
+++ b/usr.bin/find/main.c
@@ -65,7 +65,6 @@ int ftsoptions; /* options for the ftsopen(3) call */
int isdeprecated; /* using deprecated syntax */
int isdepth; /* do directories on post-order visit */
int isoutput; /* user specified output operator */
-int issort; /* do hierarchies in lexicographical order */
int isxargs; /* don't permit xargs delimiting chars */
static void usage __P((void));
@@ -85,7 +84,7 @@ main(argc, argv)
p = start = argv;
Hflag = Lflag = 0;
ftsoptions = FTS_NOSTAT | FTS_PHYSICAL;
- while ((ch = getopt(argc, argv, "HLPXdf:sx")) != -1)
+ while ((ch = getopt(argc, argv, "HLPXdf:x")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -107,9 +106,6 @@ main(argc, argv)
case 'f':
*p++ = optarg;
break;
- case 's':
- issort = 1;
- break;
case 'x':
ftsoptions |= FTS_XDEV;
break;
@@ -155,6 +151,6 @@ static void
usage()
{
(void)fprintf(stderr,
-"usage: find [-H | -L | -P] [-Xdsx] [-f file] [file ...] [expression]\n");
+"usage: find [-H | -L | -P] [-Xdx] [-f file] [file ...] [expression]\n");
exit(1);
}
diff --git a/usr.bin/find/operator.c b/usr.bin/find/operator.c
index 3654bcabd5fa5..d331faf9a5fe0 100644
--- a/usr.bin/find/operator.c
+++ b/usr.bin/find/operator.c
@@ -190,7 +190,7 @@ not_squish(plan)
int notlevel = 1;
node = yanknode(&plan);
- while (node != NULL && node->type == N_NOT) {
+ while ((node != NULL) && (node->type == N_NOT)) {
++notlevel;
node = yanknode(&plan);
}
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index a1e49a3e3f13d..1378be4b188d8 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $Id: ftp.c,v 1.14 1998/07/26 18:49:36 imp Exp $ */
+/* $Id: ftp.c,v 1.13 1998/06/09 04:30:51 imp Exp $ */
/* $NetBSD: ftp.c,v 1.29.2.1 1997/11/18 01:01:04 mellon Exp $ */
/*
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-__RCSID("$Id: ftp.c,v 1.14 1998/07/26 18:49:36 imp Exp $");
+__RCSID("$Id: ftp.c,v 1.13 1998/06/09 04:30:51 imp Exp $");
__RCSID_SOURCE("$NetBSD: ftp.c,v 1.29.2.1 1997/11/18 01:01:04 mellon Exp $");
#endif
#endif /* not lint */
@@ -333,8 +333,7 @@ getreply(expecteof)
if (dig > 4 && pflag == 1 && isdigit((unsigned char)c))
pflag = 2;
if (pflag == 2) {
- if (c != '\r' && c != ')' &&
- pt < &pasv[sizeof(pasv)-1])
+ if (c != '\r' && c != ')')
*pt++ = c;
else {
*pt = '\0';
diff --git a/usr.bin/gcore/Makefile b/usr.bin/gcore/Makefile
index 7f6a3eed905ac..664813febb927 100644
--- a/usr.bin/gcore/Makefile
+++ b/usr.bin/gcore/Makefile
@@ -1,8 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= gcore
-SRCS= elfcore.c gcore.c
-CFLAGS+=-Wall
+SRCS= gcore.c
DPADD= ${LIBKVM}
LDADD= -lkvm
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c
deleted file mode 100644
index af199ca8f705c..0000000000000
--- a/usr.bin/gcore/elfcore.c
+++ /dev/null
@@ -1,514 +0,0 @@
-/*-
- * Copyright (c) 1998 John D. Polstra
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: elfcore.c,v 1.1 1998/10/19 19:42:18 jdp Exp $
- */
-
-#include <sys/param.h>
-#include <sys/lock.h>
-#include <sys/procfs.h>
-#include <vm/vm_param.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <vm/vm_map.h>
-#include <vm/vm_prot.h>
-#include <elf.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "extern.h"
-
-/*
- * Code for generating ELF core dumps.
- */
-
-typedef void (*segment_callback)(vm_map_entry_t, void *);
-
-/* Closure for cb_put_phdr(). */
-struct phdr_closure {
- Elf_Phdr *phdr; /* Program header to fill in */
- Elf_Off offset; /* Offset of segment in core file */
-};
-
-/* Closure for cb_size_segment(). */
-struct sseg_closure {
- int count; /* Count of writable segments. */
- size_t size; /* Total size of all writable segments. */
-};
-
-static void cb_put_phdr(vm_map_entry_t, void *);
-static void cb_size_segment(vm_map_entry_t, void *);
-static void each_writable_segment(vm_map_entry_t, segment_callback,
- void *closure);
-static void elf_corehdr(int fd, pid_t, vm_map_entry_t, int numsegs,
- void *hdr, size_t hdrsize);
-static void elf_puthdr(vm_map_entry_t, void *, size_t *,
- const prstatus_t *, const prfpregset_t *, const prpsinfo_t *, int numsegs);
-static void elf_putnote(void *dst, size_t *off, const char *name, int type,
- const void *desc, size_t descsz);
-static void freemap(vm_map_entry_t);
-static void readhdrinfo(pid_t, prstatus_t *, prfpregset_t *, prpsinfo_t *);
-static vm_map_entry_t readmap(pid_t);
-
-/*
- * Write an ELF coredump for the given pid to the given fd.
- */
-void
-elf_coredump(int fd, pid_t pid)
-{
- vm_map_entry_t map;
- struct sseg_closure seginfo;
- void *hdr;
- size_t hdrsize;
- char memname[64];
- int memfd;
- Elf_Phdr *php;
- int i;
-
- /* Get the program's memory map. */
- map = readmap(pid);
-
- /* Size the program segments. */
- seginfo.count = 0;
- seginfo.size = 0;
- each_writable_segment(map, cb_size_segment, &seginfo);
-
- /*
- * Calculate the size of the core file header area by making
- * a dry run of generating it. Nothing is written, but the
- * size is calculated.
- */
- hdrsize = 0;
- elf_puthdr(map, (void *)NULL, &hdrsize,
- (const prstatus_t *)NULL, (const prfpregset_t *)NULL,
- (const prpsinfo_t *)NULL, seginfo.count);
-
- /*
- * Allocate memory for building the header, fill it up,
- * and write it out.
- */
- hdr = malloc(hdrsize);
- if ((hdr = malloc(hdrsize)) == NULL)
- errx(1, "out of memory");
- elf_corehdr(fd, pid, map, seginfo.count, hdr, hdrsize);
-
- /* Write the contents of all of the writable segments. */
- snprintf(memname, sizeof memname, "/proc/%d/mem", pid);
- if ((memfd = open(memname, O_RDONLY)) == -1)
- err(1, "cannot open %s", memname);
-
- php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1;
- for (i = 0; i < seginfo.count; i++) {
- int nleft = php->p_filesz;
-
- lseek(memfd, (off_t)php->p_vaddr, SEEK_SET);
- while (nleft > 0) {
- char buf[8*1024];
- int nwant;
- int ngot;
-
- nwant = nleft;
- if (nwant > sizeof buf)
- nwant = sizeof buf;
- ngot = read(memfd, buf, nwant);
- if (ngot == -1)
- err(1, "read from %s", memname);
- if (ngot < nwant)
- errx(1, "short read from %s:"
- " wanted %d, got %d\n", memname,
- nwant, ngot);
- ngot = write(fd, buf, nwant);
- if (ngot == -1)
- err(1, "write of segment %d failed", i);
- if (ngot != nwant)
- errx(1, "short write");
- nleft -= nwant;
- }
- php++;
- }
- close(memfd);
- free(hdr);
- freemap(map);
-}
-
-/*
- * A callback for each_writable_segment() to write out the segment's
- * program header entry.
- */
-static void
-cb_put_phdr(vm_map_entry_t entry, void *closure)
-{
- struct phdr_closure *phc = (struct phdr_closure *)closure;
- Elf_Phdr *phdr = phc->phdr;
-
- phc->offset = round_page(phc->offset);
-
- phdr->p_type = PT_LOAD;
- phdr->p_offset = phc->offset;
- phdr->p_vaddr = entry->start;
- phdr->p_paddr = 0;
- phdr->p_filesz = phdr->p_memsz = entry->end - entry->start;
- phdr->p_align = PAGE_SIZE;
- phdr->p_flags = 0;
- if (entry->protection & VM_PROT_READ)
- phdr->p_flags |= PF_R;
- if (entry->protection & VM_PROT_WRITE)
- phdr->p_flags |= PF_W;
- if (entry->protection & VM_PROT_EXECUTE)
- phdr->p_flags |= PF_X;
-
- phc->offset += phdr->p_filesz;
- phc->phdr++;
-}
-
-/*
- * A callback for each_writable_segment() to gather information about
- * the number of segments and their total size.
- */
-static void
-cb_size_segment(vm_map_entry_t entry, void *closure)
-{
- struct sseg_closure *ssc = (struct sseg_closure *)closure;
-
- ssc->count++;
- ssc->size += entry->end - entry->start;
-}
-
-/*
- * For each segment in the given memory map, call the given function
- * with a pointer to the map entry and some arbitrary caller-supplied
- * data.
- */
-static void
-each_writable_segment(vm_map_entry_t map, segment_callback func, void *closure)
-{
- vm_map_entry_t entry;
-
- for (entry = map; entry != NULL; entry = entry->next)
- (*func)(entry, closure);
-}
-
-/*
- * Write the core file header to the file, including padding up to
- * the page boundary.
- */
-static void
-elf_corehdr(int fd, pid_t pid, vm_map_entry_t map, int numsegs, void *hdr,
- size_t hdrsize)
-{
- size_t off;
- prstatus_t status;
- prfpregset_t fpregset;
- prpsinfo_t psinfo;
-
- /* Gather the information for the header. */
- readhdrinfo(pid, &status, &fpregset, &psinfo);
-
- /* Fill in the header. */
- memset(hdr, 0, hdrsize);
- off = 0;
- elf_puthdr(map, hdr, &off, &status, &fpregset, &psinfo, numsegs);
-
- /* Write it to the core file. */
- if (write(fd, hdr, hdrsize) == -1)
- err(1, "write");
-}
-
-/*
- * Generate the ELF coredump header into the buffer at "dst". "dst" may
- * be NULL, in which case the header is sized but not actually generated.
- */
-static void
-elf_puthdr(vm_map_entry_t map, void *dst, size_t *off, const prstatus_t *status,
- const prfpregset_t *fpregset, const prpsinfo_t *psinfo, int numsegs)
-{
- size_t ehoff;
- size_t phoff;
- size_t noteoff;
- size_t notesz;
-
- ehoff = *off;
- *off += sizeof(Elf_Ehdr);
-
- phoff = *off;
- *off += (numsegs + 1) * sizeof(Elf_Phdr);
-
- noteoff = *off;
- elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status,
- sizeof *status);
- elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset,
- sizeof *fpregset);
- elf_putnote(dst, off, "FreeBSD", NT_PRPSINFO, psinfo,
- sizeof *psinfo);
- notesz = *off - noteoff;
-
- /* Align up to a page boundary for the program segments. */
- *off = round_page(*off);
-
- if (dst != NULL) {
- Elf_Ehdr *ehdr;
- Elf_Phdr *phdr;
- struct phdr_closure phc;
-
- /*
- * Fill in the ELF header.
- */
- ehdr = (Elf_Ehdr *)((char *)dst + ehoff);
- ehdr->e_ident[EI_MAG0] = ELFMAG0;
- ehdr->e_ident[EI_MAG1] = ELFMAG1;
- ehdr->e_ident[EI_MAG2] = ELFMAG2;
- ehdr->e_ident[EI_MAG3] = ELFMAG3;
- ehdr->e_ident[EI_CLASS] = ELF_CLASS;
- ehdr->e_ident[EI_DATA] = ELF_DATA;
- ehdr->e_ident[EI_VERSION] = EV_CURRENT;
- ehdr->e_ident[EI_PAD] = 0;
- strncpy(ehdr->e_ident + EI_BRAND, "FreeBSD",
- EI_NIDENT - EI_BRAND);
- ehdr->e_type = ET_CORE;
- ehdr->e_machine = ELF_ARCH;
- ehdr->e_version = EV_CURRENT;
- ehdr->e_entry = 0;
- ehdr->e_phoff = phoff;
- ehdr->e_flags = 0;
- ehdr->e_ehsize = sizeof(Elf_Ehdr);
- ehdr->e_phentsize = sizeof(Elf_Phdr);
- ehdr->e_phnum = numsegs + 1;
- ehdr->e_shentsize = sizeof(Elf_Shdr);
- ehdr->e_shnum = 0;
- ehdr->e_shstrndx = SHN_UNDEF;
-
- /*
- * Fill in the program header entries.
- */
- phdr = (Elf_Phdr *)((char *)dst + phoff);
-
- /* The note segement. */
- phdr->p_type = PT_NOTE;
- phdr->p_offset = noteoff;
- phdr->p_vaddr = 0;
- phdr->p_paddr = 0;
- phdr->p_filesz = notesz;
- phdr->p_memsz = 0;
- phdr->p_flags = 0;
- phdr->p_align = 0;
- phdr++;
-
- /* All the writable segments from the program. */
- phc.phdr = phdr;
- phc.offset = *off;
- each_writable_segment(map, cb_put_phdr, &phc);
- }
-}
-
-/*
- * Emit one note section to "dst", or just size it if "dst" is NULL.
- */
-static void
-elf_putnote(void *dst, size_t *off, const char *name, int type,
- const void *desc, size_t descsz)
-{
- Elf_Note note;
-
- note.n_namesz = strlen(name) + 1;
- note.n_descsz = descsz;
- note.n_type = type;
- if (dst != NULL)
- bcopy(&note, (char *)dst + *off, sizeof note);
- *off += sizeof note;
- if (dst != NULL)
- bcopy(name, (char *)dst + *off, note.n_namesz);
- *off += roundup2(note.n_namesz, sizeof(Elf_Size));
- if (dst != NULL)
- bcopy(desc, (char *)dst + *off, note.n_descsz);
- *off += roundup2(note.n_descsz, sizeof(Elf_Size));
-}
-
-/*
- * Free the memory map.
- */
-static void
-freemap(vm_map_entry_t map)
-{
- while (map != NULL) {
- vm_map_entry_t next = map->next;
- free(map);
- map = next;
- }
-}
-
-/*
- * Read the process information necessary to fill in the core file's header.
- */
-static void
-readhdrinfo(pid_t pid, prstatus_t *status, prfpregset_t *fpregset,
- prpsinfo_t *psinfo)
-{
- char name[64];
- char line[256];
- int fd;
- int i;
- int n;
-
- memset(status, 0, sizeof *status);
- status->pr_version = PRSTATUS_VERSION;
- status->pr_statussz = sizeof(prstatus_t);
- status->pr_gregsetsz = sizeof(gregset_t);
- status->pr_fpregsetsz = sizeof(fpregset_t);
- status->pr_osreldate = __FreeBSD_version;
- status->pr_pid = pid;
-
- memset(fpregset, 0, sizeof *fpregset);
-
- memset(psinfo, 0, sizeof *psinfo);
- psinfo->pr_version = PRPSINFO_VERSION;
- psinfo->pr_psinfosz = sizeof(prpsinfo_t);
-
- /* Read the general registers. */
- snprintf(name, sizeof name, "/proc/%d/regs", pid);
- if ((fd = open(name, O_RDONLY)) == -1)
- err(1, "cannot open %s", name);
- if ((n = read(fd, &status->pr_reg, sizeof status->pr_reg)) == -1)
- err(1, "read error from %s", name);
- if (n < sizeof status->pr_reg)
- errx(1, "short read from %s: wanted %u, got %d", name,
- sizeof status->pr_reg, n);
- close(fd);
-
- /* Read the floating point registers. */
- snprintf(name, sizeof name, "/proc/%d/fpregs", pid);
- if ((fd = open(name, O_RDONLY)) == -1)
- err(1, "cannot open %s", name);
- if ((n = read(fd, fpregset, sizeof *fpregset)) == -1)
- err(1, "read error from %s", name);
- if (n < sizeof *fpregset)
- errx(1, "short read from %s: wanted %u, got %d", name,
- sizeof *fpregset, n);
- close(fd);
-
- /* Read and parse the process status. */
- snprintf(name, sizeof name, "/proc/%d/status", pid);
- if ((fd = open(name, O_RDONLY)) == -1)
- err(1, "cannot open %s", name);
- if ((n = read(fd, line, sizeof line - 1)) == -1)
- err(1, "read error from %s", name);
- if (n > MAXCOMLEN)
- n = MAXCOMLEN;
- for (i = 0; i < n && line[i] != ' '; i++)
- psinfo->pr_fname[i] = line[i];
- strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ);
- close(fd);
-}
-
-/*
- * Read the process's memory map using procfs, and return a list of
- * VM map entries. Only the non-device read/writable segments are
- * returned. The map entries in the list aren't fully filled in; only
- * the items we need are present.
- */
-static vm_map_entry_t
-readmap(pid_t pid)
-{
- char mapname[64];
- int mapfd;
- ssize_t mapsize;
- size_t bufsize;
- char *mapbuf;
- int pos;
- vm_map_entry_t map;
- vm_map_entry_t *linkp;
-
- snprintf(mapname, sizeof mapname, "/proc/%d/map", pid);
- if ((mapfd = open(mapname, O_RDONLY)) == -1)
- err(1, "cannot open %s", mapname);
-
- /*
- * Procfs requires (for consistency) that the entire memory map
- * be read with a single read() call. Start with a reasonbly sized
- * buffer, and double it until it is big enough.
- */
- bufsize = 8 * 1024;
- mapbuf = NULL;
- for ( ; ; ) {
- if ((mapbuf = realloc(mapbuf, bufsize)) == NULL)
- errx(1, "out of memory");
- mapsize = read(mapfd, mapbuf, bufsize);
- if (mapsize != -1 || errno != EFBIG)
- break;
- bufsize *= 2;
- /* This lseek shouldn't be necessary, but it is. */
- lseek(mapfd, (off_t)0, SEEK_SET);
- }
- if (mapsize == -1)
- err(1, "read error from %s", mapname);
- if (mapsize == 0)
- errx(1, "empty map file %s", mapname);
- close(mapfd);
-
- pos = 0;
- map = NULL;
- linkp = &map;
- while (pos < mapsize) {
- vm_map_entry_t ent;
- vm_offset_t start;
- vm_offset_t end;
- char prot[4];
- char type[16];
- int n;
- int len;
-
- len = 0;
- n = sscanf(mapbuf + pos, "%x %x %*d %*d %*d %3[-rwx]"
- " %*d %*d %*x %*s %*s %16s%*[\n]%n",
- &start, &end, prot, type, &len);
- if (n != 4)
- errx(1, "ill-formed line in %s", mapname);
- pos += len;
-
- /* Ignore segments of the wrong kind, and unwritable ones */
- if (strncmp(prot, "rw", 2) != 0 ||
- (strcmp(type, "default") != 0 &&
- strcmp(type, "vnode") != 0 &&
- strcmp(type, "swap") != 0))
- continue;
-
- if ((ent = (vm_map_entry_t)calloc(1, sizeof *ent)) == NULL)
- errx(1, "out of memory");
- ent->start = start;
- ent->end = end;
- ent->protection = VM_PROT_READ | VM_PROT_WRITE;
- if (prot[2] == 'x')
- ent->protection |= VM_PROT_EXECUTE;
-
- *linkp = ent;
- linkp = &ent->next;
- }
- free(mapbuf);
- return map;
-}
diff --git a/usr.bin/gcore/extern.h b/usr.bin/gcore/extern.h
index f157e531a5f3a..3dccafe70845c 100644
--- a/usr.bin/gcore/extern.h
+++ b/usr.bin/gcore/extern.h
@@ -33,9 +33,5 @@
* @(#)extern.h 8.1 (Berkeley) 6/6/93
*/
-#include <sys/types.h>
-#include <kvm.h>
-
void err __P((int, const char *, ...));
-void elf_coredump __P((int, pid_t));
void md_core __P((kvm_t *, int, struct kinfo_proc *));
diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c
index 4702003b8afc1..8ab7b0bdbe613 100644
--- a/usr.bin/gcore/gcore.c
+++ b/usr.bin/gcore/gcore.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)gcore.c 8.2 (Berkeley) 9/23/93";
#endif
static const char rcsid[] =
- "$Id: gcore.c,v 1.12 1998/10/22 04:02:37 jdp Exp $";
+ "$Id: gcore.c,v 1.9 1998/09/14 10:09:30 des Exp $";
#endif /* not lint */
/*
@@ -79,19 +79,17 @@ static const char rcsid[] =
#include "extern.h"
-static void core __P((int, int, struct kinfo_proc *));
-static void datadump __P((int, int, struct proc *, u_long, int));
-static void killed __P((int));
-static void restart_target __P((void));
-static void usage __P((void)) __dead2;
-static void userdump __P((int, struct proc *, u_long, int));
+void core __P((int, int, struct kinfo_proc *));
+void datadump __P((int, int, struct proc *, u_long, int));
+void usage __P((void));
+void userdump __P((int, struct proc *, u_long, int));
kvm_t *kd;
/* XXX undocumented routine, should be in kvm.h? */
ssize_t kvm_uread __P((kvm_t *, const struct proc *, u_long, char *, size_t));
+
static int data_offset;
-static pid_t pid;
int
main(argc, argv)
@@ -99,12 +97,11 @@ main(argc, argv)
char *argv[];
{
register struct proc *p;
- struct kinfo_proc *ki = NULL;
+ struct kinfo_proc *ki;
struct exec exec;
- int ch, cnt, efd, fd, sflag, uid;
+ int ch, cnt, efd, fd, pid, sflag, uid;
char *binfile, *corefile;
char errbuf[_POSIX2_LINE_MAX], fname[MAXPATHLEN + 1];
- int is_aout;
sflag = 0;
corefile = NULL;
@@ -140,53 +137,27 @@ main(argc, argv)
usage();
}
- efd = open(binfile, O_RDONLY, 0);
- if (efd < 0)
- err(1, "%s", binfile);
+ kd = kvm_openfiles(0, 0, 0, O_RDONLY, errbuf);
+ if (kd == NULL)
+ errx(1, "%s", errbuf);
- cnt = read(efd, &exec, sizeof(exec));
- if (cnt != sizeof(exec))
- errx(1, "%s exec header: %s",
- binfile, cnt > 0 ? strerror(EIO) : strerror(errno));
- if (!N_BADMAG(exec)) {
- is_aout = 1;
- /*
- * This legacy a.out support uses the kvm interface instead
- * of procfs.
- */
- kd = kvm_openfiles(0, 0, 0, O_RDONLY, errbuf);
- if (kd == NULL)
- errx(1, "%s", errbuf);
-
- uid = getuid();
-
- ki = kvm_getprocs(kd, KERN_PROC_PID, pid, &cnt);
- if (ki == NULL || cnt != 1)
- errx(1, "%d: not found", pid);
-
- p = &ki->kp_proc;
- if (ki->kp_eproc.e_pcred.p_ruid != uid && uid != 0)
- errx(1, "%d: not owner", pid);
-
- if (p->p_stat == SZOMB)
- errx(1, "%d: zombie", pid);
-
- if (p->p_flag & P_WEXIT)
- errx(1, "%d: process exiting", pid);
- if (p->p_flag & P_SYSTEM) /* Swapper or pagedaemon. */
- errx(1, "%d: system process", pid);
- if (exec.a_text != ptoa(ki->kp_eproc.e_vm.vm_tsize))
- errx(1, "The executable %s does not belong to"
- " process %d!\n"
- "Text segment size (in bytes): executable %ld,"
- " process %d", binfile, pid, exec.a_text,
- ptoa(ki->kp_eproc.e_vm.vm_tsize));
- data_offset = N_DATOFF(exec);
- } else if (IS_ELF(*(Elf_Ehdr *)&exec)) {
- is_aout = 0;
- close(efd);
- } else
- errx(1, "Invalid executable file");
+ uid = getuid();
+
+ ki = kvm_getprocs(kd, KERN_PROC_PID, pid, &cnt);
+ if (ki == NULL || cnt != 1)
+ errx(1, "%d: not found", pid);
+
+ p = &ki->kp_proc;
+ if (ki->kp_eproc.e_pcred.p_ruid != uid && uid != 0)
+ errx(1, "%d: not owner", pid);
+
+ if (p->p_stat == SZOMB)
+ errx(1, "%d: zombie", pid);
+
+ if (p->p_flag & P_WEXIT)
+ errx(1, "%d: process exiting", pid);
+ if (p->p_flag & P_SYSTEM) /* Swapper or pagedaemon. */
+ errx(1, "%d: system process", pid);
if (corefile == NULL) {
(void)snprintf(fname, sizeof(fname), "core.%d", pid);
@@ -196,21 +167,41 @@ main(argc, argv)
if (fd < 0)
err(1, "%s", corefile);
- if (sflag) {
- signal(SIGHUP, killed);
- signal(SIGINT, killed);
- signal(SIGTERM, killed);
- if (kill(pid, SIGSTOP) == -1)
- err(1, "%d: stop signal", pid);
- atexit(restart_target);
+ efd = open(binfile, O_RDONLY, 0);
+ if (efd < 0)
+ err(1, "%s", binfile);
+
+ cnt = read(efd, &exec, sizeof(exec));
+ if (cnt != sizeof(exec))
+ errx(1, "%s exec header: %s",
+ binfile, cnt > 0 ? strerror(EIO) : strerror(errno));
+ if (N_BADMAG(exec)) {
+ const Elf_Ehdr *ehdr = (const Elf_Ehdr *)&exec;
+
+ if (IS_ELF(*ehdr))
+ errx(1, "ELF executables are not supported yet");
+ errx(1, "Invalid executable file");
}
- if (is_aout)
- core(efd, fd, ki);
- else
- elf_coredump(fd, pid);
+ /* check the text segment size of the executable and the process */
+ if (exec.a_text != ptoa(ki->kp_eproc.e_vm.vm_tsize))
+ errx(1,
+ "The executable %s does not belong to process %d!\n"
+ "Text segment size (in bytes): executable %d, process %d",
+ binfile, pid, exec.a_text,
+ ptoa(ki->kp_eproc.e_vm.vm_tsize));
+
+ data_offset = N_DATOFF(exec);
+
+ if (sflag && kill(pid, SIGSTOP) < 0)
+ err(1, "%d: stop signal", pid);
+ core(efd, fd, ki);
+
+ if (sflag && kill(pid, SIGCONT) < 0)
+ err(1, "%d: continue signal", pid);
(void)close(fd);
+
exit(0);
}
@@ -295,21 +286,6 @@ datadump(efd, fd, p, addr, npage)
}
}
-static void
-killed(sig)
- int sig;
-{
- restart_target();
- signal(sig, SIG_DFL);
- kill(getpid(), sig);
-}
-
-static void
-restart_target()
-{
- kill(pid, SIGCONT);
-}
-
void
userdump(fd, p, addr, npage)
register int fd;
diff --git a/usr.bin/gencat/gencat.1 b/usr.bin/gencat/gencat.1
index 6a4d26cc5f0dd..f21b471935731 100644
--- a/usr.bin/gencat/gencat.1
+++ b/usr.bin/gencat/gencat.1
@@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: gencat.1,v 1.1 1997/09/14 20:23:02 wosch Exp $
+.\" $Id$
.\"
.Dd June 11, 1997
.Dt GENCAT 1
@@ -33,130 +33,22 @@
.Nm gencat
.Nd NLS catalog compiler
.Sh SYNOPSIS
-.Nm
+.Nm gencat
.Ar "output-file"
-.Ar "input-files..."
+.Ar "input-file..."
.Sh DESCRIPTION
The
-.Nm
-utility merges the text NLS input files
-.Ar "input-files..."
-into a formatted message catalog file
-.Ar "output-file" .
-The file
-.Ar "output-file"
-will be created if it does not already exist. If
-.Ar "output-file"
-does exist, its messages will be included in the new
-.Ar "output-file" .
-If set and message numbers collide, the new message text defined in
-.Ar "input-files..."
-will replace the old message text currently contained in
-.Ar "output-file" .
-.Sh INPUT FILES
-The format of a message text source file is defined below. Note that
-the fields of a message text source line are separated by a single space
-character: any other space characters are considered to be part of the
-field contents.
-.Pp
-.Bl -tag -width
-.It Li $set Ar n comment
-This line specifies the set identifier of the following messages until
-the next
-.Li $set
-or end-of-file appears. The argument
-.Ar n
-is the set identifier which is defined as a number in the range
-[1, (NL_SETMAX)]. Set identifiers must occur in ascending order within
-a single source file, but need not be contiguous. Any string following
-a space following the set identifier is treated as a comment. If no
-.Li $set
-directive is specified in a given source file, all messages will
-be located in the default message set NL_SETD.
-.It Li $del Ar n comment
-This line deletes messages from set
-.Ar n
-from a message catalog. The
-.Ar n
-specifies a set number. Any string following a space following the set
-number is treated as a comment.
-.It Li $ Ar comment
-A line beginning with
-.Li $
-followed by a space is treated as a comment.
-.It Ar m message-text
-A message line consists of a message identifier
-.Ar m
-in the range [1, (NL_MSGMAX)]. The
-.Ar message-text
-is stored in the message catalog with the set identifier specified by
-the last
-.Li $set
-directive, and the message identifier
-.Ar m .
-If the
-.Ar message-text
-is empty, and there is a space character following the message identifier,
-an empty string is stored in the message catalog. If the
-.Ar message-text
-is empty, and if there is no space character following the message
-identifier, then the existing message in the current set with the
-specified message identifier is deleted from the catalog. Message
-identifiers must be in ascending order within a single set, but
-need not be contiguous. The
-.Ar message-text
-length must be in the range [0, (NL_TEXTMAX)].
-.It Li $quote Ar c
-This line specifies an optional quote character
-.Ar c
-which can be used to surround
-.Ar message-text
-so that trailing space or empty messages are visible in message
-source files. By default, or if an empty
-.Li $quote
-directive is specified, no quoting of
-.Ar message-text
-will be recognized.
-.El
-.Pp
-Empty lines in message source files are ignored. The effect of lines
-beginning with any character other than those described above is
-undefined.
-.Pp
-Text strings can contain the following special characters and escape
-sequences. In addition, if a quote character is defined, it may be
-escaped as well to embed a literal quote character.
-.Pp
-.Bl -tag -width Ds -offset indent
-.It Li \en
-line feed
-.It Li \et
-horizontal tab
-.It Li \ev
-vertical tab
-.It Li \eb
-backspace
-.It Li \er
-carriage return
-.It Li \ef
-form feed
-.It Li \e\e
-backslash
-.It Li \eooo
-octal number in the range [000, 377]
-.El
-.Pp
-A backslash character immediately before the end of the line in a file
-is used to continue the line onto the next line, e.g.:
-.Pp
-.Dl 1 This line is continued \e
-.Dl on this line.
-.Pp
-If the character following the backslash is not one of those specified,
-the backslash is ignored.
+.Nm gencat
+utility compiles a text NLS input file into a catalog in a binary
+format used by the
+.Xr catclose 3 ,
+.Xr catgets 3
+and
+.Xr catopen 3
+functions.
.Pp
The
-.Nm
+.Nm gencat
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr catclose 3 ,
@@ -164,15 +56,7 @@ utility exits 0 on success, and >0 if an error occurs.
.Xr catopen 3
.Sh STANDARDS
The
-.Nm
-utility is compliant with the
-.St -xpg4
-standard.
-.Sh AUTHOR
-This manual page by
-.An Ken Stailey
-updated and revised by
-.An Terry Lambert .
-.Sh BUGS
-A message catalog file created from a blank input file can not be revised;
-it must be deleted and recreated.
+.Nm gencat
+utility is expected to be
+.St -xpg3
+compatible.
diff --git a/usr.bin/global/Makefile.inc b/usr.bin/global/Makefile.inc
index 34657a06430a4..b6798433b79d6 100644
--- a/usr.bin/global/Makefile.inc
+++ b/usr.bin/global/Makefile.inc
@@ -1,18 +1,4 @@
-# $Id: Makefile.inc,v 1.5 1999/01/18 07:38:09 simokawa Exp $
+# $Id: Makefile.inc,v 1.3 1997/12/15 23:34:51 cwt Exp $
-.if !defined(GLOBAL_MAKEFILE_INC_BEEN_HERE)
-
-GLOBAL_MAKEFILE_INC_BEEN_HERE=yes
-.if exists(${.OBJDIR}/../lib)
-LIBDESTDIR= ${.OBJDIR}/../lib
-.else
-LIBDESTDIR= ${.CURDIR}/../lib
-.endif
-DPADD= ${LIBDESTDIR}/libgloutil.a
-LDADD= ${LIBDESTDIR}/libgloutil.a
-CFLAGS+= -I${GLOBAL_DIR}/lib -O \
- -Wall -Wwrite-strings -Wmissing-prototypes
-
-.include "../Makefile.inc"
-
-.endif
+BINDIR?= /usr/bin
+CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
diff --git a/usr.bin/global/btreeop/Makefile b/usr.bin/global/btreeop/Makefile
index 12f4357e7bbe1..ecd9fc3dede79 100644
--- a/usr.bin/global/btreeop/Makefile
+++ b/usr.bin/global/btreeop/Makefile
@@ -1,8 +1,12 @@
-# $Id: Makefile,v 1.4 1997/12/17 15:18:49 cwt Exp $
+# $Id: Makefile,v 1.3 1997/12/15 23:34:51 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/btreeop
+CFLAGS+= -I${GLOBAL_DIR}/lib
+DPADD= ${.OBJDIR}/../lib/libglobalutil.a
+LDADD= ${.OBJDIR}/../lib/libglobalutil.a
+
PROG= btreeop
.include <bsd.prog.mk>
diff --git a/usr.bin/global/gctags/Makefile b/usr.bin/global/gctags/Makefile
index b66694a58d1f9..b4839f948c23a 100644
--- a/usr.bin/global/gctags/Makefile
+++ b/usr.bin/global/gctags/Makefile
@@ -1,13 +1,17 @@
-# $Id: Makefile,v 1.4 1997/12/17 15:18:52 cwt Exp $
+# $Id: Makefile,v 1.3 1997/12/15 23:34:52 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/gctags
-CFLAGS+= -I${GLOBAL_DIR}/gctags
+CFLAGS+= -I${GLOBAL_DIR}/lib
+CFLAGS+= -I${GLOBAL_DIR}/gctags -DGLOBAL -DYACC
+DPADD= ${.OBJDIR}/../lib/libglobalutil.a
+LDADD= ${.OBJDIR}/../lib/libglobalutil.a
+
+SRCS= C.c ctags.c fortran.c lisp.c print.c tree.c yacc.c assembler.c
PROG= gctags
-SRCS= C.c assembler.c gctags.c java.c
.include <bsd.prog.mk>
diff --git a/usr.bin/global/global/Makefile b/usr.bin/global/global/Makefile
index 0deeda4643037..94f7bc89ffaa7 100644
--- a/usr.bin/global/global/Makefile
+++ b/usr.bin/global/global/Makefile
@@ -1,8 +1,12 @@
-# $Id: Makefile,v 1.4 1997/12/17 15:18:53 cwt Exp $
+# $Id: Makefile,v 1.3 1997/12/15 23:34:53 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/global
+CFLAGS+= -I${GLOBAL_DIR}/lib
+DPADD= ${.OBJDIR}/../lib/libglobalutil.a
+LDADD= ${.OBJDIR}/../lib/libglobalutil.a
+
PROG= global
.include <bsd.prog.mk>
diff --git a/usr.bin/global/gtags/Makefile b/usr.bin/global/gtags/Makefile
index 05f506f77ce10..b21d1d2781587 100644
--- a/usr.bin/global/gtags/Makefile
+++ b/usr.bin/global/gtags/Makefile
@@ -1,8 +1,12 @@
-# $Id: Makefile,v 1.5 1997/12/17 15:18:54 cwt Exp $
+# $Id: Makefile,v 1.4 1997/12/15 23:34:54 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/gtags
+CFLAGS+= -I${GLOBAL_DIR}/lib
+DPADD= ${.OBJDIR}/../lib/libglobalutil.a
+LDADD= ${.OBJDIR}/../lib/libglobalutil.a
+
PROG= gtags
.include <bsd.prog.mk>
diff --git a/usr.bin/global/lib/Makefile b/usr.bin/global/lib/Makefile
index 793f953cb09fe..3d1e354a35b65 100644
--- a/usr.bin/global/lib/Makefile
+++ b/usr.bin/global/lib/Makefile
@@ -1,12 +1,12 @@
-# $Id: Makefile,v 1.2 1997/12/21 08:31:50 cwt Exp $
+# $Id: Makefile,v 1.1 1997/12/15 23:40:54 cwt Exp $
GLOBAL_DIR= ${.CURDIR}/../../../contrib/global
.PATH: ${GLOBAL_DIR}/lib
-LIB= gloutil
-SRCS= gtagsop.c tab.c strbuf.c mgets.c defined.c getdbpath.c \
- find.c dbop.c test.c makepath.c locatestring.c pathop.c \
- conf.c strmake.c usable.c token.c
+LIB= globalutil
+SRCS= dbio.c dbname.c find.c getdbpath.c gtagsopen.c locatestring.c \
+ lookup.c makepath.c mgets.c strop.c tab.c tag.c test.c
+
NOPROFILE= noprofile
INTERNALLIB= true
INTERNALSTATICLIB= true
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c
index b72da84ce8c76..0a74542db3583 100644
--- a/usr.bin/hexdump/display.c
+++ b/usr.bin/hexdump/display.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)display.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: display.c,v 1.2 1997/07/10 06:48:12 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -234,7 +234,6 @@ get()
static u_char *curp, *savp;
register int n;
int need, nread;
- int valid_save = 0;
u_char *tmpp;
if (!curp) {
@@ -245,7 +244,6 @@ get()
curp = savp;
savp = tmpp;
address += blocksize;
- valid_save = 1;
}
for (need = blocksize, nread = 0;;) {
/*
@@ -256,9 +254,7 @@ get()
if (!length || ateof && !next((char **)NULL)) {
if (need == blocksize)
return((u_char *)NULL);
- if (vflag != ALL &&
- valid_save &&
- bcmp(curp, savp, nread) == 0) {
+ if (vflag != ALL && !bcmp(curp, savp, nread)) {
if (vflag != DUP)
(void)printf("*\n");
return((u_char *)NULL);
@@ -280,8 +276,7 @@ get()
length -= n;
if (!(need -= n)) {
if (vflag == ALL || vflag == FIRST ||
- valid_save == 0 ||
- bcmp(curp, savp, blocksize) != 0) {
+ bcmp(curp, savp, blocksize)) {
if (vflag == DUP || vflag == FIRST)
vflag = WAIT;
return(curp);
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index ff5e4203a0ebf..4dba8d5336cc4 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -46,7 +46,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93";
#endif
static const char rcsid[] =
- "$Id: indent.c,v 1.2 1997/07/15 09:50:59 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
@@ -209,10 +209,10 @@ main(argc, argv)
set_option(argv[i]);
} /* end of for */
if (input == 0) {
- input = stdin;
+ usage();
}
if (output == 0)
- if (troff || input == stdin)
+ if (troff)
output = stdout;
else {
out_name = in_name;
@@ -1133,7 +1133,7 @@ check_type:
static void
usage()
{
- fprintf(stderr, "usage: indent [ file [ outfile ] ] [ options ]\n");
+ fprintf(stderr, "usage: indent file [ outfile ] [ options ]\n");
exit(1);
}
diff --git a/usr.bin/kdump/mkioctls b/usr.bin/kdump/mkioctls
index 837d24f49bd98..8ff0cd6f95488 100644
--- a/usr.bin/kdump/mkioctls
+++ b/usr.bin/kdump/mkioctls
@@ -1,62 +1,29 @@
-set -e
-
-# Build a list of headers that have ioctls in them.
# XXX should we use an ANSI cpp?
-# XXX netipx conflicts with netns (leave out netns).
-ioctl_includes=`
- cd $DESTDIR/usr/include
- find * -name '*.h' -follow |
- egrep -v '^(netns)/' |
- xargs egrep -l \
-'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-0_]*[ ]+_IO[^a-z0-9_]' |
- sed -e 's/^/#include </' -e s'/$/>/'
-`
-
-echo "$ioctl_includes" |
- cpp -I$DESTDIR/usr/include -dM |
- awk -v ioctl_includes="$ioctl_includes" '
+# XXX does -I$DESTDIR/usr/include actually work?
+(echo "#include <sys/ioctl.h>"
+ echo "#include <sys/ioctl_compat.h>"
+) | cpp -I$DESTDIR/usr/include -dM | awk '
BEGIN {
- print "/* XXX obnoxious prerequisites. */"
- print "#define COMPAT_43"
print "#include <sys/param.h>"
- print "#include <sys/device.h>"
- print "#include <sys/devicestat.h>"
- print "#include <sys/disklabel.h>"
- print "#include <sys/disk.h>"
- print "#include <sys/dkbad.h>"
+ print "#include <sys/queue.h>"
print "#include <sys/socket.h>"
+ print "#include <sys/socketvar.h>"
print "#include <sys/time.h>"
- print "#include <sys/tty.h>"
- print "#include <net/if.h>"
- print "#include <net/if_var.h>"
print "#include <net/route.h>"
- print "#include <netatm/atm.h>"
- print "#include <netatm/atm_if.h>"
- print "#include <netatm/atm_sap.h>"
- print "#include <netatm/atm_sys.h>"
+ print "#include <net/if.h>"
print "#include <netinet/in.h>"
- print "#include <netinet/ip_compat.h>"
- print "#include <netinet/ip_fil.h>"
- print "#include <netinet/ip_auth.h>"
- print "#include <netinet/ip_nat.h>"
- print "#include <netinet/ip_frag.h>"
print "#include <netinet/ip_mroute.h>"
- print "#include <netinet/ip_state.h>"
- print "#include <cam/cam.h>"
- print "#include <stdio.h>"
- print ""
- print ioctl_includes
+ print "#include <sys/termios.h>"
+ print "#define COMPAT_43"
+ print "#include <sys/ioctl.h>"
print ""
print "char *"
print "ioctlname(val)"
print "{"
print ""
- generate_case_statement = 0
- if (generate_case_statement)
- print "\tswitch(val) {"
}
-/^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO/ {
+/^#[ ]*define[ ]*(TIO|FIO|SIO|OSIO)[A-Z]*[ ]*_IO/ {
# find where the name starts
for (i = 1; i <= NF; i++)
@@ -64,15 +31,10 @@ BEGIN {
break;
++i;
#
- if (generate_case_statement)
- printf("\tcase %s:\n\t\treturn(\"%s\");\n", $i, $i);
- else
- printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i);
+ printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i);
}
END {
- if (generate_case_statement)
- print "\t}"
print "\n\treturn(NULL);"
print "}"
}
diff --git a/usr.bin/locate/locate/locate.rc b/usr.bin/locate/locate/locate.rc
index e1f400083ba91..28718c0a97b26 100644
--- a/usr.bin/locate/locate/locate.rc
+++ b/usr.bin/locate/locate/locate.rc
@@ -1,13 +1,13 @@
#
# /etc/locate.rc - command script for updatedb(8)
#
-# $Id: locate.rc,v 1.6 1998/03/08 16:09:26 wosch Exp $
+# $Id: locate.rc,v 1.5 1998/01/01 02:34:14 alex Exp $
#
# All commented values are the defaults
#
# temp directory
-#TMPDIR="/tmp"
+#TMPDIR="/var/tmp"
# the actual database
#FCODES="/var/db/locate.database"
diff --git a/usr.bin/locate/locate/mklocatedb.sh b/usr.bin/locate/locate/mklocatedb.sh
index 864760e87ec74..1268a06a69c09 100644
--- a/usr.bin/locate/locate/mklocatedb.sh
+++ b/usr.bin/locate/locate/mklocatedb.sh
@@ -28,7 +28,8 @@
#
# usage: mklocatedb [-presort] < filelist > database
#
-# $Id: mklocatedb.sh,v 1.7 1998/03/08 16:09:28 wosch Exp $
+# $Id: mklocatedb.sh,v 1.6 1998/03/08 15:28:35 wosch Exp $
+
# The directory containing locate subprograms
: ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR
@@ -37,12 +38,8 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; export PATH
umask 077 # protect temp files
-: ${TMPDIR:=/tmp}; export TMPDIR
-test -d "$TMPDIR" || TMPDIR=/tmp
-if ! TMPDIR=`mktemp -d $TMPDIR/mklocateXXXXXX`; then
- exit 1
-fi
-
+: ${TMPDIR:=/var/tmp}; export TMPDIR
+test -d "$TMPDIR" || TMPDIR=/var/tmp
# utilities to built locate database
: ${bigram:=locate.bigram}
@@ -53,41 +50,23 @@ fi
sortopt="-u -T $TMPDIR"
sortcmd=$sort
+# Input already sorted
+case X"$1" in
+ X-nosort|X-presort) sortcmd=cat; sortopt=;shift;;
+esac
+
bigrams=$TMPDIR/_mklocatedb$$.bigrams
filelist=$TMPDIR/_mklocatedb$$.list
-trap 'rm -f $bigrams $filelist; rmdir $TMPDIR' 0 1 2 3 5 10 15
+trap 'rm -f $bigrams $filelist' 0 1 2 3 5 10 15
-# Input already sorted
-if [ X"$1" = "X-presort" ]; then
- shift;
-
- # create an empty file
- true > $bigrams
-
- # Locate database bootstrapping
- # 1. first build a temp database without bigram compression
- # 2. create the bigram from the temp database
- # 3. create the real locate database with bigram compression.
- #
- # This scheme avoid large temporary files in /tmp
-
- $code $bigrams > $filelist || exit 1
- locate -d $filelist / | $bigram | $sort -nr | head -128 |
- perl -ne '/^\s*[0-9]+\s(..)$/ && print $1 || exit 1' > $bigrams || exit 1
- locate -d $filelist / | $code $bigrams || exit 1
- exit
-
-else
- if $sortcmd $sortopt > $filelist; then
+if $sortcmd $sortopt > $filelist; then
$bigram < $filelist | $sort -nr |
- perl -ne '/^\s*[0-9]+\s(..)$/ && print $1 || exit 1' > $bigrams
- || exit 1
- $code $bigrams < $filelist || exit 1
- else
+ awk 'NR <= 128 { printf $2 }' > $bigrams &&
+ $code $bigrams < $filelist
+else
echo "`basename $0`: cannot build locate database" >&2
exit 1
- fi
fi
diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh
index 29c30bc902d5c..97c586badd886 100644
--- a/usr.bin/locate/locate/updatedb.sh
+++ b/usr.bin/locate/locate/updatedb.sh
@@ -26,7 +26,7 @@
#
# updatedb - update locate database for local mounted filesystems
#
-# $Id: updatedb.sh,v 1.11 1998/06/18 09:26:22 wosch Exp $
+# $Id: updatedb.sh,v 1.10 1998/03/08 16:09:31 wosch Exp $
LOCATE_CONFIG="/etc/locate.rc"
if [ -f "$LOCATE_CONFIG" -a -r "$LOCATE_CONFIG" ]; then
@@ -35,8 +35,9 @@ fi
# The directory containing locate subprograms
: ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR
-: ${TMPDIR:=/tmp}; export TMPDIR
-if ! TMPDIR=`mktemp -d $TMPDIR/locateXXXXXX`; then
+: ${TMPDIR:=/var/tmp}; export TMPDIR
+if TMPDIR=`mktemp -d $TMPDIR/locateXXXXXX`; then :
+else
exit 1
fi
@@ -73,12 +74,12 @@ case X"$PRUNEPATHS" in
esac
tmp=$TMPDIR/_updatedb$$
-trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15
+trap 'rm -f $tmp' 0 1 2 3 5 10 15
# search locally
# echo $find $SEARCHPATHS $excludes -or -print && exit
-if $find -s $SEARCHPATHS $excludes -or -print 2>/dev/null |
- $mklocatedb -presort > $tmp
+if $find $SEARCHPATHS $excludes -or -print 2>/dev/null |
+ $mklocatedb > $tmp
then
case X"`$find $tmp -size -257c -print`" in
X) cat $tmp > $FCODES;;
@@ -86,4 +87,5 @@ then
exit 1
esac
fi
-echo $?
+rm -f $tmp
+rmdir $TMPDIR
diff --git a/usr.bin/login/Makefile b/usr.bin/login/Makefile
index 5d77ec850464c..71fa73e5f5697 100644
--- a/usr.bin/login/Makefile
+++ b/usr.bin/login/Makefile
@@ -1,21 +1,29 @@
# From: @(#)Makefile 8.1 (Berkeley) 7/19/93
-# $Id: Makefile,v 1.26 1999/01/19 22:59:37 abial Exp $
+# $Id: Makefile,v 1.20 1998/08/06 21:37:04 markm Exp $
PROG= login
MAN1= login.1
MAN5= login.access.5
SRCS= login.c login_access.c login_fbtab.c
-CFLAGS+=-Wall -DLOGIN_ACCESS -DLOGALL
+#Uncomment to activate login_auth
+#Warning: requires src/libexec/login_* auth modules
+#LC_AUTH=-DLOGIN_CAP_AUTH
+CFLAGS+=-Wall -DSKEY -DLOGIN_ACCESS -DLOGALL -DLOGIN_CAP $(LC_AUTH)
-DPADD= ${LIBUTIL} ${LIBCRYPT}
-LDADD= -lutil -lcrypt
+.if defined(KLOGIN_PARANOID)
+CFLAGS+=-DKLOGIN_PARANOID
+.endif
+
+DPADD= ${LIBUTIL} ${LIBSKEY} ${LIBMD} ${LIBCRYPT}
+LDADD= -lutil -lskey -lmd -lcrypt
-.if defined(NOPAM)
-CFLAGS+= -DNO_PAM
-.else
-DPADD+= ${LIBPAM}
-LDADD+= ${MINUSLPAM}
+.if exists(${DESTDIR}${LIBDIR}/libkrb.a) && defined(MAKE_KERBEROS4) && !defined(LC_AUTH)
+CFLAGS+=-DKERBEROS
+SRCS+= klogin.c
+DPADD+= ${LIBKRB} ${LIBDES}
+LDADD+= -lkrb -ldes
+DISTRIBUTION= krb
.endif
BINMODE=4555
diff --git a/usr.bin/login/klogin.c b/usr.bin/login/klogin.c
new file mode 100644
index 0000000000000..7c61b84a9cb7e
--- /dev/null
+++ b/usr.bin/login/klogin.c
@@ -0,0 +1,204 @@
+/*-
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef lint
+static const char sccsid[] = "@(#)klogin.c 8.3 (Berkeley) 4/2/94";
+#endif /* not lint */
+
+#ifdef KERBEROS
+#include <sys/param.h>
+#include <sys/syslog.h>
+#include <des.h>
+#include <krb.h>
+
+#include <err.h>
+#include <netdb.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define INITIAL_TICKET "krbtgt"
+#define VERIFY_SERVICE "rcmd"
+
+extern int notickets;
+extern char *krbtkfile_env;
+
+/*
+ * Attempt to log the user in using Kerberos authentication
+ *
+ * return 0 on success (will be logged in)
+ * 1 if Kerberos failed (try local password in login)
+ */
+int
+klogin(pw, instance, localhost, password)
+ struct passwd *pw;
+ char *instance, *localhost, *password;
+{
+ int kerror;
+ char realm[REALM_SZ], savehost[MAXHOSTNAMELEN];
+ char tkt_location[MAXPATHLEN];
+ char *krb_get_phost();
+ extern int noticketsdontcomplain;
+
+#ifdef KLOGIN_PARANOID
+ AUTH_DAT authdata;
+ KTEXT_ST ticket;
+ struct hostent *hp;
+ unsigned long faddr;
+
+ noticketsdontcomplain = 0; /* enable warning message */
+#endif
+
+ /*
+ * Root logins don't use Kerberos.
+ * If we have a realm, try getting a ticket-granting ticket
+ * and using it to authenticate. Otherwise, return
+ * failure so that we can try the normal passwd file
+ * for a password. If that's ok, log the user in
+ * without issuing any tickets.
+ */
+ if (strcmp(pw->pw_name, "root") == 0 ||
+ krb_get_lrealm(realm, 0) != KSUCCESS)
+ return (1);
+
+ noticketsdontcomplain = 0; /* enable warning message */
+
+ /*
+ * get TGT for local realm
+ * tickets are stored in a file named TKT_ROOT plus uid
+ * except for user.root tickets.
+ */
+
+ if (strcmp(instance, "root") != 0)
+ (void)sprintf(tkt_location, "%s%d", TKT_ROOT, pw->pw_uid);
+ else {
+ (void)sprintf(tkt_location, "%s_root_%d", TKT_ROOT, pw->pw_uid);
+ krbtkfile_env = tkt_location;
+ }
+ (void)krb_set_tkt_string(tkt_location);
+
+ /*
+ * Set real as well as effective ID to 0 for the moment,
+ * to make the kerberos library do the right thing.
+ */
+ if (setuid(0) < 0) {
+ warnx("setuid");
+ return (1);
+ }
+ kerror = krb_get_pw_in_tkt(pw->pw_name, instance,
+ realm, INITIAL_TICKET, realm, DEFAULT_TKT_LIFE, password);
+
+ /*
+ * If we got a TGT, get a local "rcmd" ticket and check it so as to
+ * ensure that we are not talking to a bogus Kerberos server.
+ *
+ * There are 2 cases where we still allow a login:
+ * 1: the VERIFY_SERVICE doesn't exist in the KDC
+ * 2: local host has no srvtab, as (hopefully) indicated by a
+ * return value of RD_AP_UNDEC from krb_rd_req().
+ */
+ if (kerror != INTK_OK) {
+ if (kerror != INTK_BADPW && kerror != KDC_PR_UNKNOWN) {
+ syslog(LOG_ERR, "Kerberos intkt error: %s",
+ krb_err_txt[kerror]);
+ dest_tkt();
+ }
+ return (1);
+ }
+
+ if (chown(TKT_FILE, pw->pw_uid, pw->pw_gid) < 0)
+ syslog(LOG_ERR, "chown tkfile (%s): %m", TKT_FILE);
+
+ (void)strncpy(savehost, krb_get_phost(localhost), sizeof(savehost));
+ savehost[sizeof(savehost)-1] = NULL;
+
+#ifdef KLOGIN_PARANOID
+ /*
+ * if the "VERIFY_SERVICE" doesn't exist in the KDC for this host,
+ * still allow login with tickets, but log the error condition.
+ */
+
+ kerror = krb_mk_req(&ticket, VERIFY_SERVICE, savehost, realm, 33);
+ if (kerror == KDC_PR_UNKNOWN) {
+ syslog(LOG_NOTICE,
+ "warning: TGT not verified (%s); %s.%s not registered, or srvtab is wrong?",
+ krb_err_txt[kerror], VERIFY_SERVICE, savehost);
+ notickets = 0;
+ return (0);
+ }
+
+ if (kerror != KSUCCESS) {
+ warnx("unable to use TGT: (%s)", krb_err_txt[kerror]);
+ syslog(LOG_NOTICE, "unable to use TGT: (%s)",
+ krb_err_txt[kerror]);
+ dest_tkt();
+ return (1);
+ }
+
+ if (!(hp = gethostbyname(localhost))) {
+ syslog(LOG_ERR, "couldn't get local host address");
+ dest_tkt();
+ return (1);
+ }
+
+ memmove((void *)&faddr, (void *)hp->h_addr, sizeof(faddr));
+
+ kerror = krb_rd_req(&ticket, VERIFY_SERVICE, savehost, faddr,
+ &authdata, "");
+
+ if (kerror == KSUCCESS) {
+ notickets = 0;
+ return (0);
+ }
+
+ /* undecipherable: probably didn't have a srvtab on the local host */
+ if (kerror == RD_AP_UNDEC) {
+ syslog(LOG_NOTICE, "krb_rd_req: (%s)\n", krb_err_txt[kerror]);
+ dest_tkt();
+ return (1);
+ }
+ /* failed for some other reason */
+ warnx("unable to verify %s ticket: (%s)", VERIFY_SERVICE,
+ krb_err_txt[kerror]);
+ syslog(LOG_NOTICE, "couldn't verify %s ticket: %s", VERIFY_SERVICE,
+ krb_err_txt[kerror]);
+ dest_tkt();
+ return (1);
+#else
+ notickets = 0;
+ return (0);
+#endif
+}
+#endif
diff --git a/usr.bin/login/login.1 b/usr.bin/login/login.1
index 8c1ef2adb02c3..b373bb1a758c5 100644
--- a/usr.bin/login/login.1
+++ b/usr.bin/login/login.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)login.1 8.2 (Berkeley) 5/5/94
-.\" $Id: login.1,v 1.12 1998/12/01 17:05:08 dillon Exp $
+.\" $Id: login.1,v 1.10 1998/01/07 10:42:57 obrien Exp $
.\"
.Dd May 5, 1994
.Dt LOGIN 1
@@ -81,7 +81,7 @@ option disables this behavior.
.El
.Pp
If the file
-.Pa /var/run/nologin
+.Pa /etc/nologin
exists,
.Nm
displays its contents to the user and exits.
@@ -160,7 +160,7 @@ login access control table
login class capabilities database
.It Pa /etc/motd
message-of-the-day
-.It Pa /var/run/nologin
+.It Pa /etc/nologin
disallows logins
.It Pa /etc/skey.access
skey password control table
@@ -191,8 +191,7 @@ configure authentication services
.Xr skey.access 5 ,
.Xr utmp 5 ,
.Xr environ 7 ,
-.Xr nologin 8 ,
-.Xr pam 8
+.Xr nologin 8
.Sh HISTORY
A
.Nm
diff --git a/usr.bin/login/login.access.5 b/usr.bin/login/login.access.5
index d8630966dd978..fdd1486148559 100644
--- a/usr.bin/login/login.access.5
+++ b/usr.bin/login/login.access.5
@@ -45,7 +45,6 @@ file resides in
.Pa /etc .
.El
.Sh SEE ALSO
-.Xr login 1 ,
-.Xr pam 8
+.Xr login 1
.Sh AUTHORS
.An Guido van Rooij
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c
index 3ee0c749b8b85..fc36cb013a704 100644
--- a/usr.bin/login/login.c
+++ b/usr.bin/login/login.c
@@ -42,7 +42,7 @@ static char copyright[] =
static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
#endif
static const char rcsid[] =
- "$Id: login.c,v 1.44 1999/01/03 23:39:33 eivind Exp $";
+ "$Id: login.c,v 1.38 1998/08/17 03:25:07 jkoshy Exp $";
#endif /* not lint */
/*
@@ -64,7 +64,6 @@ static const char rcsid[] =
#include <errno.h>
#include <grp.h>
#include <libutil.h>
-#include <login_cap.h>
#include <netdb.h>
#include <pwd.h>
#include <setjmp.h>
@@ -77,11 +76,29 @@ static const char rcsid[] =
#include <unistd.h>
#include <utmp.h>
-#ifndef NO_PAM
-#include <security/pam_appl.h>
-#include <security/pam_misc.h>
+#ifdef LOGIN_CAP
+#include <login_cap.h>
+#else /* Undef AUTH as well */
+#undef LOGIN_CAP_AUTH
#endif
+/*
+ * If LOGIN_CAP_AUTH is activated:
+ * kerberose & skey logins are runtime selected via login
+ * login_getstyle() and authentication types for login classes
+ * The actual login itself is handled via /usr/libexec/login_<style>
+ * Valid styles are determined by the auth-type=style,style entries
+ * in the login class.
+ */
+#ifdef LOGIN_CAP_AUTH
+#undef KERBEROS
+#undef SKEY
+#endif /* LOGIN_CAP_AUTH */
+
+#ifdef SKEY
+#include <skey.h>
+#endif /* SKEY */
+
#include "pathnames.h"
void badlogin __P((char *));
@@ -97,12 +114,12 @@ char *stypeof __P((char *));
void timedout __P((int));
int login_access __P((char *, char *));
void login_fbtab __P((char *, uid_t, gid_t));
-
-#ifndef NO_PAM
-static int auth_pam __P((void));
+#ifdef KERBEROS
+int klogin __P((struct passwd *, char *, char *, char *));
#endif
-static int auth_traditional __P((void));
+
extern void login __P((struct utmp *));
+extern void trimdomain __P((char *, int));
static void usage __P((void));
#define TTYGRPNAME "tty" /* name of group to own ttys */
@@ -115,8 +132,13 @@ static void usage __P((void));
*/
u_int timeout = 300;
-/* Buffer for signal handling of timeout */
-jmp_buf timeout_buf;
+#ifdef KERBEROS
+int notickets = 1;
+int noticketsdontcomplain = 1;
+char *instance;
+char *krbtkfile_env;
+int authok;
+#endif
struct passwd *pwd;
int failures;
@@ -138,24 +160,30 @@ main(argc, argv)
int changepass;
time_t warntime;
uid_t uid, euid;
- char *domain, *p, *ttyn;
- char tbuf[MAXPATHLEN + 2];
- char tname[sizeof(_PATH_TTY) + 10];
+ char *domain, *p, *ep, *salt, *ttyn;
+ char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10];
char localhost[MAXHOSTNAMELEN];
char *shell = NULL;
+#ifdef LOGIN_CAP
login_cap_t *lc = NULL;
+#ifdef LOGIN_CAP_AUTH
+ char *style, *authtype;
+ char *auth_method = NULL;
+ char *instance = NULL;
+ int authok;
+#endif /* LOGIN_CAP_AUTH */
+#endif /* LOGIN_CAP */
+#ifdef SKEY
+ int permit_passwd = 0;
+#endif /* SKEY */
+#ifdef KERBEROS
+ char *k;
+#endif
- (void)signal(SIGQUIT, SIG_IGN);
- (void)signal(SIGINT, SIG_IGN);
- if (setjmp(timeout_buf)) {
- if (failures)
- badlogin(tbuf);
- (void)fprintf(stderr,
- "Login timed out after %d seconds\n", timeout);
- exit(0);
- }
(void)signal(SIGALRM, timedout);
(void)alarm(timeout);
+ (void)signal(SIGQUIT, SIG_IGN);
+ (void)signal(SIGINT, SIG_IGN);
(void)setpriority(PRIO_PROCESS, 0, 0);
openlog("login", LOG_ODELAY, LOG_AUTH);
@@ -237,6 +265,10 @@ main(argc, argv)
else
tty = ttyn;
+#ifdef LOGIN_CAP_AUTH
+ authtype = hostname ? "rlogin" : "login";
+#endif
+#ifdef LOGIN_CAP
/*
* Get "login-retries" & "login-backoff" from default class
*/
@@ -245,6 +277,10 @@ main(argc, argv)
backoff = login_getcapnum(lc, "login-backoff", DEFAULT_BACKOFF, DEFAULT_BACKOFF);
login_close(lc);
lc = NULL;
+#else
+ retries = DEFAULT_RETRIES;
+ backoff = DEFAULT_BACKOFF;
+#endif
for (cnt = 0;; ask = 1) {
if (ask) {
@@ -253,6 +289,34 @@ main(argc, argv)
}
rootlogin = 0;
rootok = rootterm(tty); /* Default (auth may change) */
+#ifdef LOGIN_CAP_AUTH
+ authok = 0;
+ if (auth_method = strchr(username, ':')) {
+ *auth_method = '\0';
+ auth_method++;
+ if (*auth_method == '\0')
+ auth_method = NULL;
+ }
+ /*
+ * We need to do this regardless of whether
+ * kerberos is available.
+ */
+ if ((instance = strchr(username, '.')) != NULL) {
+ if (strncmp(instance, ".root", 5) == 0)
+ rootlogin = 1;
+ *instance++ = '\0';
+ } else
+ instance = "";
+#else /* !LOGIN_CAP_AUTH */
+#ifdef KERBEROS
+ if ((instance = strchr(username, '.')) != NULL) {
+ if (strncmp(instance, ".root", 5) == 0)
+ rootlogin = 1;
+ *instance++ = '\0';
+ } else
+ instance = "";
+#endif /* KERBEROS */
+#endif /* LOGIN_CAP_AUTH */
if (strlen(username) > UT_NAMESIZE)
username[UT_NAMESIZE] = '\0';
@@ -265,11 +329,27 @@ main(argc, argv)
if (failures && strcmp(tbuf, username)) {
if (failures > (pwd ? 0 : 1))
badlogin(tbuf);
+ failures = 0;
}
(void)strncpy(tbuf, username, sizeof tbuf-1);
tbuf[sizeof tbuf-1] = '\0';
- pwd = getpwnam(username);
+ if ((pwd = getpwnam(username)) != NULL)
+ salt = pwd->pw_passwd;
+ else
+ salt = "xx";
+
+#ifdef LOGIN_CAP
+ /*
+ * Establish the class now, before we might goto
+ * within the next block. pwd can be NULL since it
+ * falls back to the "default" class if it is.
+ */
+ if (pwd != NULL)
+ (void)seteuid(rootlogin ? 0 : pwd->pw_uid);
+ lc = login_getpwclass(pwd);
+ seteuid(euid);
+#endif /* LOGIN_CAP */
/*
* if we have a valid account name, and it doesn't have a
@@ -277,6 +357,7 @@ main(argc, argv)
* is root or the caller isn't changing their uid, don't
* authenticate.
*/
+ rval = 1;
if (pwd != NULL) {
if (pwd->pw_uid == 0)
rootlogin = 1;
@@ -298,35 +379,139 @@ main(argc, argv)
(void)setpriority(PRIO_PROCESS, 0, -4);
-#ifndef NO_PAM
+#ifdef LOGIN_CAP_AUTH
/*
- * Try to authenticate using PAM. If a PAM system error
- * occurs, perhaps because of a botched configuration,
- * then fall back to using traditional Unix authentication.
+ * This hands off authorization to an authorization program,
+ * depending on the styles available for the "auth-login",
+ * auth-rlogin (or default) authorization styles.
+ * We do this regardless of whether an account exists so that
+ * the remote user cannot tell a "real" from an invented
+ * account name. If we don't have an account we just fall
+ * back to the first method for the "default" class.
*/
- if ((rval = auth_pam()) == -1)
-#endif /* NO_PAM */
- rval = auth_traditional();
+ if (!(style = login_getstyle(lc, auth_method, authtype))) {
+
+ /*
+ * No available authorization method
+ */
+ rval = 1;
+ (void)printf("No auth method available for %s.\n",
+ authtype);
+ } else {
+
+ /*
+ * Put back the kerberos instance, if any was given.
+ * Don't worry about the non-kerberos case here, since
+ * if kerberos is not available or not selected and an
+ * instance is given at the login prompt, su or rlogin -l,
+ * then anything else should fail as well.
+ */
+ if (*instance)
+ *(instance - 1) = '.';
+
+ rval = authenticate(username,
+ lc ? lc->lc_class : "default",
+ style, authtype);
+ /* Junk it again */
+ if (*instance)
+ *(instance - 1) = '\0';
+ }
- (void)setpriority(PRIO_PROCESS, 0, 0);
+ if (!rval) {
+ char * approvep;
+
+ /*
+ * If authentication succeeds, run any approval
+ * program, if applicable for this class.
+ */
+ approvep = login_getcapstr(lc, "approve", NULL, NULL);
+ rval = 1; /* Assume bad login again */
+
+ if (approvep==NULL ||
+ auth_script(approvep, approvep, username,
+ lc->lc_class, 0) == 0) {
+ int r;
+
+ r = auth_scan(AUTH_OKAY);
+ /*
+ * See what the authorize program says
+ */
+ if (r != 0) {
+ rval = 0;
-#ifndef NO_PAM
- /*
- * PAM authentication may have changed "pwd" to the
- * entry for the template user. Check again to see if
- * this is a root login after all.
- */
- if (pwd != NULL && pwd->pw_uid == 0)
- rootlogin = 1;
-#endif /* NO_PAM */
+ if (!rootok && (r & AUTH_ROOTOKAY))
+ rootok = 1; /* root approved */
+ else
+ rootlogin = 0;
+
+ if (!authok && (r & AUTH_SECURE))
+ authok = 1; /* secure */
+ }
+ }
+ }
+#else /* !LOGIN_CAP_AUTH */
+#ifdef SKEY
+ permit_passwd = skeyaccess(username, tty,
+ hostname ? full_hostname : NULL,
+ NULL);
+ p = skey_getpass("Password:", pwd, permit_passwd);
+ ep = skey_crypt(p, salt, pwd, permit_passwd);
+#else /* !SKEY */
+ p = getpass("Password:");
+ ep = crypt(p, salt);
+#endif/* SKEY */
+
+ if (pwd) {
+ if (!p[0] && pwd->pw_passwd[0])
+ ep = ":";
+#ifdef KERBEROS
+#ifdef SKEY
+ /*
+ * Do not allow user to type in kerberos password
+ * over the net (actually, this is ok for encrypted
+ * links, but we have no way of determining if the
+ * link is encrypted.
+ */
+ if (!permit_passwd) {
+ rval = 1; /* failed */
+ } else
+#endif /* SKEY */
+ rval = 1;
+ k = auth_getval("auth_list");
+ if (k && strstr(k, "kerberos"))
+ rval = klogin(pwd, instance, localhost, p);
+ if (rval != 0 && rootlogin && pwd->pw_uid != 0)
+ rootlogin = 0;
+ if (rval == 0)
+ authok = 1; /* kerberos authenticated ok */
+ else if (rval == 1) /* fallback to unix passwd */
+ rval = strcmp(ep, pwd->pw_passwd);
+#else /* !KERBEROS */
+ rval = strcmp(ep, pwd->pw_passwd);
+#endif /* KERBEROS */
+ }
+ /* clear entered password */
+ memset(p, 0, strlen(p));
+#endif /* LOGIN_CAP_AUTH */
+
+ (void)setpriority(PRIO_PROCESS, 0, 0);
+
+#ifdef LOGIN_CAP_AUTH
+ if (rval)
+ auth_rmfiles();
+#endif
ttycheck:
/*
* If trying to log in as root without Kerberos,
* but with insecure terminal, refuse the login attempt.
*/
if (pwd && !rval) {
+#if defined(KERBEROS) || defined(LOGIN_CAP_AUTH)
+ if (authok == 0 && rootlogin && !rootok)
+#else
if (rootlogin && !rootok)
+#endif
refused(NULL, "NOROOT", 0);
else /* valid password & authenticated */
break;
@@ -353,22 +538,26 @@ main(argc, argv)
endpwent();
- /*
- * Establish the login class.
- */
- (void)seteuid(rootlogin ? 0 : pwd->pw_uid);
- lc = login_getpwclass(pwd);
- seteuid(euid);
-
/* if user not super-user, check for disabled logins */
+#ifdef LOGIN_CAP
if (!rootlogin)
auth_checknologin(lc);
+#else
+ if (!rootlogin)
+ checknologin();
+#endif
+#ifdef LOGIN_CAP
quietlog = login_getcapbool(lc, "hushlogin", 0);
+#else
+ quietlog = 0;
+#endif
(void)seteuid(rootlogin ? 0 : pwd->pw_uid);
if (!*pwd->pw_dir || chdir(pwd->pw_dir) < 0) {
+#ifdef LOGIN_CAP
if (login_getcapbool(lc, "requirehome", 0))
refused("Home directory not available", "HOMEDIR", 1);
+#endif
if (chdir("/") < 0)
refused("Cannot find root directory", "ROOTDIR", 1);
pwd->pw_dir = "/";
@@ -384,8 +573,12 @@ main(argc, argv)
#define DEFAULT_WARN (2L * 7L * 86400L) /* Two weeks */
+#ifdef LOGIN_CAP
warntime = login_getcaptime(lc, "warnpassword",
DEFAULT_WARN, DEFAULT_WARN);
+#else
+ warntime = DEFAULT_WARN;
+#endif
changepass=0;
if (pwd->pw_change) {
@@ -400,8 +593,12 @@ main(argc, argv)
ctime(&pwd->pw_change));
}
+#ifdef LOGIN_CAP
warntime = login_getcaptime(lc, "warnexpire",
DEFAULT_WARN, DEFAULT_WARN);
+#else
+ warntime = DEFAULT_WARN;
+#endif
if (pwd->pw_expire) {
if (tp.tv_sec >= pwd->pw_expire) {
@@ -412,6 +609,7 @@ main(argc, argv)
ctime(&pwd->pw_expire));
}
+#ifdef LOGIN_CAP
if (lc != NULL) {
if (hostname) {
struct hostent *hp = gethostbyname(full_hostname);
@@ -434,6 +632,9 @@ main(argc, argv)
refused("Logins not available right now", "TIME", 1);
}
shell=login_getcapstr(lc, "shell", pwd->pw_shell, pwd->pw_shell);
+#else /* !LOGIN_CAP */
+ shell=pwd->pw_shell;
+#endif /* LOGIN_CAP */
if (*pwd->pw_shell == '\0')
pwd->pw_shell = _PATH_BSHELL;
if (*shell == '\0') /* Not overridden */
@@ -483,6 +684,11 @@ main(argc, argv)
if (hostname==NULL && isdialuptty(tty))
syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name);
+#ifdef KERBEROS
+ if (!quietlog && notickets == 1 && !noticketsdontcomplain)
+ (void)printf("Warning: no Kerberos tickets issued.\n");
+#endif
+
#ifdef LOGALL
/*
* Syslog each successful login, so we don't have to watch hundreds
@@ -521,15 +727,19 @@ main(argc, argv)
* We don't need to be root anymore, so
* set the user and session context
*/
- if (setlogin(username) != 0) {
- syslog(LOG_ERR, "setlogin(%s): %m - exiting", username);
- exit(1);
- }
- if (setusercontext(lc, pwd, pwd->pw_uid,
- LOGIN_SETALL & ~LOGIN_SETLOGIN) != 0) {
+#ifdef LOGIN_CAP
+ if (setusercontext(lc, pwd, pwd->pw_uid, LOGIN_SETALL) != 0) {
syslog(LOG_ERR, "setusercontext() failed - exiting");
exit(1);
}
+#else
+ if (setlogin(pwd->pw_name) < 0)
+ syslog(LOG_ERR, "setlogin() failure: %m");
+
+ (void)setgid(pwd->pw_gid);
+ initgroups(username, pwd->pw_gid);
+ (void)setuid(rootlogin ? 0 : pwd->pw_uid);
+#endif
(void)setenv("SHELL", pwd->pw_shell, 1);
(void)setenv("HOME", pwd->pw_dir, 1);
@@ -538,10 +748,18 @@ main(argc, argv)
else {
(void)setenv("TERM", stypeof(tty), 0); /* Fallback doesn't */
}
- (void)setenv("LOGNAME", username, 1);
- (void)setenv("USER", username, 1);
+ (void)setenv("LOGNAME", pwd->pw_name, 1);
+ (void)setenv("USER", pwd->pw_name, 1);
(void)setenv("PATH", rootlogin ? _PATH_STDPATH : _PATH_DEFPATH, 0);
+#ifdef KERBEROS
+ if (krbtkfile_env)
+ (void)setenv("KRBTKFILE", krbtkfile_env, 1);
+#endif
+#if LOGIN_CAP_AUTH
+ auth_env();
+#endif
+#ifdef LOGIN_CAP
if (!quietlog) {
char *cw;
@@ -568,12 +786,24 @@ main(argc, argv)
} else
snprintf(tbuf, sizeof(tbuf), "%s/%s",
_PATH_MAILDIR, pwd->pw_name);
+#else
+ if (!quietlog) {
+ (void)printf("%s\n\t%s %s\n",
+ "Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994",
+ "The Regents of the University of California. ",
+ "All rights reserved.");
+ motd(_PATH_MOTDFILE);
+ snprintf(tbuf, sizeof(tbuf), "%s/%s",
+ _PATH_MAILDIR, pwd->pw_name);
+#endif
if (stat(tbuf, &st) == 0 && st.st_size != 0)
(void)printf("You have %smail.\n",
(st.st_mtime > st.st_atime) ? "new " : "");
}
+#ifdef LOGIN_CAP
login_close(lc);
+#endif
(void)signal(SIGALRM, SIG_DFL);
(void)signal(SIGQUIT, SIG_DFL);
@@ -595,116 +825,6 @@ main(argc, argv)
err(1, "%s", shell);
}
-static int
-auth_traditional()
-{
- int rval;
- char *p;
- char *ep;
- char *salt;
-
- rval = 1;
- salt = pwd != NULL ? pwd->pw_passwd : "xx";
-
- p = getpass("Password:");
- ep = crypt(p, salt);
-
- if (pwd) {
- if (!p[0] && pwd->pw_passwd[0])
- ep = ":";
- if (strcmp(ep, pwd->pw_passwd) == 0)
- rval = 0;
- }
-
- /* clear entered password */
- memset(p, 0, strlen(p));
- return rval;
-}
-
-#ifndef NO_PAM
-/*
- * Attempt to authenticate the user using PAM. Returns 0 if the user is
- * authenticated, or 1 if not authenticated. If some sort of PAM system
- * error occurs (e.g., the "/etc/pam.conf" file is missing) then this
- * function returns -1. This can be used as an indication that we should
- * fall back to a different authentication mechanism.
- */
-static int
-auth_pam()
-{
- pam_handle_t *pamh = NULL;
- const char *tmpl_user;
- const void *item;
- int rval;
- int e;
- static struct pam_conv conv = { misc_conv, NULL };
-
- if ((e = pam_start("login", username, &conv, &pamh)) != PAM_SUCCESS) {
- syslog(LOG_ERR, "pam_start: %s", pam_strerror(pamh, e));
- return -1;
- }
- if ((e = pam_set_item(pamh, PAM_TTY, tty)) != PAM_SUCCESS) {
- syslog(LOG_ERR, "pam_set_item(PAM_TTY): %s",
- pam_strerror(pamh, e));
- return -1;
- }
- if (hostname != NULL &&
- (e = pam_set_item(pamh, PAM_RHOST, full_hostname)) != PAM_SUCCESS) {
- syslog(LOG_ERR, "pam_set_item(PAM_RHOST): %s",
- pam_strerror(pamh, e));
- return -1;
- }
- e = pam_authenticate(pamh, 0);
- switch (e) {
-
- case PAM_SUCCESS:
- /*
- * With PAM we support the concept of a "template"
- * user. The user enters a login name which is
- * authenticated by PAM, usually via a remote service
- * such as RADIUS or TACACS+. If authentication
- * succeeds, a different but related "template" name
- * is used for setting the credentials, shell, and
- * home directory. The name the user enters need only
- * exist on the remote authentication server, but the
- * template name must be present in the local password
- * database.
- *
- * This is supported by two various mechanisms in the
- * individual modules. However, from the application's
- * point of view, the template user is always passed
- * back as a changed value of the PAM_USER item.
- */
- if ((e = pam_get_item(pamh, PAM_USER, &item)) ==
- PAM_SUCCESS) {
- tmpl_user = (const char *) item;
- if (strcmp(username, tmpl_user) != 0)
- pwd = getpwnam(tmpl_user);
- } else
- syslog(LOG_ERR, "Couldn't get PAM_USER: %s",
- pam_strerror(pamh, e));
- rval = 0;
- break;
-
- case PAM_AUTH_ERR:
- case PAM_USER_UNKNOWN:
- case PAM_MAXTRIES:
- rval = 1;
- break;
-
- default:
- syslog(LOG_ERR, "auth_pam: %s", pam_strerror(pamh, e));
- rval = -1;
- break;
- }
- if ((e = pam_end(pamh, e)) != PAM_SUCCESS) {
- syslog(LOG_ERR, "pam_end: %s", pam_strerror(pamh, e));
- rval = -1;
- }
- return rval;
-}
-#endif /* NO_PAM */
-
static void
usage()
{
@@ -789,9 +909,24 @@ void
timedout(signo)
int signo;
{
- longjmp(timeout_buf, signo);
+ (void)fprintf(stderr, "Login timed out after %d seconds\n", timeout);
+ exit(0);
}
+#ifndef LOGIN_CAP
+void
+checknologin()
+{
+ int fd, nchars;
+ char tbuf[8192];
+
+ if ((fd = open(_PATH_NOLOGIN, O_RDONLY, 0)) >= 0) {
+ while ((nchars = read(fd, tbuf, sizeof(tbuf))) > 0)
+ (void)write(fileno(stdout), tbuf, nchars);
+ sleepexit(0);
+ }
+}
+#endif
void
dolastlog(quiet)
@@ -848,7 +983,6 @@ badlogin(name)
"%d LOGIN FAILURE%s ON %s, %s",
failures, failures > 1 ? "S" : "", tty, name);
}
- failures = 0;
}
#undef UNKNOWN
diff --git a/usr.bin/m4/m4.1 b/usr.bin/m4/m4.1
index 30b0c24f205dc..0a29bee8ce8da 100644
--- a/usr.bin/m4/m4.1
+++ b/usr.bin/m4/m4.1
@@ -1,5 +1,5 @@
.\"
-.\" @(#) $Id: m4.1,v 1.6 1998/06/26 14:25:18 rnordier Exp $
+.\" @(#) $Id: m4.1,v 1.5 1998/03/23 07:44:42 charnier Exp $
.\"
.Dd January 26, 1993
.Dt m4 1
@@ -64,7 +64,7 @@ comments are turned off. The maximum length for a comment marker is
five characters.
.It changequote
Defines the quote symbols to be the first and second arguments.
-Note, only the first character of each argument is used. If no arguments are
+The symbols may be up to five characters long. If no arguments are
given it restores the default open and close single quotes.
.It decr
Decrements the argument by 1. The argument must be a valid numeric string.
diff --git a/usr.bin/mail/strings.c b/usr.bin/mail/strings.c
index 2f24f31c80e55..f27b959fd50e2 100644
--- a/usr.bin/mail/strings.c
+++ b/usr.bin/mail/strings.c
@@ -64,8 +64,8 @@ salloc(size)
int index;
s = size;
- s += (sizeof (char *) - 1);
- s &= ~(sizeof (char *) - 1);
+ s += 3;
+ s &= ~03;
index = 0;
for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) {
if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s)
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index aa42d585369fe..d7451fc14daec 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: job.c,v 1.10 1998/08/24 10:15:53 cracauer Exp $
+ * $Id: job.c,v 1.9 1998/06/04 05:48:57 bde Exp $
*/
#ifndef lint
@@ -2423,7 +2423,7 @@ Job_Init(maxproc, maxlocal)
lastNode = NILGNODE;
- if (maxJobs == 1 || beVerbose == 0
+ if (maxJobs == 1
#ifdef REMOTE
|| noMessages
#endif
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 02447e5c42c6e..63dbe1acea14d 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -47,7 +47,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.28 1998/11/14 16:15:04 dg Exp $";
+ "$Id: main.c,v 1.25 1998/07/26 17:06:05 imp Exp $";
#endif /* not lint */
/*-
@@ -133,7 +133,6 @@ Boolean touchFlag; /* -t flag */
Boolean usePipes; /* !-P flag */
Boolean ignoreErrors; /* -i flag */
Boolean beSilent; /* -s flag */
-Boolean beVerbose; /* -v flag */
Boolean oldVars; /* variable substitution style */
Boolean checkEnvFirst; /* -e flag */
static Boolean jobsRunning; /* TRUE if the jobs might be running */
@@ -172,9 +171,9 @@ MainParseArgs(argc, argv)
optind = 1; /* since we're called more than once */
#ifdef REMOTE
-# define OPTFLAGS "BD:I:L:PSV:d:ef:ij:km:nqrstv"
+# define OPTFLAGS "BD:I:L:PSV:d:ef:ij:km:nqrst"
#else
-# define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrstv"
+# define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrst"
#endif
rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
switch(c) {
@@ -321,10 +320,6 @@ rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
touchFlag = TRUE;
Var_Append(MAKEFLAGS, "-t", VAR_GLOBAL);
break;
- case 'v':
- beVerbose = TRUE;
- Var_Append(MAKEFLAGS, "-v", VAR_GLOBAL);
- break;
default:
case '?':
usage();
@@ -439,12 +434,8 @@ main(argc, argv)
{
Lst targs; /* target nodes to create -- passed to Make_Init */
Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
- struct stat sa;
- char *p, *p1, *path, *pathp;
-#ifdef WANT_ENV_PWD
- struct stat sb;
- char *pwd;
-#endif
+ struct stat sb, sa;
+ char *p, *p1, *path, *pathp, *pwd;
char mdpath[MAXPATHLEN + 1];
char obpath[MAXPATHLEN + 1];
char cdpath[MAXPATHLEN + 1];
@@ -479,13 +470,11 @@ main(argc, argv)
if (stat(curdir, &sa) == -1)
err(2, "%s", curdir);
-#ifdef WANT_ENV_PWD
if ((pwd = getenv("PWD")) != NULL) {
if (stat(pwd, &sb) == 0 && sa.st_ino == sb.st_ino &&
sa.st_dev == sb.st_dev)
(void) strcpy(curdir, pwd);
}
-#endif
#if defined(__i386__)
/*
@@ -569,9 +558,7 @@ main(argc, argv)
objdir = curdir;
}
-#ifdef WANT_ENV_PWD
setenv("PWD", objdir, 1);
-#endif
create = Lst_Init(FALSE);
makefiles = Lst_Init(FALSE);
@@ -1273,7 +1260,7 @@ static void
usage()
{
(void)fprintf(stderr, "%s\n%s\n%s\n",
-"usage: make [-Beiknqrstv] [-D variable] [-d flags] [-f makefile]",
+"usage: make [-Beiknqrst] [-D variable] [-d flags] [-f makefile ]",
" [-I directory] [-j max_jobs] [-m directory] [-V variable]",
" [variable=value] [target ...]");
exit(2);
diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1
index e4f86fba1dbb6..89a1e3fec902c 100644
--- a/usr.bin/make/make.1
+++ b/usr.bin/make/make.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
-.\" $Id: make.1,v 1.15 1998/11/15 05:51:55 bde Exp $
+.\" $Id: make.1,v 1.11 1997/07/24 06:58:07 charnier Exp $
.\"
.Dd March 19, 1994
.Dt MAKE 1
@@ -40,7 +40,7 @@
.Nd maintain program dependencies
.Sh SYNOPSIS
.Nm make
-.Op Fl Beiknqrstv
+.Op Fl Beiknqrst
.Op Fl D Ar variable
.Op Fl d Ar flags
.Op Fl f Ar makefile
@@ -57,17 +57,15 @@
is a program designed to simplify the maintenance of other programs.
Its input is a list of specifications as to the files upon which programs
and other files depend.
-.Nm Make
-searches a built-in path for this list.
If the file
.Ql Pa makefile
-exists along this path, it is read for this list of specifications.
+exists, it is read for this list of specifications.
If it does not exist, the file
.Ql Pa Makefile
-is used.
+is read.
If the file
.Ql Pa .depend
-exists, it is also read (see
+exists, it is read (see
.Xr mkdep 1) .
.Pp
This manual page is intended as a reference document only.
@@ -185,9 +183,6 @@ Do not build any targets.
Multiple instances of this option may be specified;
the variables will be printed one per line,
with a blank line for each null or undefined variable.
-.It Fl v
-Be extra verbose.
-For multi-job makes, this will cause file banners to be generated.
.It Ar variable=value
Set the value of the variable
.Ar variable
@@ -433,8 +428,7 @@ entered into the environment for all programs which
.Nm make
executes.
.It Ev PWD
-Alternate path to the current directory. Supported if built with WANT_ENV_PWD
-defined.
+Alternate path to the current directory.
.Nm make
normally sets
.Ql Va .CURDIR
@@ -940,33 +934,6 @@ command in the file.
Each source specifies a suffix to
.Nm make .
If no sources are specified, any previous specified suffices are deleted.
-.Sh SEARCH PATH
-.Nm Make
-searches for
-.Ql Pa Makefile
-in the following directories, in order:
-.Pp
-.Bl -enum -compact
-.It
-${MAKEOBJDIRPREFIX}`cwd`
-.It
-${MAKEOBJDIR}
-.It
-obj.${MACHINE}
-.It
-obj
-.It
-/usr/obj${MACHINE}`cwd`
-.It
-The current directory (`cwd`).
-.El
-.Pp
-If
-.Nm make
-finds the
-.Ql Pa Makefile
-someplace other than the current working directory, it adds the CWD to
-the search path.
.Sh ENVIRONMENT
.Nm Make
utilizes the following environment variables, if they exist:
@@ -985,16 +952,12 @@ list of dependencies
list of dependencies
.It makefile
list of dependencies
-.It obj
-object directory
.It sys.mk
system makefile
.It /usr/share/mk
system makefile directory
.It /usr/share/doc/psd/12.make
PMake tutorial
-.It /usr/obj
-system object directory prefix
.El
.Sh SEE ALSO
.Xr mkdep 1
diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h
index 52d01db9f60da..91e2d3aed7e8a 100644
--- a/usr.bin/make/make.h
+++ b/usr.bin/make/make.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)make.h 8.3 (Berkeley) 6/13/95
- * $Id: make.h,v 1.7 1997/02/22 19:27:16 peter Exp $
+ * $Id$
*/
/*-
@@ -294,7 +294,6 @@ extern Lst dirSearchPath; /* The list of directories to search when
extern Boolean compatMake; /* True if we are make compatible */
extern Boolean ignoreErrors; /* True if should ignore all errors */
extern Boolean beSilent; /* True if should print no commands */
-extern Boolean beVerbose; /* True if should print extra cruft */
extern Boolean noExecute; /* True if should execute nothing */
extern Boolean allPrecious; /* True if every target is precious */
extern Boolean keepgoing; /* True if should continue on unaffected
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index fda738a8a6a9f..388fa07d4963a 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -41,7 +41,7 @@
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
- "$Id: parse.c,v 1.19 1998/05/25 03:28:37 steve Exp $";
+ "$Id: parse.c,v 1.18 1997/07/24 06:58:08 charnier Exp $";
#endif /* not lint */
/*-
@@ -1412,10 +1412,8 @@ Parse_DoVar (line, ctxt)
default:
#ifdef SUNSHCMD
while (*opc != ':')
- if (opc == line)
+ if (--opc < line)
break;
- else
- --opc;
if (strncmp(opc, ":sh", 3) == 0) {
type = VAR_SHELL;
diff --git a/usr.bin/mklocale/data/Makefile b/usr.bin/mklocale/data/Makefile
index 5e9075d3204b2..e2481e485cf53 100644
--- a/usr.bin/mklocale/data/Makefile
+++ b/usr.bin/mklocale/data/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.16 1998/08/15 12:51:48 phk Exp $
+# $Id: Makefile,v 1.15 1998/08/10 09:49:42 phk Exp $
NOMAN=YES
CLEANFILES+= ${LOCALES:S/$/.out/g}
@@ -9,7 +9,6 @@ LOCALES= ja_JP.EUC \
lt_LN.ASCII \
lt_LN.ISO_8859-1 \
lt_LN.ISO_8859-2 \
- lt_LN.DIS_8859-15 \
ru_SU.CP866 \
ru_SU.KOI8-R \
zh_CN.EUC \
@@ -43,10 +42,6 @@ afterinstall:
ln -fs ../lt_LN.ISO_8859-1/LC_CTYPE \
${LOCALEDIR}/${link}.ISO_8859-1/LC_CTYPE
.endfor
-.for link in ${LATIN1LINKS}
- ln -fs ../lt_LN.DIS_8859-15/LC_CTYPE \
- ${LOCALEDIR}/${link}.DIS_8859-15/LC_CTYPE
-.endfor
.for link in ${LATIN2LINKS}
ln -fs ../lt_LN.ISO_8859-2/LC_CTYPE \
${LOCALEDIR}/${link}.ISO_8859-2/LC_CTYPE
diff --git a/usr.bin/mklocale/data/lt_LN.DIS_8859-15.src b/usr.bin/mklocale/data/lt_LN.DIS_8859-15.src
deleted file mode 100644
index 7d89e03673b9f..0000000000000
--- a/usr.bin/mklocale/data/lt_LN.DIS_8859-15.src
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Standard LOCALE_CTYPE for the dis_8859_15 Locale
- */
-ENCODING "NONE"
-VARIABLE DIS 8859-15 Latin-9 character set
-
-#
-# This is a comment
-#
-ALPHA 'A' - 'Z' 'a' - 'z' 0xa6 0xa8 0xb4 0xb8 0xbc - 0xbe 0xc0 - 0xd6 0xd8 - 0xf6 0xf8 - 0xff
-CONTROL 0x00 - 0x1f 0x7f - 0x9f
-DIGIT '0' - '9'
-GRAPH 0x21 - 0x7e 0xa1 - 0xff
-LOWER 'a' - 'z' 0xa8 0xb8 0xbd 0xdf - 0xf6 0xf8 - 0xff
-PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e 0xa1 - 0xa5 0xa7 0xa9 - 0xb3 0xb5 - 0xb7 0xb9 - 0xbb 0xbf 0xd7 0xf7
-SPACE 0x09 - 0x0d ' ' 0xa0
-UPPER 'A' - 'Z' 0xa6 0xb4 0xbc 0xc0 - 0xd6 0xd8 - 0xde
-XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F'
-BLANK ' ' '\t' 0xa0
-PRINT 0x20 - 0x7e 0xa0 - 0xff
-# IDEOGRAM
-# SPECIAL
-# PHONEGRAM
-
-MAPLOWER <'A' - 'Z' : 'a'>
-MAPLOWER <'a' - 'z' : 'a'>
-MAPLOWER <0xa6 - 0xa6 : 0xa8>
-MAPLOWER <0xb4 - 0xb4 : 0xb8>
-MAPLOWER <0xbc - 0xbc : 0xbd>
-MAPLOWER <0xbe - 0xbe : 0xff>
-MAPLOWER <0xc0 - 0xd6 : 0xe0>
-MAPLOWER <0xd8 - 0xde : 0xf8>
-MAPLOWER <0xdf - 0xf6 : 0xdf>
-MAPLOWER <0xf8 - 0xff : 0xf8>
-MAPUPPER <'A' - 'Z' : 'A'>
-MAPUPPER <'a' - 'z' : 'A'>
-MAPUPPER <0xa8 - 0xa8 : 0xa6>
-MAPUPPER <0xb8 - 0xb8 : 0xb4>
-MAPUPPER <0xbd - 0xbd : 0xbc>
-MAPUPPER <0xc0 - 0xd6 : 0xc0>
-MAPUPPER <0xd8 - 0xde : 0xd8>
-MAPUPPER <0xe0 - 0xf6 : 0xc0>
-MAPUPPER <0xf8 - 0xfe : 0xd8>
-MAPUPPER <0xff - 0xff : 0xbe>
-TODIGIT <'0' - '9' : 0>
-TODIGIT <'A' - 'F' : 10>
-TODIGIT <'a' - 'f' : 10>
diff --git a/usr.bin/mt/mt.c b/usr.bin/mt/mt.c
index 7f27b7fce8669..230ab1c355a55 100644
--- a/usr.bin/mt/mt.c
+++ b/usr.bin/mt/mt.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
- "$Id: mt.c,v 1.19 1998/12/19 20:23:37 mjacob Exp $";
+ "$Id: mt.c,v 1.15 1998/09/15 10:28:20 gibbs Exp $";
#endif /* not lint */
/*
@@ -101,28 +101,15 @@ struct commands {
{ "rewind", MTREW, 1 },
{ "rewoffl", MTOFFL, 1 },
{ "status", MTNOP, 1 },
-#if defined(__FreeBSD__)
- { "weof", MTWEOF, 0, ZERO_ALLOWED },
-#else
{ "weof", MTWEOF, 0 },
-#endif
#if defined(__FreeBSD__)
{ "erase", MTERASE, 0, ZERO_ALLOWED},
{ "blocksize", MTSETBSIZ, 0, NEED_2ARGS|ZERO_ALLOWED },
{ "density", MTSETDNSTY, 0, NEED_2ARGS|ZERO_ALLOWED|IS_DENSITY },
{ "eom", MTEOD, 1 },
{ "eod", MTEOD, 1 },
- { "smk", MTWSS, 0 },
- { "wss", MTWSS, 0 },
- { "fss", MTFSS, 1 },
- { "bss", MTBSS, 1 },
{ "comp", MTCOMP, 0, NEED_2ARGS|ZERO_ALLOWED|IS_COMP },
{ "retension", MTRETENS, 1 },
- { "rdhpos", MTIOCRDHPOS, 0 },
- { "rdspos", MTIOCRDSPOS, 0 },
- { "sethpos", MTIOCHLOCATE, 0, NEED_2ARGS|ZERO_ALLOWED },
- { "setspos", MTIOCSLOCATE, 0, NEED_2ARGS|ZERO_ALLOWED },
- { "errstat", MTIOCERRSTAT, 0 },
#endif /* defined(__FreeBSD__) */
{ NULL }
};
@@ -191,7 +178,7 @@ main(argc, argv)
if (*argv) {
#if defined (__FreeBSD__)
if (!isdigit(**argv) &&
- (comp->c_flags & IS_DENSITY)) {
+ comp->c_flags & IS_DENSITY) {
const char *dcanon;
mt_com.mt_count = stringtodens(*argv);
if (mt_com.mt_count == 0)
@@ -203,7 +190,7 @@ main(argc, argv)
*argv, dcanon);
p = "";
} else if (!isdigit(**argv) &&
- (comp->c_flags & IS_COMP)) {
+ comp->c_flags & IS_COMP) {
mt_com.mt_count = stringtocomp(*argv);
if ((u_int32_t)mt_com.mt_count == 0xf0f0f0f0)
@@ -216,83 +203,18 @@ main(argc, argv)
#else
mt_com.mt_count = strtol(*argv, &p, 10);
#endif /* defined(__FreeBSD__) */
- if ((mt_com.mt_count <=
+ if (mt_com.mt_count <=
#if defined (__FreeBSD__)
((comp->c_flags & ZERO_ALLOWED)? -1: 0)
&& ((comp->c_flags & IS_COMP) == 0)
#else
0
#endif /* defined (__FreeBSD__) */
- ) || *p)
+ || *p)
errx(1, "%s: illegal count", *argv);
}
else
mt_com.mt_count = 1;
-#if defined(__FreeBSD__)
- switch (comp->c_code) {
- case MTIOCERRSTAT:
- {
- int i;
- union mterrstat umn;
- struct scsi_tape_errors *s = &umn.scsi_errstat;
-
- if (ioctl(mtfd, comp->c_code, (caddr_t)&umn) < 0)
- err(2, "%s", tape);
- (void)printf("Last I/O Residual: %u\n", s->io_resid);
- (void)printf(" Last I/O Command:");
- for (i = 0; i < sizeof (s->io_cdb); i++)
- (void)printf(" %02X", s->io_cdb[i]);
- (void)printf("\n");
- (void)printf(" Last I/O Sense:\n\n\t");
- for (i = 0; i < sizeof (s->io_sense); i++) {
- (void)printf(" %02X", s->io_sense[i]);
- if (((i + 1) & 0xf) == 0) {
- (void)printf("\n\t");
- }
- }
- (void)printf("\n");
- (void)printf("Last Control Residual: %u\n",
- s->ctl_resid);
- (void)printf(" Last Control Command:");
- for (i = 0; i < sizeof (s->ctl_cdb); i++)
- (void)printf(" %02X", s->ctl_cdb[i]);
- (void)printf("\n");
- (void)printf(" Last Control Sense:\n\n\t");
- for (i = 0; i < sizeof (s->ctl_sense); i++) {
- (void)printf(" %02X", s->ctl_sense[i]);
- if (((i + 1) & 0xf) == 0) {
- (void)printf("\n\t");
- }
- }
- (void)printf("\n\n");
- exit(0);
- /* NOTREACHED */
- }
- case MTIOCRDHPOS:
- case MTIOCRDSPOS:
- {
- u_int32_t block;
- if (ioctl(mtfd, comp->c_code, (caddr_t)&block) < 0)
- err(2, "%s", tape);
- (void)printf("%s: %s block location %u\n", tape,
- (comp->c_code == MTIOCRDHPOS)? "hardware" :
- "logical", block);
- exit(0);
- /* NOTREACHED */
- }
- case MTIOCSLOCATE:
- case MTIOCHLOCATE:
- {
- u_int32_t block = (u_int32_t)mt_com.mt_count;
- if (ioctl(mtfd, comp->c_code, (caddr_t)&block) < 0)
- err(2, "%s", tape);
- exit(0);
- /* NOTREACHED */
- }
- default:
- break;
- }
-#endif
if (ioctl(mtfd, MTIOCTOP, &mt_com) < 0)
err(1, "%s: %s", tape, comp->c_name);
} else {
@@ -300,7 +222,7 @@ main(argc, argv)
err(1, NULL);
status(&mt_status);
}
- exit(0);
+ exit (0);
/* NOTREACHED */
}
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 6680d0785fff7..fd0c5bdb7d527 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -42,7 +42,7 @@ char const copyright[] =
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.22 1998/08/08 08:13:04 phk Exp $";
+ "$Id: main.c,v 1.21 1998/08/05 13:54:07 phk Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -105,21 +105,23 @@ static struct nlist nl[] = {
{ "_nfile" },
#define N_FILE 18
{ "_file" },
-#define N_MRTSTAT 19
+#define N_MRTPROTO 19
+ { "_ip_mrtproto" },
+#define N_MRTSTAT 20
{ "_mrtstat" },
-#define N_MFCTABLE 20
+#define N_MFCTABLE 21
{ "_mfctable" },
-#define N_VIFTABLE 21
+#define N_VIFTABLE 22
{ "_viftable" },
-#define N_IPX 22
+#define N_IPX 23
{ "_ipxpcb"},
-#define N_IPXSTAT 23
+#define N_IPXSTAT 24
{ "_ipxstat"},
-#define N_SPXSTAT 24
+#define N_SPXSTAT 25
{ "_spx_istat"},
-#define N_DDPSTAT 25
+#define N_DDPSTAT 26
{ "_ddpstat"},
-#define N_DDPCB 26
+#define N_DDPCB 27
{ "_ddpcb"},
{ "" },
};
@@ -388,9 +390,11 @@ main(argc, argv)
if (gflag) {
kread(0, 0, 0);
if (sflag)
- mrt_stats(nl[N_MRTSTAT].n_value);
+ mrt_stats(nl[N_MRTPROTO].n_value,
+ nl[N_MRTSTAT].n_value);
else
- mroutepr(nl[N_MFCTABLE].n_value,
+ mroutepr(nl[N_MRTPROTO].n_value,
+ nl[N_MFCTABLE].n_value,
nl[N_VIFTABLE].n_value);
exit(0);
}
diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c
index 76e001fdc827f..c1324969ce793 100644
--- a/usr.bin/netstat/mbuf.c
+++ b/usr.bin/netstat/mbuf.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mbuf.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: mbuf.c,v 1.14 1998/08/23 15:23:11 gpalmer Exp $";
+ "$Id: mbuf.c,v 1.13 1998/08/18 13:36:47 jb Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -68,9 +68,7 @@ static struct mbtypes {
#ifdef MT_PCB
{ MT_PCB, "protocol control blocks" }, /* XXX */
#endif
-#ifdef MT_RTABLE
{ MT_RTABLE, "routing table entries" }, /* XXX */
-#endif
#ifdef MT_HTABLE
{ MT_HTABLE, "IMP host table entries" }, /* XXX */
#endif
diff --git a/usr.bin/netstat/mroute.c b/usr.bin/netstat/mroute.c
index 4110d00ec31ac..e725d5d155a01 100644
--- a/usr.bin/netstat/mroute.c
+++ b/usr.bin/netstat/mroute.c
@@ -62,13 +62,14 @@
#include "netstat.h"
void
-mroutepr(mfcaddr, vifaddr)
- u_long mfcaddr, vifaddr;
+mroutepr(mrpaddr, mfcaddr, vifaddr)
+ u_long mrpaddr, mfcaddr, vifaddr;
{
u_int mrtproto;
- struct mfc *mfctable[MFCTBLSIZ];
+ struct mbuf *mfctable[MFCTBLSIZ];
struct vif viftable[MAXVIFS];
- struct mfc mfc, *m;
+ struct mbuf mb, *m;
+ struct mfc smfc;
register struct vif *v;
register vifi_t vifi;
register int i;
@@ -76,8 +77,32 @@ mroutepr(mfcaddr, vifaddr)
register int saved_nflag;
vifi_t maxvif = 0;
- if (mfcaddr == 0 || vifaddr == 0) {
- printf("No multicast routing compiled into this system.\n");
+ if (mrpaddr == 0) {
+ printf("ip_mrtproto: symbol not in namelist\n");
+ return;
+ }
+
+ kread(mrpaddr, (char *)&mrtproto, sizeof(mrtproto));
+ switch (mrtproto) {
+
+ case 0:
+ printf("no multicast routing compiled into this system\n");
+ return;
+
+ case IGMP_DVMRP:
+ break;
+
+ default:
+ printf("multicast routing protocol %u, unknown\n", mrtproto);
+ return;
+ }
+
+ if (mfcaddr == 0) {
+ printf("mfctable: symbol not in namelist\n");
+ return;
+ }
+ if (vifaddr == 0) {
+ printf("viftable: symbol not in namelist\n");
return;
}
@@ -99,8 +124,7 @@ mroutepr(mfcaddr, vifaddr)
}
printf(" %2u %6u %4d %-15.15s",
- /* opposite math of add_vif() */
- vifi, v->v_threshold, v->v_rate_limit * 1000 / 1024,
+ vifi, v->v_threshold, v->v_rate_limit,
routename(v->v_lcl_addr.s_addr));
printf(" %-15.15s", (v->v_flags & VIFF_TUNNEL) ?
routename(v->v_rmt_addr.s_addr) : "");
@@ -115,7 +139,8 @@ mroutepr(mfcaddr, vifaddr)
for (i = 0; i < MFCTBLSIZ; ++i) {
m = mfctable[i];
while(m) {
- kread((u_long)m, (char *)&mfc, sizeof mfc);
+ kread((u_long)m, (char *)&mb, sizeof mb);
+ m = &mb;
if (!banner_printed) {
printf("\nMulticast Forwarding Cache\n"
@@ -124,17 +149,19 @@ mroutepr(mfcaddr, vifaddr)
banner_printed = 1;
}
- printf(" %-15.15s", routename(mfc.mfc_origin.s_addr));
- printf(" %-15.15s", routename(mfc.mfc_mcastgrp.s_addr));
- printf(" %9lu", mfc.mfc_pkt_cnt);
- printf(" %3d ", mfc.mfc_parent);
+ kread((u_long)mtod(m, char *),
+ (char *)&smfc, sizeof smfc);
+ printf(" %-15.15s", routename(smfc.mfc_origin.s_addr));
+ printf(" %-15.15s", routename(smfc.mfc_mcastgrp.s_addr));
+ printf(" %9lu", smfc.mfc_pkt_cnt);
+ printf(" %3d ", smfc.mfc_parent);
for (vifi = 0; vifi <= maxvif; vifi++) {
- if (mfc.mfc_ttls[vifi] > 0)
+ if (smfc.mfc_ttls[vifi] > 0)
printf(" %u:%u", vifi,
- mfc.mfc_ttls[vifi]);
+ smfc.mfc_ttls[vifi]);
}
printf("\n");
- m = mfc.mfc_next;
+ m = m->m_act;
}
}
if (!banner_printed)
@@ -146,13 +173,33 @@ mroutepr(mfcaddr, vifaddr)
void
-mrt_stats(mstaddr)
- u_long mstaddr;
+mrt_stats(mrpaddr, mstaddr)
+ u_long mrpaddr, mstaddr;
{
+ u_int mrtproto;
struct mrtstat mrtstat;
+ if(mrpaddr == 0) {
+ printf("ip_mrtproto: symbol not in namelist\n");
+ return;
+ }
+
+ kread(mrpaddr, (char *)&mrtproto, sizeof(mrtproto));
+ switch (mrtproto) {
+ case 0:
+ printf("no multicast routing compiled into this system\n");
+ return;
+
+ case IGMP_DVMRP:
+ break;
+
+ default:
+ printf("multicast routing protocol %u, unknown\n", mrtproto);
+ return;
+ }
+
if (mstaddr == 0) {
- printf("No multicast routing compiled into this system.\n");
+ printf("mrtstat: symbol not in namelist\n");
return;
}
diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h
index 92f0ac7d4657d..2c0c458a0ff1c 100644
--- a/usr.bin/netstat/netstat.h
+++ b/usr.bin/netstat/netstat.h
@@ -117,6 +117,6 @@ void tp_protopr __P((u_long, char *));
void tp_inproto __P((u_long));
void tp_stats __P((caddr_t, caddr_t));
-void mroutepr __P((u_long, u_long));
-void mrt_stats __P((u_long));
+void mroutepr __P((u_long, u_long, u_long));
+void mrt_stats __P((u_long, u_long));
diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c
index 3ba45c9cc0c03..b5533fe957cf8 100644
--- a/usr.bin/nfsstat/nfsstat.c
+++ b/usr.bin/nfsstat/nfsstat.c
@@ -45,7 +45,7 @@ static char copyright[] =
static char sccsid[] = "@(#)nfsstat.c 8.2 (Berkeley) 3/31/95";
#endif
static const char rcsid[] =
- "$Id: nfsstat.c,v 1.11 1998/10/24 19:36:52 msmith Exp $";
+ "$Id: nfsstat.c,v 1.9 1997/03/29 04:31:23 imp Exp $";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/objformat/Makefile b/usr.bin/objformat/Makefile
index a56fdd4f8b8c3..1f28d3b5201c6 100644
--- a/usr.bin/objformat/Makefile
+++ b/usr.bin/objformat/Makefile
@@ -1,8 +1,14 @@
# $FreeBSD$
PROG= objformat
-CFLAGS+= -Wall
-NOSHARED?= YES
+NOMAN= not yet
+CFLAGS+= -DMAIN
+
+.if ${OBJFORMAT} == elf
+CFLAGS+= -DFREEBSD_ELF
+.else
+CFLAGS+= -DFREEBSD_AOUT
+.endif
LINKS+= ${BINDIR}/objformat ${BINDIR}/addr2line
LINKS+= ${BINDIR}/objformat ${BINDIR}/ar
diff --git a/usr.bin/objformat/objformat.1 b/usr.bin/objformat/objformat.1
deleted file mode 100644
index fe924450f026e..0000000000000
--- a/usr.bin/objformat/objformat.1
+++ /dev/null
@@ -1,94 +0,0 @@
-.\"
-.\" Copyright (c) 1998 David E. O'Brien
-.\"
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
-.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
-.\" $Id: kzip.8,v 1.5 1998/03/23 07:44:18 charnier Exp $
-.\"
-.Dd October 25, 1998
-.Os
-.Dt OBJFORMAT 1
-.Sh NAME
-.Nm objformat
-.Nd reports default binary format and program deflector
-.Sh SYNOPSIS
-.Nm objformat
-.Nm prog
-.Sh DESCRIPTION
-If run as
-.Nm
-the default object file format is reported. The two different object file
-formats are
-.Ar a.out
-and
-.Ar ELF .
-.Pp
-If invoked by any other name,
-.Nm prog
-is expanded to
-.Pa /usr/libexec/<objformat>/prog
-and executed.
-.Sh DIAGNOSTICS
-The
-.Nm
-utility returns with exit code 1
-if called with an improper number of arguments, or if
-.Nm prog
-could not be executed.
-.Sh ENVIRONMENT
-.Bl -tag -width OBJFORMAT_PATH
-.It Ev OBJFORMAT
-If the environment variable
-.Ev OBJFORMAT
-is set, it overrides the default object file format.
-.Ev OBJFORMAT takes precedence over
-.Pa /etc/objformat .
-.It Ev OBJFORMAT_PATH
-If the environment variable
-.Ev OBJFORMAT_PATH
-is set, its value is used as the base path to
-.Nm prog .
-The default is
-.Pa /usr/libexec .
-.El
-.Sh FILES
-.Bl -tag -width /etc/objformat -compact
-.It Pa /etc/objformat
-If present, specifies the object file format to use. Syntax is
-.Ql OBJFORMAT=xxx .
-.Sh SEE ALSO
-.Xr file 1 ,
-.Xr getobjformat 3
-.\" .Sh STANDARDS
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Fx 3.0 .
-.Sh AUTHORS
-.Nm
-was written by
-.An Peter Wemm Aq peter@netplex.com.au .
-This manual page was written by
-.An David O'Brien Aq obrien@NUXI.com .
-.\" .Sh BUGS
diff --git a/usr.bin/objformat/objformat.c b/usr.bin/objformat/objformat.c
index 8d75f5ea64ae1..827af6eda1e9a 100644
--- a/usr.bin/objformat/objformat.c
+++ b/usr.bin/objformat/objformat.c
@@ -26,36 +26,112 @@
* $FreeBSD$
*/
-#include <err.h>
-#include <objformat.h>
+#include <sys/types.h>
+
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
+#include <string.h>
+
+#ifdef FREEBSD_ELF
+int objformat_aout = 0;
+#else
+int objformat_aout = 1;
+#endif
+void
+getobjfmt(void)
+{
+ char *env;
+ int i;
+
+ /* first hint is /etc/objformat */
+ FILE *fp = fopen("/etc/objformat", "r");
+ if (fp) {
+ char buf[1024];
+ buf[1023] = '\0';
+ while (fgets(buf, sizeof(buf) - 1, fp) != NULL) {
+ i = strlen(buf);
+ if (buf[i - 1] == '\n')
+ buf[i - 1] = '\0';
+ if (strcmp(buf, "OBJFORMAT=aout") == 0)
+ objformat_aout = 1;
+ else if (strcmp(buf, "OBJFORMAT=elf") == 0)
+ objformat_aout = 0;
+ else
+ fprintf(stderr, "Unrecognized line in /etc/objformat: %s\n", buf);
+ }
+ fclose(fp);
+ }
+ /* but the user $OBJFORMAT overrides system default */
+ env = getenv("OBJFORMAT");
+ if (env) {
+ if (strcmp(env, "aout") == 0)
+ objformat_aout = 1;
+ else if (strcmp(env, "elf") == 0)
+ objformat_aout = 0;
+ else
+ fprintf(stderr, "Unrecognized value of $OBJFORMAT: %s\n", env);
+ }
+}
+
+void
+scanargv(int *argc, char **argv, int strip)
+{
+ int i, j;
+
+ for (i = 1; i < *argc; i++) {
+ if (strcmp (argv[i], "-aout") == 0) {
+ objformat_aout = 1;
+ continue;
+ } else if (strcmp (argv[i], "-elf") == 0) {
+ objformat_aout = 0;
+ continue;
+ }
+ }
+
+ /* if just looking, return now */
+ if (!strip)
+ return;
+
+ /* otherwise, remove all traces of switches from argv */
+ for (i = 1; i < *argc; i++) {
+ if (strcmp (argv[i], "-aout") == 0 ||
+ strcmp (argv[i], "-elf") == 0) {
+ /* copy NULL at end of argv as well */
+ for (j = i + 1; j <= *argc; j++) {
+ argv[j - 1] = argv[j];
+ }
+ (*argc)--;
+ }
+ }
+}
+
+
+#ifdef MAIN
int
main(int argc, char **argv)
{
- char objformat[32];
char *path, *chunk;
+ char *postfix;
char *cmd, *newcmd = NULL;
char *objformat_path;
-
- if (getobjformat(objformat, sizeof objformat, &argc, argv) == -1)
- errx(1, "Invalid object format");
+ int i;
cmd = strrchr(argv[0], '/');
- if (cmd != NULL)
+ if (cmd)
cmd++;
else
cmd = argv[0];
+ getobjfmt();
+ scanargv(&argc, argv, 1);
+
if (strcmp(cmd, "objformat") == 0) {
- if (argc != 1) {
- fprintf(stderr, "Usage: objformat\n");
- exit(1);
- }
- printf("%s\n", objformat);
+ if (objformat_aout)
+ printf("aout\n");
+ else
+ printf("elf\n");
exit(0);
}
@@ -65,19 +141,35 @@ main(int argc, char **argv)
objformat_path = "/usr/libexec";
path = strdup(objformat_path);
- setenv("OBJFORMAT", objformat, 1);
+ if (objformat_aout) {
+ putenv("OBJFORMAT=aout");
+ postfix = "aout";
+ } else {
+ putenv("OBJFORMAT=elf");
+ postfix = "elf";
+ }
while ((chunk = strsep(&path, ":")) != NULL) {
if (newcmd != NULL) {
free(newcmd);
newcmd = NULL;
}
- asprintf(&newcmd, "%s/%s/%s", chunk, objformat, cmd);
+ asprintf(&newcmd, "%s/%s/%s", chunk, postfix, cmd);
if (newcmd == NULL)
err(1, "cannot allocate memory for new command");
+ if (getenv("OBJFORMAT_DEBUG") != NULL) {
+ fprintf(stderr, "objformat: %s -> %s\n", cmd, newcmd);
+#if 0
+ for (i = 1; i < argc; i++)
+ fprintf(stderr, "argv[%d]: %s\n", i, argv[i]);
+#endif
+ }
+
argv[0] = newcmd;
execv(newcmd, argv);
}
- err(1, "could not exec %s/%s in %s", objformat, cmd, objformat_path);
+ err(1, "could not exec %s/%s in %s", postfix, cmd, objformat_path);
}
+
+#endif
diff --git a/usr.bin/passwd/passwd.1 b/usr.bin/passwd/passwd.1
index 96288119ea93f..a61721480dc15 100644
--- a/usr.bin/passwd/passwd.1
+++ b/usr.bin/passwd/passwd.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)passwd.1 8.1 (Berkeley) 6/6/93
-.\" $Id: passwd.1,v 1.10 1998/10/09 06:38:33 markm Exp $
+.\" $Id: passwd.1,v 1.9 1998/08/24 00:56:20 steve Exp $
.\"
.Dd June 6, 1993
.Dt PASSWD 1
@@ -58,7 +58,7 @@ The new password must be entered twice to avoid typing errors.
.Pp
The new password should be at least six characters long (which
may be overridden using the
-.Xr login.conf 5
+.Xr login.cap 5
"minpasswordlen" setting for a user's login class) and not purely alphabetic.
Its total length must be less than
.Dv _PASSWORD_LEN
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 4c787834f6365..25acd157bacbb 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -56,10 +56,6 @@ static char const sccsid[] = "@(#)printf.c 8.1 (Berkeley) 7/20/93";
#ifdef SHELL
#define main printfcmd
#include "bltin/bltin.h"
-#else
-#define warnx1(a, b, c) warnx(a)
-#define warnx2(a, b, c) warnx(a, b)
-#define warnx3(a, b, c) warnx(a, b, c)
#endif
#define PF(f, func) { \
@@ -140,7 +136,7 @@ next: for (start = fmt;; ++fmt) {
if (!*fmt) {
/* avoid infinite loop */
if (end == 1) {
- warnx1("missing format character",
+ warnx("missing format character",
NULL, NULL);
return (1);
}
@@ -190,7 +186,7 @@ next: for (start = fmt;; ++fmt) {
} else
precision = 0;
if (!*fmt) {
- warnx1("missing format character", NULL, NULL);
+ warnx("missing format character", NULL, NULL);
return (1);
}
@@ -231,7 +227,7 @@ next: for (start = fmt;; ++fmt) {
break;
}
default:
- warnx2("illegal format character %c", convch, NULL);
+ warnx("illegal format character %c", convch, NULL);
return (1);
}
*fmt = nextch;
@@ -342,7 +338,7 @@ getint(ip)
if (getlong(&val))
return (1);
if (val > INT_MAX) {
- warnx3("%s: %s", *gargv, strerror(ERANGE));
+ warnx("%s: %s", *gargv, strerror(ERANGE));
return (1);
}
*ip = val;
@@ -364,16 +360,16 @@ getlong(lp)
errno = 0;
val = strtol(*gargv, &ep, 0);
if (*ep != '\0') {
- warnx2("%s: illegal number", *gargv, NULL);
+ warnx("%s: illegal number", *gargv, NULL);
return (1);
}
if (errno == ERANGE)
if (val == LONG_MAX) {
- warnx3("%s: %s", *gargv, strerror(ERANGE));
+ warnx("%s: %s", *gargv, strerror(ERANGE));
return (1);
}
if (val == LONG_MIN) {
- warnx3("%s: %s", *gargv, strerror(ERANGE));
+ warnx("%s: %s", *gargv, strerror(ERANGE));
return (1);
}
diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c
index a39e478a88404..1c5d084f90fcf 100644
--- a/usr.bin/rwall/rwall.c
+++ b/usr.bin/rwall/rwall.c
@@ -43,7 +43,7 @@ static const char copyright[] =
static char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";
#endif
static const char rcsid[] =
- "$Id: rwall.c,v 1.6 1997/08/08 12:18:16 charnier Exp $";
+ "$Id: rwall.c,v 1.5 1997/02/22 19:56:55 peter Exp $";
#endif /* not lint */
/*
@@ -134,9 +134,10 @@ makemsg(fname)
time_t now, time();
FILE *fp;
int fd;
- char *whom, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
+ char *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[15];
- snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP);
+ (void)strcpy(tmpname, _PATH_TMP);
+ (void)strcat(tmpname, "wall.XXXXXX");
if (!(fd = mkstemp(tmpname)) || !(fp = fdopen(fd, "r+")))
errx(1, "can't open temporary file");
(void)unlink(tmpname);
diff --git a/usr.bin/rwho/rwho.1 b/usr.bin/rwho/rwho.1
index e1373cda021ac..1b49b19689765 100644
--- a/usr.bin/rwho/rwho.1
+++ b/usr.bin/rwho/rwho.1
@@ -52,7 +52,7 @@ received from a machine for 5 minutes then
assumes the machine is down, and does not report users last known
to be logged into that machine.
.Pp
-If a user hasn't typed to the system for a minute or more, then
+If a users hasn't typed to the system for a minute or more, then
.Nm
reports this idle time. If a user hasn't typed to the system for
an hour or more, then
diff --git a/usr.bin/sasc/INSTALL b/usr.bin/sasc/INSTALL
index 484aa2d502f30..448a7a28d3636 100644
--- a/usr.bin/sasc/INSTALL
+++ b/usr.bin/sasc/INSTALL
@@ -57,7 +57,7 @@ To install the device driver, please do the following steps:
6. Edit your kernel configuration file (in /usr/src/sys/i386/conf/)
by inserting the following line:
- device asc0 at isa? port 0x2ab tty drq 3 irq 10
+ device asc0 at isa? port 0x2ab tty drq 3 irq 10 vector ascintr
This should usually work for you as it reflects the factory
settings of the AMI scanner. However, if this conflicts with
diff --git a/usr.bin/sed/Makefile b/usr.bin/sed/Makefile
index d6b13a26e44f8..99f860be5f1a2 100644
--- a/usr.bin/sed/Makefile
+++ b/usr.bin/sed/Makefile
@@ -1,7 +1,6 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= sed
-CFLAGS+=-Wall
SRCS= compile.c main.c misc.c process.c
.include <bsd.prog.mk>
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index 1313fcaec0f08..1c9b82ba19128 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -40,7 +40,7 @@
static char sccsid[] = "@(#)compile.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: compile.c,v 1.11 1998/12/07 05:35:54 archie Exp $";
+ "$Id: compile.c,v 1.9 1997/08/11 07:20:58 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -160,7 +160,7 @@ compile_stream(link)
stack = 0;
for (;;) {
- if ((p = cu_fgets(lbuf, sizeof(lbuf), NULL)) == NULL) {
+ if ((p = cu_fgets(lbuf, sizeof(lbuf))) == NULL) {
if (stack != 0)
errx(1, "%lu: %s: unexpected EOF (pending }'s)",
linenum, fname);
@@ -456,7 +456,6 @@ compile_subst(p, s)
static char lbuf[_POSIX2_LINE_MAX + 1];
int asize, ref, size;
char c, *text, *op, *sp;
- int more = 0;
c = *p++; /* Terminator character */
if (c == '\0')
@@ -484,10 +483,7 @@ compile_subst(p, s)
} else if (*p == '&' || *p == '\\')
*sp++ = '\\';
} else if (*p == c) {
- if (*++p == '\0' && more) {
- if (cu_fgets(lbuf, sizeof(lbuf), &more))
- p = lbuf;
- }
+ p++;
*sp++ = '\0';
size += sp - op;
s->new = xrealloc(text, size);
@@ -502,9 +498,9 @@ compile_subst(p, s)
size += sp - op;
if (asize - size < _POSIX2_LINE_MAX + 1) {
asize *= 2;
- text = xrealloc(text, asize);
+ text = xmalloc(asize);
}
- } while (cu_fgets(p = lbuf, sizeof(lbuf), &more));
+ } while (cu_fgets(p = lbuf, sizeof(lbuf)));
errx(1, "%lu: %s: unterminated substitute in regular expression",
linenum, fname);
/* NOTREACHED */
@@ -637,7 +633,7 @@ compile_text()
asize = 2 * _POSIX2_LINE_MAX + 1;
text = xmalloc(asize);
size = 0;
- while (cu_fgets(lbuf, sizeof(lbuf), NULL)) {
+ while (cu_fgets(lbuf, sizeof(lbuf))) {
op = s = text + size;
p = lbuf;
EATSPACE();
diff --git a/usr.bin/sed/extern.h b/usr.bin/sed/extern.h
index 584ac6f6d3aff..a80f7c94dbce8 100644
--- a/usr.bin/sed/extern.h
+++ b/usr.bin/sed/extern.h
@@ -50,7 +50,7 @@ extern char *fname;
void cfclose __P((struct s_command *, struct s_command *));
void compile __P((void));
void cspace __P((SPACE *, char *, size_t, enum e_spflag));
-char *cu_fgets __P((char *, int, int *));
+char *cu_fgets __P((char *, int));
int mf_fgets __P((SPACE *, enum e_spflag));
void process __P((void));
char *strregerror __P((int, regex_t *));
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 353dedbc8e3de..6e1ef35c69166 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -46,7 +46,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/3/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.7 1997/08/11 07:21:03 charnier Exp $";
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
@@ -176,10 +176,9 @@ usage()
* together. Empty strings and files are ignored.
*/
char *
-cu_fgets(buf, n, more)
+cu_fgets(buf, n)
char *buf;
int n;
- int *more;
{
static enum {ST_EOF, ST_FILE, ST_STRING} state = ST_EOF;
static FILE *f; /* Current open file */
@@ -190,11 +189,8 @@ cu_fgets(buf, n, more)
again:
switch (state) {
case ST_EOF:
- if (script == NULL) {
- if (more != NULL)
- *more = 0;
+ if (script == NULL)
return (NULL);
- }
linenum = 0;
switch (script->type) {
case CU_FILE:
@@ -219,8 +215,6 @@ again:
linenum++;
if (linenum == 1 && buf[0] == '#' && buf[1] == 'n')
nflag = 1;
- if (more != NULL)
- *more = !feof(f);
return (p);
}
script = script->next;
@@ -235,8 +229,6 @@ again:
if (n-- <= 1) {
*p = '\0';
linenum++;
- if (more != NULL)
- *more = 1;
return (buf);
}
switch (*s) {
@@ -249,8 +241,6 @@ again:
script = script->next;
*p = '\0';
linenum++;
- if (more != NULL)
- *more = 0;
return (buf);
}
case '\n':
@@ -258,8 +248,6 @@ again:
*p = '\0';
s++;
linenum++;
- if (more != NULL)
- *more = 0;
return (buf);
default:
*p++ = *s++;
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index 535405af28bb5..18bf5159488e8 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -40,7 +40,7 @@
static char sccsid[] = "@(#)process.c 8.6 (Berkeley) 4/20/94";
#endif
static const char rcsid[] =
- "$Id: process.c,v 1.7 1998/04/29 21:58:36 ache Exp $";
+ "$Id: process.c,v 1.6 1997/08/11 07:21:06 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -94,7 +94,7 @@ process()
{
struct s_command *cp;
SPACE tspace;
- size_t len, oldpsl = 0;
+ size_t len, oldpsl;
char *p;
for (linenum = 0; mf_fgets(&PS, REPLACE);) {
diff --git a/usr.bin/systat/devs.h b/usr.bin/systat/devs.h
index ce49c40d0ab92..e38ed3837f1af 100644
--- a/usr.bin/systat/devs.h
+++ b/usr.bin/systat/devs.h
@@ -1,30 +1,2 @@
-/*-
- * Copyright (c) 1998 David E. O'Brien
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
int dsinit(int, struct statinfo *, struct statinfo *, struct statinfo *);
int dscmd(char *, char *, int, struct statinfo *);
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1
index 64dfa35b871fc..b035eb98fd18a 100644
--- a/usr.bin/systat/systat.1
+++ b/usr.bin/systat/systat.1
@@ -304,17 +304,16 @@ the number and percentage of the translations that were
handled by the per process name translation cache.
.Pp
At the bottom left is the disk usage display.
-It reports the number of
-kilobytes per transaction, transactions per second and megabytes
-per second averaged over the
+It reports the number of seeks, transfers, and number
+of kilobyte blocks transferred per second averaged over the
refresh period of the display (by default, five seconds).
-The system keeps statistics on most every storage device. In general, up
-to seven devices are displayed. The devices displayed by default are the
-first devices in the kernel's device list. See
-.Xr devstat 3
-and
-.Xr devstat 9
-for details on the devstat system.
+For some disks it also reports the average milliseconds per seek.
+Note that the system only keeps statistics on at most eight disks
+(this is controlled by the constant
+.Dv DK_NDRIVE
+in
+.Aq Pa sys/dkstat.h
+as a kernel compile-time constant).
.Pp
Under the date in the upper right hand quadrant are statistics
on paging and swapping activity.
@@ -375,8 +374,6 @@ Display statistics as a running total from the point this
command is given.
.It Cm time
Display statistics averaged over the refresh interval (the default).
-.It Cm want_fd
-Toggle the display of fd devices in the disk usage display.
.It Cm zero
Reset running statistics to zero.
.El
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index bfd8e816684e7..fe31fba4a5b56 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
static const char rcsid[] =
- "$Id: vmstat.c,v 1.29 1998/10/08 09:56:10 obrien Exp $";
+ "$Id: vmstat.c,v 1.28 1998/10/05 04:04:27 ken Exp $";
#endif /* not lint */
/*
diff --git a/usr.bin/tcopy/pathnames.h b/usr.bin/tcopy/pathnames.h
index 7c08559137d64..a36921e2a4a77 100644
--- a/usr.bin/tcopy/pathnames.h
+++ b/usr.bin/tcopy/pathnames.h
@@ -33,4 +33,4 @@
* @(#)pathnames.h 8.1 (Berkeley) 6/6/93
*/
-#define _PATH_DEFTAPE "/dev/rsa0"
+#define _PATH_DEFTAPE "/dev/rst0"
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index ebacc42bc0d9d..165bec2e4428b 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -2186,8 +2186,7 @@ tn(argc, argv)
if (temp != INADDR_NONE) {
sin.sin_addr.s_addr = temp;
sin.sin_family = AF_INET;
- if (doaddrlookup)
- host = gethostbyaddr((char *)&temp, sizeof(temp), AF_INET);
+ host = gethostbyaddr((char *)&temp, sizeof(temp), AF_INET);
if (host)
(void) strncpy(_hostname, host->h_name, sizeof(_hostname));
else
diff --git a/usr.bin/telnet/externs.h b/usr.bin/telnet/externs.h
index a8c3f24f57fd3..43fdb43287be6 100644
--- a/usr.bin/telnet/externs.h
+++ b/usr.bin/telnet/externs.h
@@ -145,7 +145,6 @@ extern int
termdata, /* Print out terminal data flow */
#endif /* defined(unix) */
debug, /* Debug level */
- doaddrlookup, /* do a reverse lookup? */
clienteof; /* Client received EOF */
extern cc_t escape; /* Escape to command mode */
diff --git a/usr.bin/telnet/main.c b/usr.bin/telnet/main.c
index 7f7c9ff0059b2..3c4d8df281de2 100644
--- a/usr.bin/telnet/main.c
+++ b/usr.bin/telnet/main.c
@@ -135,7 +135,7 @@ main(argc, argv)
rlogin = (strncmp(prompt, "rlog", 4) == 0) ? '~' : _POSIX_VDISABLE;
autologin = -1;
- while ((ch = getopt(argc, argv, "8EKLNS:X:acde:fFk:l:n:rt:x")) != -1) {
+ while ((ch = getopt(argc, argv, "8EKLS:X:acde:fFk:l:n:rt:x")) != -1) {
switch(ch) {
case '8':
eight = 3; /* binary output and input */
@@ -151,9 +151,6 @@ main(argc, argv)
case 'L':
eight |= 2; /* binary output only */
break;
- case 'N':
- doaddrlookup = 0;
- break;
case 'S':
{
#ifdef HAS_GETTOS
diff --git a/usr.bin/telnet/telnet.1 b/usr.bin/telnet/telnet.1
index de161e8508071..b2349195b2ce7 100644
--- a/usr.bin/telnet/telnet.1
+++ b/usr.bin/telnet/telnet.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)telnet.1 8.5 (Berkeley) 3/1/94
-.\" $Id: telnet.1,v 1.9 1997/12/27 18:58:27 steve Exp $
+.\" $Id: telnet.1,v 1.8 1997/11/11 05:00:59 steve Exp $
.\"
.Dd March 1, 1994
.Dt TELNET 1
@@ -93,9 +93,6 @@ Specifies no automatic login to the remote system.
Specifies an 8-bit data path on output. This causes the
.Dv BINARY
option to be negotiated on output.
-.It Fl N
-Prevents IP address to name lookup when destination host is given
-as an IP address.
.It Fl S Ar tos
Sets the IP type-of-service (TOS) option for the telnet
connection to the value
diff --git a/usr.bin/telnet/telnet.c b/usr.bin/telnet/telnet.c
index da8b0e113bf1a..5057969c6f246 100644
--- a/usr.bin/telnet/telnet.c
+++ b/usr.bin/telnet/telnet.c
@@ -106,7 +106,6 @@ int
donebinarytoggle, /* the user has put us in binary */
dontlecho, /* do we suppress local echoing right now? */
globalmode,
- doaddrlookup = 1, /* do a reverse address lookup? */
clienteof = 0;
char *prompt = 0;
diff --git a/usr.bin/tftp/extern.h b/usr.bin/tftp/extern.h
index d64cf29be6f35..9174cb135c773 100644
--- a/usr.bin/tftp/extern.h
+++ b/usr.bin/tftp/extern.h
@@ -34,4 +34,4 @@
*/
void recvfile __P((int, char *, char *));
-void xmitfile __P((int, char *, char *));
+void sendfile __P((int, char *, char *));
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 3c6a15116d47d..d767463ba3a57 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.6 1998/06/09 04:31:02 imp Exp $";
+ "$Id: main.c,v 1.5 1997/08/14 06:47:39 charnier Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -373,7 +373,7 @@ put(argc, argv)
printf("putting %s to %s:%s [%s]\n",
cp, hostname, targ, mode);
peeraddr.sin_port = port;
- xmitfile(fd, targ, mode);
+ sendfile(fd, targ, mode);
return;
}
/* this assumes the target is a directory */
@@ -391,7 +391,7 @@ put(argc, argv)
printf("putting %s to %s:%s [%s]\n",
argv[n], hostname, targ, mode);
peeraddr.sin_port = port;
- xmitfile(fd, targ, mode);
+ sendfile(fd, targ, mode);
}
}
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index ae517a4863291..cd3ecd35a003b 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)tftp.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: tftp.c,v 1.3 1998/02/20 04:30:34 jb Exp $";
+ "$Id: tftp.c,v 1.2 1997/08/14 06:47:40 charnier Exp $";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@@ -88,7 +88,7 @@ static void tpacket __P((const char *, struct tftphdr *, int));
* Send the requested file.
*/
void
-xmitfile(fd, name, mode)
+sendfile(fd, name, mode)
int fd;
char *name;
char *mode;
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 53cf5d93295c1..b0845e6b1a869 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -19,11 +19,10 @@
* Steven Wallace <swallace@freebsd.org>
* Wolfram Schneider <wosch@FreeBSD.org>
*
- * $Id: machine.c,v 1.17 1998/11/26 12:59:21 bde Exp $
+ * $Id: machine.c,v 1.14 1998/08/12 09:58:15 wosch Exp $
*/
-#include <sys/time.h>
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/param.h>
@@ -88,32 +87,37 @@ struct handle
/* definitions for indices in the nlist array */
+
static struct nlist nlst[] = {
#define X_CCPU 0
- { "_ccpu" },
+ { "_ccpu" }, /* 0 */
#define X_CP_TIME 1
- { "_cp_time" },
-#define X_AVENRUN 2
- { "_averunnable" },
+ { "_cp_time" }, /* 1 */
+#define X_HZ 2
+ { "_hz" }, /* 2 */
+#define X_STATHZ 3
+ { "_stathz" }, /* 3 */
+#define X_AVENRUN 4
+ { "_averunnable" }, /* 4 */
/* Swap */
-#define VM_SWAPLIST 3
+#define VM_SWAPLIST 5
{ "_swaplist" },/* list of free swap areas */
-#define VM_SWDEVT 4
+#define VM_SWDEVT 6
{ "_swdevt" }, /* list of swap devices and sizes */
-#define VM_NSWAP 5
+#define VM_NSWAP 7
{ "_nswap" }, /* size of largest swap device */
-#define VM_NSWDEV 6
+#define VM_NSWDEV 8
{ "_nswdev" }, /* number of swap devices */
-#define VM_DMMAX 7
+#define VM_DMMAX 9
{ "_dmmax" }, /* maximum size of a swap block */
-#define X_BUFSPACE 8
+#define X_BUFSPACE 10
{ "_bufspace" }, /* K in buffer cache */
-#define X_CNT 9
+#define X_CNT 11
{ "_cnt" }, /* struct vmmeter cnt */
/* Last pid */
-#define X_LASTPID 10
+#define X_LASTPID 12
{ "_nextpid" },
{ 0 }
};
@@ -154,6 +158,7 @@ static double logcpu;
/* these are retrieved from the kernel in _init */
+static long hz;
static load_avg ccpu;
/* these are offsets obtained via nlist and used in the get_ functions */
@@ -274,6 +279,13 @@ struct statics *statics;
return(-1);
}
+ /* get the symbol values out of kmem */
+ (void) getkval(nlst[X_STATHZ].n_value, (int *)(&hz), sizeof(hz), "!");
+ if (!hz) {
+ (void) getkval(nlst[X_HZ].n_value, (int *)(&hz), sizeof(hz),
+ nlst[X_HZ].n_name);
+ }
+
(void) getkval(nlst[X_CCPU].n_value, (int *)(&ccpu), sizeof(ccpu),
nlst[X_CCPU].n_name);
@@ -344,9 +356,6 @@ struct system_info *si;
{
long total;
load_avg avenrun[3];
- int mib[2];
- struct timeval boottime;
- size_t bt_size;
/* get the cp_time array */
(void) getkval(cp_time_offset, (int *)cp_time, sizeof(cp_time),
@@ -442,20 +451,6 @@ struct system_info *si;
} else {
si->last_pid = -1;
}
-
- /*
- * Print how long system has been up.
- * (Found by looking getting "boottime" from the kernel)
- */
- mib[0] = CTL_KERN;
- mib[1] = KERN_BOOTTIME;
- bt_size = sizeof(boottime);
- if (sysctl(mib, 2, &boottime, &bt_size, NULL, 0) != -1 &&
- boottime.tv_sec != 0) {
- si->boottime = boottime;
- } else {
- si->boottime.tv_sec = -1;
- }
}
static struct handle handle;
@@ -633,8 +628,8 @@ char *(*get_userid)();
status,
smpmode ? PP(pp, p_lastcpu) : 0,
format_time(cputime),
- 100.0 * weighted_cpu(pct, pp),
- 100.0 * pct,
+ 10000.0 * weighted_cpu(pct, pp) / hz,
+ 10000.0 * pct / hz,
cmdlength,
printable(PP(pp, p_comm)));
@@ -739,7 +734,7 @@ static unsigned char sorted_state[] =
#define ORDERKEY_PCTCPU \
- if (lresult = (long) PP(p2, p_pctcpu) - (long) PP(p1, p_pctcpu), \
+ if (lresult = PP(p2, p_pctcpu) - PP(p1, p_pctcpu), \
(result = lresult > 0 ? 1 : lresult < 0 ? -1 : 0) == 0)
#define ORDERKEY_CPTICKS \
diff --git a/usr.bin/touch/touch.1 b/usr.bin/touch/touch.1
index b3a0b173e21fb..f8a7d3e873d31 100644
--- a/usr.bin/touch/touch.1
+++ b/usr.bin/touch/touch.1
@@ -152,7 +152,7 @@ letter pairs are treated as their counterparts specified to the
option.
If the
.Dq YY
-letter pair is in the range 39 to 99, the year is set to 1939 to 1999,
+letter pair is in the range 69 to 99, the year is set to 1969 to 1999,
otherwise, the year is set in the 21st century.
.Sh HISTORY
A
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c
index b5f19dcf95fd2..712d72ecbe6f5 100644
--- a/usr.bin/touch/touch.c
+++ b/usr.bin/touch/touch.c
@@ -260,11 +260,8 @@ stime_arg2(arg, year, tvp)
t->tm_mday = ATOI2(arg);
t->tm_hour = ATOI2(arg);
t->tm_min = ATOI2(arg);
- if (year) {
+ if (year)
t->tm_year = ATOI2(arg);
- if (t->tm_year < 39) /* support 2000-2038 not 1902-1969 */
- t->tm_year += 100;
- }
t->tm_isdst = -1; /* Figure out DST. */
tvp[0].tv_sec = tvp[1].tv_sec = mktime(t);
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c
index b82db46c9be6f..427130c2157e5 100644
--- a/usr.bin/truss/main.c
+++ b/usr.bin/truss/main.c
@@ -31,7 +31,7 @@
#ifndef lint
static const char rcsid[] =
- "$Id: main.c,v 1.12 1998/10/03 00:43:05 sef Exp $";
+ "$Id: main.c,v 1.11 1998/09/07 05:49:43 sef Exp $";
#endif /* not lint */
/*
@@ -254,7 +254,6 @@ main(int ac, char **av) {
if (ioctl(Procfd, PIOCCONT, val) == -1)
warn("PIOCCONT");
} while (pfs.why != S_EXIT);
- fflush(outfile);
if (sigexit) {
if (sigexit == SIGQUIT)
exit(sigexit);
diff --git a/usr.bin/vi/Makefile b/usr.bin/vi/Makefile
index 94b352ac8a2d4..13cbb227ef883 100644
--- a/usr.bin/vi/Makefile
+++ b/usr.bin/vi/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.23 1998/09/05 12:25:54 asami Exp $
+# $Id: Makefile,v 1.22 1998/06/09 04:07:20 imp Exp $
#
# This has most of the glue needed to compile tknvi and the perl hooks,
# but not all.
@@ -16,14 +16,13 @@ APISTUFF= ex_notcl.c ex_noperl.c
#TCLINTERP= yes #we don't have it in the base tree
#TKNVI= yes #not ready, needs X11, tk, doesn't quite work yet
-#PERLINTERP= yes #works
+#PERLINTERP= yes #needs the perl5 v5.003 port
APISTUFF= ex_tcl.c ex_perl.c
-.if defined(PERLINTERP)
-PERL?= /usr/bin/perl5
-CFLAGS+= -DHAVE_PERL_5_003_01 # If perl >= 5.03.01
-.endif
+# Any better ideas?
+#PERL= /usr/local/bin/perl5.003
+#CFLAGS+= -DHAVE_PERL_5_003_01 # If perl >= 5.03.01
.endif
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 3bc3a7ce96d46..3e6b65aca2b9e 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: vmstat.c,v 1.27 1998/09/20 00:11:17 ken Exp $";
+ "$Id: vmstat.c,v 1.26 1998/09/16 18:20:23 dillon Exp $";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c
index 5b38b58dd126d..0b53586c304c9 100644
--- a/usr.bin/w/pr_time.c
+++ b/usr.bin/w/pr_time.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)pr_time.c 8.2 (Berkeley) 4/4/94";
#endif
static const char rcsid[] =
- "$Id: pr_time.c,v 1.11 1997/12/28 17:50:10 alex Exp $";
+ "$Id: pr_time.c,v 1.10 1997/08/26 06:59:34 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -88,7 +88,6 @@ pr_attime(started, now)
/*
* pr_idle --
* Display the idle time.
- * Returns number of excess characters that were used for long idle time.
*/
int
pr_idle(idle)
@@ -98,10 +97,8 @@ pr_idle(idle)
if (idle >= 36 * 3600) {
int days = idle / 86400;
(void)printf(" %dday%s ", days, days > 1 ? "s" : " " );
- if (days >= 100)
- return (2);
if (days >= 10)
- return (1);
+ return(1);
}
/* If idle more than an hour, print as HH:MM. */
@@ -116,5 +113,5 @@ pr_idle(idle)
else
(void)printf(" %2d ", (int)(idle / 60));
- return (0); /* not idle longer than 9 days */
+ return(0); /* not idle longer than 9 days */
}
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 18e43c0619414..a10275286b36b 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
#endif
static const char rcsid[] =
- "$Id: w.c,v 1.31 1998/12/24 23:27:33 dillon Exp $";
+ "$Id: w.c,v 1.27 1998/05/21 08:46:48 jkoshy Exp $";
#endif /* not lint */
/*
@@ -97,7 +97,7 @@ int argwidth; /* width of tty */
int header = 1; /* true if -h flag: don't print heading */
int nflag; /* true if -n flag: don't convert addrs */
int dflag; /* true if -d flag: output debug info */
-int sortidle; /* sort by idle time */
+int sortidle; /* sort bu idle time */
char *sel_user; /* login of particular user selected */
char domain[MAXHOSTNAMELEN];
@@ -114,11 +114,10 @@ struct entry {
struct kinfo_proc *dkp; /* debug option proc list */
} *ep, *ehead = NULL, **nextp = &ehead;
-static void pr_header __P((time_t *, int));
+static void pr_header __P((time_t *, int));
static struct stat
*ttystat __P((char *));
-static void usage __P((int));
-static int this_is_uptime __P((const char *s));
+static void usage __P((int));
char *fmt_argv __P((char **, char *, int)); /* ../../bin/ps/fmt.c */
@@ -142,7 +141,10 @@ main(argc, argv)
(void) setlocale(LC_ALL, "");
/* Are we w(1) or uptime(1)? */
- if (this_is_uptime(argv[0]) == 0) {
+ p = __progname;
+ if (*p == '-')
+ p++;
+ if (*p == 'u') {
wcmd = 0;
p = "";
} else {
@@ -287,7 +289,7 @@ main(argc, argv)
*/
dkp = ep->dkp;
ep->dkp = kp;
- *((struct kinfo_proc **)(&kp->kp_eproc.e_spare[0])) = dkp;
+ *((struct kinfo_proc **)(&kp->kp_eproc.e_spare[ 0])) = dkp;
}
}
}
@@ -352,8 +354,7 @@ main(argc, argv)
}
p = hp->h_name;
}
- if (nflag && *p && strcmp(p, "-") &&
- inet_addr(p) == INADDR_NONE) {
+ if (nflag && *p && strcmp(p, "-") && inet_addr(p) == INADDR_NONE) {
hp = gethostbyname(p);
if (hp != NULL) {
@@ -368,8 +369,8 @@ main(argc, argv)
ep->utmp.ut_host + UT_HOSTSIZE - x, x);
p = buf;
}
- if (dflag) {
- for (dkp = ep->dkp; dkp != NULL; dkp = *((struct kinfo_proc **)(&dkp->kp_eproc.e_spare[0]))) {
+ if( dflag) {
+ for( dkp = ep->dkp; dkp != NULL; dkp = *((struct kinfo_proc **)(&dkp->kp_eproc.e_spare[ 0]))) {
char *p;
p = fmt_argv(kvm_getargv(kd, dkp, argwidth),
dkp->kp_proc.p_comm, MAXCOMLEN);
@@ -386,8 +387,10 @@ main(argc, argv)
ep->utmp.ut_line : ep->utmp.ut_line + 3,
UT_HOSTSIZE, UT_HOSTSIZE, *p ? p : "-");
pr_attime(&ep->utmp.ut_time, &now);
- longidle = pr_idle(ep->idle);
- (void)printf("%.*s\n", argwidth - longidle, ep->args);
+ longidle=pr_idle(ep->idle);
+ if (longidle)
+ argwidth--;
+ (void)printf("%.*s\n", argwidth, ep->args);
}
exit(0);
}
@@ -494,19 +497,3 @@ usage(wcmd)
"usage: uptime\n");
exit (1);
}
-
-static int
-this_is_uptime(s)
- const char *s;
-{
- const char *u;
-
- if ((u = strrchr(s, '/')) != NULL)
- ++u;
- else
- u = s;
- if (strcmp(u, "uptime") == 0)
- return(0);
- return(-1);
-}
-
diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c
index 288bea32c2c4b..04a4823088caa 100644
--- a/usr.bin/wall/wall.c
+++ b/usr.bin/wall/wall.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93";
#endif
static const char rcsid[] =
- "$Id: wall.c,v 1.9 1997/09/15 01:03:16 ache Exp $";
+ "$Id: wall.c,v 1.8 1997/08/25 06:43:22 charnier Exp $";
#endif /* not lint */
/*
@@ -144,10 +144,10 @@ makemsg(fname)
time_t now;
FILE *fp;
int fd;
- char *p, *whom, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
-
- snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP);
+ char *p, *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[15];
+ (void)strcpy(tmpname, _PATH_TMP);
+ (void)strcat(tmpname, "/wall.XXXXXX");
if (!(fd = mkstemp(tmpname)) || !(fp = fdopen(fd, "r+")))
errx(1, "can't open temporary file");
(void)unlink(tmpname);
@@ -167,12 +167,10 @@ makemsg(fname)
* in column 80, but that can't be helped.
*/
(void)fprintf(fp, "\r%79s\r\n", " ");
- (void)snprintf(lbuf, sizeof(lbuf),
- "Broadcast Message from %s@%s",
+ (void)sprintf(lbuf, "Broadcast Message from %s@%s",
whom, hostname);
(void)fprintf(fp, "%-79.79s\007\007\r\n", lbuf);
- (void)snprintf(lbuf, sizeof(lbuf),
- " (%s) at %d:%02d ...", ttyname(2),
+ (void)sprintf(lbuf, " (%s) at %d:%02d ...", ttyname(2),
lt->tm_hour, lt->tm_min);
(void)fprintf(fp, "%-79.79s\r\n", lbuf);
}
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index 0948040f561e3..f6bc52c0ed46a 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "From: @(#)xinstall.c 8.1 (Berkeley) 7/21/93";
#endif
static const char rcsid[] =
- "$Id: xinstall.c,v 1.33 1998/10/13 14:52:33 des Exp $";
+ "$Id: xinstall.c,v 1.32 1998/06/02 12:00:07 peter Exp $";
#endif /* not lint */
/*-
@@ -164,7 +164,6 @@ main(argc, argv)
errx(EX_USAGE, "invalid file mode: %s",
optarg);
mode = getmode(set, 0);
- free(set);
break;
case 'M':
nommap = 1;
diff --git a/usr.bin/yacc/test/ftp.y b/usr.bin/yacc/test/ftp.y
index 9a1e525bdb431..a9ee9cd95c3e4 100644
--- a/usr.bin/yacc/test/ftp.y
+++ b/usr.bin/yacc/test/ftp.y
@@ -455,8 +455,8 @@ cmd: USER SP username CRLF
struct tm *gmtime();
t = gmtime(&stbuf.st_mtime);
reply(213,
- "%d%02d%02d%02d%02d%02d",
- t->tm_year+1900, t->tm_mon+1, t->tm_mday,
+ "19%02d%02d%02d%02d%02d%02d",
+ t->tm_year, t->tm_mon+1, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);
}
}