diff options
author | peter <peter@FreeBSD.org> | 1995-12-30 19:02:48 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-12-30 19:02:48 +0000 |
commit | ab124e78b0271ddb904b761b31e5c9a0cf24e070 (patch) | |
tree | 0cf1447720c45721ed3d214a4eaaa6834bda155d /usr.bin | |
parent | 15748830d0fcd29294a1969a1012655e74908c1e (diff) | |
download | FreeBSD-src-ab124e78b0271ddb904b761b31e5c9a0cf24e070.zip FreeBSD-src-ab124e78b0271ddb904b761b31e5c9a0cf24e070.tar.gz |
recording cvs-1.6 file death
Diffstat (limited to 'usr.bin')
41 files changed, 0 insertions, 4127 deletions
diff --git a/usr.bin/at/at.1 b/usr.bin/at/at.1 deleted file mode 100644 index e33ba82..0000000 --- a/usr.bin/at/at.1 +++ /dev/null @@ -1,216 +0,0 @@ -.\" -.\" Copyright (c) 1993 Christopher G. Demetriou -.\" 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 Christopher G. Demetriou. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software withough 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. -.\" -.\" $Id: at.1,v 1.1 1994/01/05 01:08:56 nate Exp $ -.\" -.Dd December 5, 1993 -.Dt "AT" 1 -.Os FreeBSD 1.1 -.Sh NAME -.Nm at, batch, atq, atrm -.Nd queue, examine, or delete jobs for later execution -.\" -.Sh SYOPSIS -.Nm at -.Op Fl q Ar queue -.Op Fl f Ar file -.Op Fl m -.Ar time -.Pp -.Nm atq -.Op Fl q Ar queue -.Op Fl v -.Pp -.Nm atrm -.Ar job -.Op Ar job ... -.Pp -.Nm batch -.Op Fl f Ar file -.Op Fl m -.Ar time -.Sh DESCRIPTION -The -.Nm at -and -.Nm batch -utilities read commands from the standard input or a specified file -which are to be executed at a later time, using -.Xr sh 1 . -.Pp -The functions of the commands are as follows: -.Bl -tag -width indent -.It Nm at -Executes commands at a specified time. -.It Nm atq -Lists the user's pending jobs, unless the user is -the superuser. In that case, everybody's jobs are -listed. -.It Nm atrm -Deletes jobs. -.It Nm batch -executes commands when system load levels permit. -In other words, it executes the commands when the load -average drops below a specified level. -.El -.Pp -For both -.Nm at -and -.Nm batch , -the working directory, environment (except for the variables -.Nm TERM , -.Nm TERMCAP , -.Nm DISPLAY , -and -.Nm _ ) -and the umask are retained from the time of invocation. The user -will be mailed the standard output and standard error from -his commands if any output is generated. If -.Nm at -is executed from a -.Xr su 1 -shell, the owner of the login whell will receive the mail. -.Sh OPTIONS -.Bl -tag -width indent -The available options are as follows: -.It Fl q Ar queue -Use the specified queue. A queue designation consists -of a single letter; valid queue designation range from -.Ar a -to -.Ar l . -The -.Ar a -queue is the default, and -.Ar b -is the batch queue. Queues with higher letters run with -increased niceness. If -.Nm atq -is given a specific queue, it will only show jobs pending -in that queue. -.It Fl m -Send mail to the user when the job has completed, even if -there was no output. -.It Fl f Ar file -Reads the job from -.Ar file -rather than the standard input. -.It Fl v -Shows completed but not yet deleted jobs in the queue. -.Sh TIME SPECIFICATION -.Nm At -allows some moderately complex time specifications. -It accepts times of the form -.Ar HHMM -or -.Ar HH:MM -to run a job at a specific time of day. If -that time is already passed, the next day is assumed. -You may also specify -.Nm midnight , -.Nm noon , -or -.Nm teatime -(4PM) and you can give a time of day suffixed with -.Nm AM -or -.Nm PM -for running in the morning or the evening. You can -also specify the date on which the job will be run -by giving a date in the form -.Ar month-name day -with an optional -.Ar year , -or giving a date of the form -.Ar MMDDYY , -.Ar MM/DD/YY -or -.Ar DD.MM.YY . -You can also give times like -.Nm now + -.Ar count time-units , -where the time units can be -.Nm minutes, hours, days, -or -.Nm weeks -You can suffix the time with -.Nm today -to run the job today, or -.Nm tomorrow -to run the job tomorrow. -.Pp -For example, to run a job at 4PM three days from now, you -would specify a time of -.Nm 4PM + 3 days . -To run a job at 10:00AM on on July 31, you would specify -a time of -.Nm 10AM Jul 31 . -Finally, to run a job at 1AM tomorrow, you would specify -a time of -.Nm 1AM tomorrow . -.Sh FILES -.Bl -tag -width /var/at/lockfile -compact -.It Pa /var/at/jobs -Directory containing job files -.It Pa /var/at/spool -Directory containing output spool files -.It Pa /var/at/lockfile -Job-creation lock file. -.It Pa /var/run/utmp -.El -.Sh SEE ALSO -.Xr crond 8 , -.Xr nice 1 , -.Xr sh 1 , -.Xr atrun 8 -.Sh AUTHOR -.Bl -tag -Thomas Koenig, ig25@rz.uni-karlsruhe.de -.El -.Sh BUGS -Traditional access control to -.Nm at -and -.Nm batch -via the files -.Pa /var/at/at.allow -and -.Pa /var/at/at.deny -is not implemented. -.Pp -If the file -.Pa /var/run/utmp -is not available or corrupted, or if the user is not -logged in at the time -.Nm at -is invoked, the mail is sent to the userid found in the -environment variable -.Nm LOGNAME . -If that is undefined or empty, the current userid is assumed. diff --git a/usr.bin/at/pathnames.h b/usr.bin/at/pathnames.h deleted file mode 100644 index 400ecfa..0000000 --- a/usr.bin/at/pathnames.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1993 Christopher G. Demetriou - * 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 Christopher G. Demetriou. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software withough 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. - * - * $Id: pathnames.h,v 1.1 1993/12/05 11:37:23 cgd Exp $ - */ - -#ifndef _PATHNAMES_H_ -#define _PATHNAMES_H_ - -#include <paths.h> - -#define _PATH_ATJOBS "/var/at/jobs/" -#define _PATH_ATSPOOL "/var/at/spool/" -#define _PATH_LOCKFILE "/var/at/lockfile" - -#endif /* !_PATHNAMES_H_ */ diff --git a/usr.bin/colldef/data/lt_LN.ISO8859-1 b/usr.bin/colldef/data/lt_LN.ISO8859-1 deleted file mode 100644 index f63cfed..0000000 --- a/usr.bin/colldef/data/lt_LN.ISO8859-1 +++ /dev/null @@ -1,19 +0,0 @@ -order \ -# controls - \x01;...;\x1f;\x7f;...;\x9f;\ -# spaces - \ ;\xa0;\ -# puncts - .;:;\;;\,;!;?;\xa1;\xbf;\ -# digits - 0;...;9;\ -# alphas - a;\xe0;...;\xe5;A;\xc0;...;\xc5;b;B;c;\xe7;C;\xc7;d;D;e;\xe8;...;\xeb;\ - E;\xc8;...;\xcb;f;F;g;G;h;H;i;\xec;...;\xef;I;\xcc;...;\xcf;j;J;k;K;\ - l;L;m;M;n;\xf1;N;\xd1;o;\xf2;...;\xf6;\xf8;O;\xd2;...;\xd6;\xd8;\ - p;P;q;Q;r;R;s;S;t;T;u;\xf9;...;\xfc;U;\xd9;...;\xdc;v;V;w;W;x;X;y;\ - \xfd;Y;\xdd;z;Z;\xf0;\xd0;\xfe;\xde;\xe6;\xc6;\xdf;\xff;\ -# remains - \";...;&;\ - \(;...;+;/;\<;...;\>;@;[;...;`;\{;...;~;\xa2;...;\xbe;\ - \xd7;\xf7 diff --git a/usr.bin/colldef/data/lt_LN.ISO_8859-1 b/usr.bin/colldef/data/lt_LN.ISO_8859-1 deleted file mode 100644 index f63cfed..0000000 --- a/usr.bin/colldef/data/lt_LN.ISO_8859-1 +++ /dev/null @@ -1,19 +0,0 @@ -order \ -# controls - \x01;...;\x1f;\x7f;...;\x9f;\ -# spaces - \ ;\xa0;\ -# puncts - .;:;\;;\,;!;?;\xa1;\xbf;\ -# digits - 0;...;9;\ -# alphas - a;\xe0;...;\xe5;A;\xc0;...;\xc5;b;B;c;\xe7;C;\xc7;d;D;e;\xe8;...;\xeb;\ - E;\xc8;...;\xcb;f;F;g;G;h;H;i;\xec;...;\xef;I;\xcc;...;\xcf;j;J;k;K;\ - l;L;m;M;n;\xf1;N;\xd1;o;\xf2;...;\xf6;\xf8;O;\xd2;...;\xd6;\xd8;\ - p;P;q;Q;r;R;s;S;t;T;u;\xf9;...;\xfc;U;\xd9;...;\xdc;v;V;w;W;x;X;y;\ - \xfd;Y;\xdd;z;Z;\xf0;\xd0;\xfe;\xde;\xe6;\xc6;\xdf;\xff;\ -# remains - \";...;&;\ - \(;...;+;/;\<;...;\>;@;[;...;`;\{;...;~;\xa2;...;\xbe;\ - \xd7;\xf7 diff --git a/usr.bin/colldef/data/ru_SU.CP866 b/usr.bin/colldef/data/ru_SU.CP866 deleted file mode 100644 index 4a6d583..0000000 --- a/usr.bin/colldef/data/ru_SU.CP866 +++ /dev/null @@ -1,20 +0,0 @@ -# cp866 -order \ -# controls - \x01;...;\x1f;\x7f;\ -# spaces - \ ;\xff;\ -# puncts - .;:;\;;\,;!;?;\ -# digits - 0;...;9;\ -# alphas - A;a;B;b;C;c;D;d;E;e;F;f;G;g;H;h;I;i;J;j;K;k;L;l;\ - M;m;N;n;O;o;P;p;Q;q;R;r;S;s;T;t;U;u;V;v;W;w;X;x;\ - Y;y;Z;z;\ - ;;;;;;;;;;;;;;;;;;;;;;;;\ - ;;;;;;;;;;;;;;;;;;;;;;;;\ - ;;;;;;;;;;;;;;;;;;\ -# remains - \";...;&;\(;...;+;/;\<;...;\>;@;[;...;`;\{;...;~;\ - \xb0;...;\xdf;\xf2;...;\xfe diff --git a/usr.bin/colldef/data/ru_SU.KOI8-R b/usr.bin/colldef/data/ru_SU.KOI8-R deleted file mode 100644 index c1f1544..0000000 --- a/usr.bin/colldef/data/ru_SU.KOI8-R +++ /dev/null @@ -1,20 +0,0 @@ -# koi8-r -order \ -# controls - \x01;...;\x1f;\x7f;\ -# spaces - \ ;\x9a;\ -# puncts - .;:;\;;\,;!;?;\ -# digits - 0;...;9;\ -# alphas - A;a;B;b;C;c;D;d;E;e;F;f;G;g;H;h;I;i;J;j;K;k;L;l;\ - M;m;N;n;O;o;P;p;Q;q;R;r;S;s;T;t;U;u;V;v;W;w;X;x;\ - Y;y;Z;z;\ - ;;;;;;;;;;;;;;;;;;;;;;;;\ - ;;;;;;;;;;;;;;;;;;;;;;;;\ - ;;;;;;;;;;;;;;;;;;\ -# remains - \";...;&;\(;...;+;/;\<;...;\>;@;[;...;`;\{;...;~;\ - \x80;...;\x99;\x9b;...;\xa2;\xa4;...;\xb2;\xb4;...;\xbf diff --git a/usr.bin/f2c/f77.script b/usr.bin/f2c/f77.script deleted file mode 100644 index d98bd75..0000000 --- a/usr.bin/f2c/f77.script +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -# Compile Fortran code, adding -lf2c. -# This is a slightly modified g++ script. - -: || exec /bin/sh -f $0 $argv:q - -# The compiler name might be different when doing cross-compilation -# (this should be configured) -gcc_name=cc -speclang=-xnone - -# replace the command name by the name of the new command -progname=`basename $0` -case "$0" in - */*) - gcc=`echo $0 | sed -e "s;/[^/]*$;;"`/$gcc_name - ;; - *) - gcc=$gcc_name - ;; -esac - -# $first is yes for first arg, no afterwards. -first=yes -# If next arg is the argument of an option, $quote is non-empty. -# More precisely, it is the option that wants an argument. -quote= -# $library is made empty to disable use of libf2c. -#library=-lF77 -lI77 -lm -library="-lf2c -lm" -numargs=$# - -# ash requires the newline before `do'. -for arg -do - if [ $first = yes ] - then - # Need some 1st arg to `set' which does not begin with `-'. - # We get rid of it after the loop ends. - set gcc - first=no - fi - # If you have to ask what this does, you should not edit this file. :-) - # The ``S'' at the start is so that echo -nostdinc does not eat the - # -nostdinc. - arg=`echo "S$arg" | sed "s/^S//; s/'/'\\\\\\\\''/g"` - if [ x$quote != x ] - then - quote= - else - quote= - case $arg in - -nostdlib) - # Inhibit linking with -lf2c. - library= - ;; - -lm | -lmath) - # Because libf2c uses things from the math library, make sure it - # always comes before the math library. We recognize both -lm - # and -lmath, since on some systems (e.g. m88k SVR3), it - # doesn't call it libm.a for some reason. - #set "$@" $library - #library="" - ;; - -[bBVDUoeTuIYmLiA] | -Tdata) - # these switches take following word as argument, - # so don't treat it as a file name. - quote=$arg - ;; - -[cSEM] | -MM) - # Don't specify libraries if we won't link, - # since that would cause a warning. - library= - ;; - -x*) - speclang=$arg - ;; - -v) - # catch `f77 -v' - if [ $numargs = 1 ] ; then library="" ; fi - ;; - -*) - # Pass other options through; they don't need -x and aren't inputs. - ;; - *) - # If file ends in .i, put options around it. - # But not if a specified -x option is currently active. - case "$speclang $arg" in -xnone\ *.i) - set "$@" -xf2c "'$arg'" -xnone - continue - esac - ;; - esac - fi - set "$@" "'$arg'" -done - -# Get rid of that initial 1st arg -if [ $first = no ]; then - shift -else - echo "$0: No input files specified." - exit 1 -fi - -if [ x$quote != x ] -then - echo "$0: argument to \`$quote' missing" - exit 1 -fi - -eval $gcc "$@" $library - - diff --git a/usr.bin/f2c/index b/usr.bin/f2c/index deleted file mode 100644 index 5212535..0000000 --- a/usr.bin/f2c/index +++ /dev/null @@ -1,127 +0,0 @@ -# ====== index for f2c/src ====== -# NOTE: "all from f2c/src" is the complete f2c source (sans libraries). -# The remaining files in this directory are the component modules -# of "all from f2c/src", so you can request just the modules that -# have changed since last you updated your f2c source. You can -# tell what has changed by looking at the timestamps at the end -# of "readme from f2c". -file f2c/src/cds.c - -file f2c/src/data.c - -file f2c/src/defines.h - -file f2c/src/defs.h - -file f2c/src/equiv.c - -file f2c/src/error.c - -file f2c/src/exec.c - -file f2c/src/expr.c - -file f2c/src/f2c.1 - -file f2c/src/f2c.1t - -file f2c/src/f2c.h - -file f2c/src/format.c - -file f2c/src/format.h - -file f2c/src/formatdata.c - -file f2c/src/ftypes.h - -file f2c/src/gram.c - -file f2c/src/gram.dcl - -file f2c/src/gram.exec - -file f2c/src/gram.expr - -file f2c/src/gram.head - -file f2c/src/gram.io - -file f2c/src/init.c - -file f2c/src/intr.c - -file f2c/src/io.c - -file f2c/src/iob.h - -file f2c/src/lex.c - -file f2c/src/machdefs.h - -file f2c/src/main.c - -file f2c/src/makefile - -file f2c/src/malloc.c - -file f2c/src/mem.c - -file f2c/src/memset.c - -file f2c/src/misc.c - -file f2c/src/names.c - -file f2c/src/names.h - -file f2c/src/niceprintf.c - -file f2c/src/niceprintf.h - -file f2c/src/notice - -file f2c/src/output.c - -file f2c/src/output.h - -file f2c/src/p1defs.h - -file f2c/src/p1output.c - -file f2c/src/parse.h - -file f2c/src/parse_args.c - -file f2c/src/pccdefs.h - -file f2c/src/pread.c - -file f2c/src/proc.c - -file f2c/src/put.c - -file f2c/src/putpcc.c - -file f2c/src/sysdep.c - -file f2c/src/sysdep.h - -file f2c/src/tokens - -file f2c/src/usignal.h - -file f2c/src/vax.c - -file f2c/src/version.c - -file f2c/src/xsum.c - -file f2c/src/xsum0.out - -file f2c/src/Notice - -file f2c/src/README - -file f2c/src/readme - diff --git a/usr.bin/f2c/index.html b/usr.bin/f2c/index.html deleted file mode 100644 index 2265f2a..0000000 --- a/usr.bin/f2c/index.html +++ /dev/null @@ -1,138 +0,0 @@ -<HTML> -<HEAD><TITLE>/netlib/f2c/src</TITLE></HEAD> -<BODY> -<H2>/netlib/f2c/src</H2> -<UL> -<PRE> -====== index for f2c/src ====== -NOTE: "all from f2c/src" is the complete f2c source (sans libraries). -The remaining files in this directory are the component modules -of "all from f2c/src", so you can request just the modules that -have changed since last you updated your f2c source. You can -tell what has changed by looking at the timestamps at the end -of "readme from f2c". -</PRE> -<LI><EM>file: </EM><A HREF="cds.c.Z">cds.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/cds.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="data.c.Z">data.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/data.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="defines.h.Z">defines.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/defines.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="defs.h.Z">defs.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/defs.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="equiv.c.Z">equiv.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/equiv.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="error.c.Z">error.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/error.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="exec.c.Z">exec.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/exec.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="expr.c.Z">expr.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/expr.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="f2c.1.Z">f2c.1</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/f2c.1.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="f2c.1t.Z">f2c.1t</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/f2c.1t.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="f2c.h.Z">f2c.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/f2c.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="format.c.Z">format.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/format.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="format.h.Z">format.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/format.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="formatdata.c.Z">formatdata.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/formatdata.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="ftypes.h.Z">ftypes.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/ftypes.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="gram.c.Z">gram.c</A><MENU> -</MENU> -<LI><EM>file: </EM><A HREF="gram.dcl.Z">gram.dcl</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/gram.dcl.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="gram.exec.Z">gram.exec</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/gram.exec.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="gram.expr.Z">gram.expr</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/gram.expr.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="gram.head.Z">gram.head</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/gram.head.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="gram.io.Z">gram.io</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/gram.io.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="init.c.Z">init.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/init.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="intr.c.Z">intr.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/intr.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="io.c.Z">io.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/io.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="iob.h.Z">iob.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/iob.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="lex.c.Z">lex.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/lex.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="machdefs.h.Z">machdefs.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/machdefs.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="main.c.Z">main.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/main.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="makefile.Z">makefile</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/makefile.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="malloc.c.Z">malloc.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/malloc.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="mem.c.Z">mem.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/mem.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="memset.c.Z">memset.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/memset.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="misc.c.Z">misc.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/misc.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="names.c.Z">names.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/names.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="names.h.Z">names.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/names.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="niceprintf.c.Z">niceprintf.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/niceprintf.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="niceprintf.h.Z">niceprintf.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/niceprintf.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="notice.Z">notice</A><MENU> -</MENU> -<LI><EM>file: </EM><A HREF="output.c.Z">output.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/output.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="output.h.Z">output.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/output.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="p1defs.h.Z">p1defs.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/p1defs.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="p1output.c.Z">p1output.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/p1output.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="parse.h.Z">parse.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/parse.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="parse_args.c.Z">parse_args.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/parse_args.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="pccdefs.h.Z">pccdefs.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/pccdefs.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="pread.c.Z">pread.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/pread.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="proc.c.Z">proc.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/proc.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="put.c.Z">put.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/put.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="putpcc.c.Z">putpcc.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/putpcc.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="sysdep.c.Z">sysdep.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/sysdep.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="sysdep.h.Z">sysdep.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/sysdep.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="tokens.Z">tokens</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/tokens.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="usignal.h.Z">usignal.h</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/usignal.h.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="vax.c.Z">vax.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/vax.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="version.c.Z">version.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/version.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="xsum.c.Z">xsum.c</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/xsum.c.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="xsum0.out.Z">xsum0.out</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/xsum0.out.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="Notice.Z">Notice</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/Notice.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="README.Z">README</A> (<A HREF="ftp://netlib.att.com/netlib.depend/f2c/src/README.tar">with dependencies</A>)<MENU> -</MENU> -<LI><EM>file: </EM><A HREF="readme.Z">readme</A><MENU> -</MENU> -<P><LI><A HREF="/netlib/bib/thesaurus.html.Z">index help</A> -</UL> -<P><A HREF="/netlib/bib/ericjack.html.Z">Eric and Jack</EM> -</BODY></HTML> diff --git a/usr.bin/f2c/notice b/usr.bin/f2c/notice deleted file mode 100644 index 9715a19..0000000 --- a/usr.bin/f2c/notice +++ /dev/null @@ -1,23 +0,0 @@ -/**************************************************************** -Copyright 1990 - 1995 by AT&T Bell Laboratories and Bellcore. - -Permission to use, copy, modify, and distribute this software -and its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the names of AT&T Bell Laboratories or -Bellcore or any of their entities not be used in advertising or -publicity pertaining to distribution of the software without -specific, written prior permission. - -AT&T and Bellcore disclaim all warranties with regard to this -software, including all implied warranties of merchantability -and fitness. In no event shall AT&T or Bellcore be liable for -any special, indirect or consequential damages or any damages -whatsoever resulting from loss of use, data or profits, whether -in an action of contract, negligence or other tortious action, -arising out of or in connection with the use or performance of -this software. -****************************************************************/ - diff --git a/usr.bin/f2c/readme b/usr.bin/f2c/readme deleted file mode 100644 index b8e5a67..0000000 --- a/usr.bin/f2c/readme +++ /dev/null @@ -1,145 +0,0 @@ -Type "make" to check the validity of the f2c source and compile f2c. - -On a PC, you may need to compile xsum.c with -DMSDOS (i.e., with -MSDOS #defined). - -If your compiler does not understand ANSI/ISO C syntax (i.e., if -you have a K&R C compiler), compile with -DKR_headers . - -On non-Unix systems where files have separate binary and text modes, -you may need to "make xsumr.out" rather than "make xsum.out". - -If (in accordance with what follows) you need to modify the makefile -or any of the source files, first issue a "make xsum.out" (or, if -appropriate, "make xsumr.out") to check the validity of the f2c source, -then make your changes, then type "make f2c". - -The file usignal.h is for the benefit of strictly ANSI include files -on a UNIX system -- the ANSI signal.h does not define SIGHUP or SIGQUIT. -You may need to modify usignal.h if you are not running f2c on a UNIX -system. - -Should you get the message "xsum0.out xsum1.out differ", see what lines -are different (`diff xsum0.out xsum1.out`) and ask netlib -(e.g., netlib@research.att.com) to send you the files in question, -plus the current xsum0.out (which may have changed) "from f2c/src". -For example, if exec.c and expr.c have incorrect check sums, you would -send netlib the message - send exec.c expr.c xsum0.out from f2c/src -You can also ftp these files from netlib.att.com; for more details, ask -netlib@research.att.com to "send readme from f2c". - -On some systems, the malloc and free in malloc.c let f2c run faster -than do the standard malloc and free. Other systems may not tolerate -redefinition of malloc and free (though changes of 8 Nov. 1994 may -render this less of a problem than hitherto). If yours is such a -system, you may either modify the makefile appropriately (remove -"malloc.o" from the "OBJECTS =" assignment), or simply execute - cc -c -DCRAY malloc.c -before typing "make". Still other systems have a -lmalloc that -provides performance competitive with that from malloc.c; you may -wish to compare the two on your system. - -On some BSD systems, you may need to create a file named "string.h" -whose single line is -#include <strings.h> -you may need to add " -Dstrchr=index" to the "CFLAGS =" assignment -in the makefile, and you may need to add " memset.o" to the "OBJECTS =" -assignment in the makefile -- see the comments in memset.c . - -For non-UNIX systems, you may need to change some things in sysdep.c, -such as the choice of intermediate file names. - -On some systems, you may need to modify parts of sysdep.h (which is -included by defs.h). In particular, for Sun 4.1 systems and perhaps -some others, you need to comment out the typedef of size_t. For some -systems (e.g., IRIX 4.0.1 and AIX) it is better to add -#define ANSI_Libraries -to the beginning of sysdep.h (or to supply -DANSI_Libraries in the -makefile). - -Alas, some systems #define __STDC__ but do not provide a true standard -(ANSI or ISO) C environment, e.g. do not provide stdlib.h . If yours -is such a system, then (a) you should complain loudly to your vendor -about __STDC__ being erroneously defined, and (b) you should insert -#undef __STDC__ -at the beginning of sysdep.h . You may need to make other adjustments. - -For some non-ANSI versions of stdio, you must change the values given -to binread and binwrite in sysdep.c from "rb" and "wb" to "r" and "w". -You may need to make this change if you run f2c and get an error -message of the form - Compiler error ... cannot open intermediate file ... - -On many systems, it is best to combine libF77 and libI77 into a single -library, say libf2c, as suggested in "readme from f2c". If you do not -do this, then you should adjust the definition of link_msg in sysdep.c -appropriately (e.g., replacing "-lf2c" by "-lF77 -lI77"). On Unix -systems, the easiest way to create libf2c.a is to make libF77/libF77.a -and libI77/libI77.a (after reading and heeding libF77/README and -libI77/README), and then to say - - cp libF77/libF77.a libf2c.a - ar ruv libf2c.a libI77/*.o - ranlib libf2c.a - -The last step, ranlib, may not be necessary on your system. On -other systems, just compile all the .c files in libF77 and libI77, -and put the resulting objects (except one or both of the Version -objects) into a library, called perhaps f2c.lib . - -Some older C compilers object to - typedef void (*foo)(); -or to - typedef void zap; - zap (*foo)(); -If yours is such a compiler, change the definition of VOID in -f2c.h from void to int. - -For convenience with systems that use control-Z to denote end-of-file, -f2c treats control-Z characters (ASCII 26, '\x1a') that appear at the -beginning of a line as an end-of-file indicator. You can disable this -test by compiling lex.c with NO_EOF_CHAR_CHECK #defined, or can -change control-Z to some other character by #defining EOF_CHAR to -be the desired value. - - -If your machine has IEEE, VAX, or IBM-mainframe arithmetic, but your -printf is inaccurate (e.g., with Symantec C++ version 6.0, -printf("%.17g",12.) prints 12.000000000000001), you can make f2c print -correctly rounded numbers by compiling with -DUSE_DTOA and adding -dtoa.o g_fmt.o to the makefile's OBJECTS = line, so it becomes - - OBJECTS = $(OBJECTSd) malloc.o dtoa.o g_fmt.o - -Also add the rule - - dtoa.o: dtoa.c - $(CC) -c $(CFLAGS) -DMALLOC=ckalloc -DIEEE... dtoa.c - -(without the initial tab) to the makefile, where IEEE... is one of -IEEE_MC68k, IEEE_8087, VAX, or IBM, depending on your machine's -arithmetic. See the comments near the start of dtoa.c. - -The relevant source files, dtoa.c and g_fmt.c, are available -separately from netlib's fp directory. For example, you could -send the E-mail message - - send dtoa.c g_fmt.c from fp - -to netlib@research.att.com (or use anonymous ftp from netlib.att.com -and look in directory /netlib/fp). - -The makefile has a rule for creating tokdefs.h. If you cannot use the -makefile, an alternative is to extract tokdefs.h from the beginning of -gram.c: it's the first 100 lines. - - -Please send bug reports to dmg@research.att.com . The old index file -(now called "readme" due to unfortunate changes in netlib conventions: -"send readme from f2c") will report recent changes in the recent-change -log at its end; all changes will be shown in the "changes" file -("send changes from f2c"). To keep current source, you will need to -request xsum0.out and version.c, in addition to the changed source -files. Changes first appear on netlib@research.att.com, and in due -time propagate to the other netlib sites that are kept current. diff --git a/usr.bin/f2c/xsum.c b/usr.bin/f2c/xsum.c deleted file mode 100644 index b87ace7..0000000 --- a/usr.bin/f2c/xsum.c +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************** -Copyright 1990, 1993, 1994 by AT&T Bell Laboratories and Bellcore. - -Permission to use, copy, modify, and distribute this software -and its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the names of AT&T Bell Laboratories or -Bellcore or any of their entities not be used in advertising or -publicity pertaining to distribution of the software without -specific, written prior permission. - -AT&T and Bellcore disclaim all warranties with regard to this -software, including all implied warranties of merchantability -and fitness. In no event shall AT&T or Bellcore be liable for -any special, indirect or consequential damages or any damages -whatsoever resulting from loss of use, data or profits, whether -in an action of contract, negligence or other tortious action, -arising out of or in connection with the use or performance of -this software. -****************************************************************/ - -#define _POSIX_SOURCE -#include "stdio.h" -#ifndef KR_headers -#include "stdlib.h" -#include "sys/types.h" -#include "fcntl.h" /* for declaration of open, O_RDONLY */ -#include "unistd.h" /* for read, close */ -#endif -#ifdef MSDOS -#include "io.h" -#endif -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif -#ifndef O_BINARY -#define O_BINARY O_RDONLY -#endif - - char *progname; - static int ignore_cr; - - void -#ifdef KR_headers -usage(rc) -#else -usage(int rc) -#endif -{ - fprintf(stderr, "usage: %s [-r] [file [file...]]\n\ - option -r ignores carriage return characters\n", progname); - exit(rc); - } - -typedef unsigned char Uchar; - - long -#ifdef KR_headers -sum32(sum, x, n) - register long sum; - register Uchar *x; - int n; -#else -sum32(register long sum, register Uchar *x, int n) -#endif -{ - register Uchar *xe; - static long crc_table[256] = { - 0, 151466134, 302932268, 453595578, - -9583591, -160762737, -312236747, -463170141, - -19167182, -136529756, -321525474, -439166584, - 28724267, 145849533, 330837255, 448732561, - -38334364, -189783822, -273059512, -423738914, - 47895677, 199091435, 282375505, 433292743, - 57448534, 174827712, 291699066, 409324012, - -67019697, -184128295, -300991133, -418902539, - -76668728, -227995554, -379567644, -530091662, - 67364049, 218420295, 369985021, 520795499, - 95791354, 213031020, 398182870, 515701056, - -86479645, -203465611, -388624945, -506380967, - 114897068, 266207290, 349655424, 500195606, - -105581387, -256654301, -340093543, -490887921, - -134039394, -251295736, -368256590, -485758684, - 124746887, 241716241, 358686123, 476458301, - -153337456, -2395898, -455991108, -304803798, - 162629001, 11973919, 465560741, 314102835, - 134728098, 16841012, 436840590, 319723544, - -144044613, -26395347, -446403433, -329032703, - 191582708, 40657250, 426062040, 274858062, - -200894995, -50223749, -435620671, -284179369, - -172959290, -55056048, -406931222, -289830788, - 182263263, 64630089, 416513267, 299125861, - 229794136, 78991822, 532414580, 381366498, - -220224191, -69691945, -523123603, -371788549, - -211162774, -93398532, -513308602, -396314416, - 201600371, 84090341, 503991391, 386759881, - -268078788, -117292630, -502591472, -351526778, - 258520357, 107972019, 493278217, 341959839, - 249493774, 131713432, 483432482, 366454964, - -239911657, -122417791, -474129349, -356881235, - -306674912, -457198666, -4791796, -156118374, - 315967289, 466778031, 14362133, 165418627, - 325258002, 442776452, 23947838, 141187752, - -334573813, -452329571, -33509849, -150495567, - 269456196, 419996626, 33682024, 184992510, - -278767779, -429561909, -43239823, -194312473, - -288089226, -405591072, -52790694, -170046772, - 297394031, 415166457, 62373443, 179343061, - 383165416, 533828478, 81314500, 232780370, - -373594127, -524527769, -72022307, -223201717, - -401789990, -519431348, -100447498, -217810336, - 392228803, 510123861, 91131631, 208256633, - -345918580, -496598246, -110112096, -261561802, - 336361365, 487278339, 100800185, 251995695, - 364526526, 482151208, 129260178, 246639108, - -354943065, -472854735, -119955829, -237064675, - 459588272, 308539942, 157983644, 7181066, - -469170519, -317835713, -167286907, -16754925, - -440448382, -323454444, -139383890, -21619912, - 450006683, 332774925, 148697015, 31186721, - -422325548, -271261118, -186797064, -36011154, - 431888077, 280569435, 196114401, 45565815, - 403200742, 286222960, 168180682, 50400092, - -412770561, -295522711, -177471533, -59977915, - -536157576, -384970002, -234585260, -83643454, - 526853729, 375396087, 225003341, 74348507, - 517040714, 399923932, 215944038, 98057200, - -507728301, -390357307, -206385281, -88735767, - 498987548, 347783818, 263426864, 112501670, - -489671163, -338229613, -253864151, -103192641, - -479823314, -362722632, -244835582, -126932076, - 470531639, 353144481, 235265819, 117632909 - }; - - xe = x + n; - while(x < xe) - sum = crc_table[(sum ^ *x++) & 0xff] ^ (sum >> 8 & 0xffffff); - return sum; - } - - int -#ifdef KR_headers -cr_purge(buf, n) - Uchar *buf; - int n; -#else -cr_purge(Uchar *buf, int n) -#endif -{ - register Uchar *b, *b1, *be; - b = buf; - be = b + n; - while(b < be) - if (*b++ == '\r') { - b1 = b - 1; - while(b < be) - if ((*b1 = *b++) != '\r') - b1++; - return b1 - buf; - } - return n; - } - -static Uchar Buf[16*1024]; - - void -#ifdef KR_headers -process(s, x) - char *s; - int x; -#else -process(char *s, int x) -#endif -{ - register int n; - long fsize, sum; - - sum = 0; - fsize = 0; - while((n = read(x, (char *)Buf, sizeof(Buf))) > 0) { - if (ignore_cr) - n = cr_purge(Buf, n); - fsize += n; - sum = sum32(sum, Buf, n); - } - sum &= 0xffffffff; - if (n==0) - printf("%s\t%lx\t%ld\n", s, sum & 0xffffffff, fsize); - else { perror(s); } - close(x); - } - -#ifdef KR_headers -main(argc, argv) - char **argv; -#else -main(int argc, char **argv) -#endif -{ - int x; - char *s; - static int rc; - - progname = *argv; - argc = argc; /* turn off "not used" warning */ - s = *++argv; - if (s && *s == '-') { - switch(s[1]) { - case '?': - usage(0); - case 'r': - ignore_cr = 1; - case '-': - break; - default: - fprintf(stderr, "invalid option %s\n", s); - usage(1); - } - s = *++argv; - } - if (s) do { - x = open(s, O_RDONLY|O_BINARY); - if (x < 0) { - fprintf(stderr, "%s: can't open %s\n", progname, s); - rc |= 1; - } - else - process(s, x); - } - while(s = *++argv); - else { - process("/dev/stdin", fileno(stdin)); - } - return rc; - } diff --git a/usr.bin/grep/egrep/Makefile b/usr.bin/grep/egrep/Makefile deleted file mode 100644 index 5df3e8f..0000000 --- a/usr.bin/grep/egrep/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 6/27/93 - -# -DSLOWSYS invoke xread() for system time quirk on PDP, others? -# -DNOKANJI default is for Japanese Unix. undef only for raw -# parity-marked search capability, not standard w/grep. -# -DCHINESE for systems using EUC Chinese2 codes -# -Dstrrchr=rindex, -Dstrchr=index as necessary - -PROG= egrep -CFLAGS+=-Dstrrchr=rindex -Dstrchr=index -DNOKANJI -DPADD= ${LIBCOMPAT} -LDADD= -lcompat # must search compat to get spencers early regexp package -MAN1= grep.1 -LINKS= ${BINDIR}/egrep ${BINDIR}/grep ${BINDIR}/egrep ${BINDIR}/fgrep -MLINKS= grep.1 egrep.1 grep.1 fgrep.1 - -.include "../../Makefile.inc" -.include <bsd.prog.mk> diff --git a/usr.bin/key/README.WZV b/usr.bin/key/README.WZV deleted file mode 100644 index a13f3b5..0000000 --- a/usr.bin/key/README.WZV +++ /dev/null @@ -1,100 +0,0 @@ -One of the nice things of S/Key is that it still leaves you the option -to use regular UNIX passwords. In fact, the presence of S/Key support -is completely invisible for a user until she has set up a password with -the keyinit command. You can permit regular UNIX passwords for local -logins, while at the same time insisting on S/Key passwords for logins -from outside. - -ORIGIN - -These files are modified versions of the s/key files found on -thumper.bellcore.com at 21 oct 1993. They have been fixed to -run on top of SunOS 4.1.3 and Solaris 2.3. - -Installation is described at the end of this file. - -USAGE - -Use the keyinit command to set up a new series of s/key passwords. - - wzv_6% keyinit - Updating wietse: - Old key: wz173500 - Reminder - Only use this method if you are direct connected. - If you are using telnet or dial-in exit with no password and use keyinit -s. - Enter secret password: - Again secret password: - - ID wietse s/key is 99 wz173501 - BLAH BLA BLAH BLAH BLAH BLA - -Be sure to make your secret password sufficiently long. Try using a -full sentence instead of just one single word. - -You will have to do a "keyinit" on every system that you want to login -on using one-time passwords. - -Whenever you log into an s/key protected system you will see -something like: - - login: wietse - s/key 98 wz173501 - Password: - -In this case you can either enter your regular UNIX password or -your one-time s/key password. For example, I open a local window -to compute the password: - - local% key 98 wz173501 - Reminder - Do not use key while logged in via telnet or rlogin. - Enter secret password: - BLAH BLA BLAH BLAH BLAH BLA - -The "BLAH BLA BLAH BLAH BLAH BLA" is the one-time s/key password. - -If you have to type the one-time password in by hand, it is convenient -to have echo turned on so that you can correct typing errors. Just type -a newline at the "Password:" prompt: - - login: wietse - s/key 98 wz173501 - Password: (turning echo on) - Password:BLAH BLA BLAH BLAH BLAH BLA - -The 98 in the challenge will be 97 the next time, and so on. You'll get -a warning when you are about to run out of s/key passwords, so that you -will have to run the keyinit command again. - -Sometimes it is more practical to carry a piece of paper with a small -series of one-time passwords. You can generate the list with: - - % key -n 10 98 wz173501 - 98: BLAH BLA BLAH BLAH BLAH BLA - 97: ... - 96: ... - -Be careful when printing material like this! - -INSTALLATION - -To install, do: make sunos4 (or whatever), then: make install. - -The UNIX password is always permitted with non-network logins. By -default, UNIX passwords are always permitted (the Bellcore code by -default disallows UNIX passwords but I think that is too painful). In -order to permit UNIX passwords only with logins from specific networks, -create a file /etc/skey.access. For example, - - # First word says if UNIX passwords are to be permitted or denied. - # remainder of the rule is a networknumber and mask. A rule matches a - # host if any of its addresses satisfies: - # - # network = (address & mask) - # - #what network mask - permit 131.155.210.0 255.255.255.0 - deny 0.0.0.0 0.0.0.0 - -This particular example will permit UNIX passwords with logins from any -host on network 131.155.210, but will insist on one-time passwords in -all other cases. diff --git a/usr.bin/key/skey.1 b/usr.bin/key/skey.1 deleted file mode 100644 index b4e0455..0000000 --- a/usr.bin/key/skey.1 +++ /dev/null @@ -1,59 +0,0 @@ -.ll 6i -.pl 10.5i -.\" @(#)skey.1 1.1 10/28/93 -.\" -.lt 6.0i -.TH KEY 1 "28 October 1993" -.AT 3 -.SH NAME -S/key \- A procedure to use one time passwords for accessing computer systems. -.SH DESCRIPTION -.I S/key -is a procedure for using one time password to authenticate access to -computer systems. It uses 64 bits of information transformed by the -MD4 algorithm. The user supplies the 64 bits in the form of 6 English -words that are generated by a secure computer. -Example use of the S/key program -.I key -.sp - Usage example: -.sp 0 - >key 99 th91334 -.sp 0 - Enter password: <your secret password is entered here> -.sp 0 - OMEN US HORN OMIT BACK AHOY -.sp 0 - > -.sp -The programs that are part of the S/Key system are keyinit, key, and -keyinfo. Keyinit is used to get your ID set up, key is -used to get the one time password each time, -keyinfo is used to extract information from the S/Key database. -.sp -When you run "keyinit" you inform the system of your -secret password. Running "key" then generates the -one-time passwords, and also requires your secret -password. If however, you misspell your password -while running "key", you will get a list of passwords -that will not work, and no indication about the problem. -.sp -Password sequence numbers count backward from 99. If you -don't know this, the syntax for "key" will be confusing. -.sp -You can enter the passwords using small letters, even -though the "key" program gives them in caps. -.sp -Macintosh and a general purpose PC use -are available. -.sp -Under FreeBSD, you can control, with /etc/skey.access, from which -hosts and/or networks the use of S/Key passwords is obligated. -.LP -.SH SEE ALSO -.BR keyinit(1), -.BR key(1), -.BR keyinfo(1) -.BR skey.access(5) -.SH AUTHOR -Phil Karn, Neil M. Haller, John S. Walden, Scott Chasin diff --git a/usr.bin/login/login_skey.c b/usr.bin/login/login_skey.c deleted file mode 100644 index b94bd28..0000000 --- a/usr.bin/login/login_skey.c +++ /dev/null @@ -1,105 +0,0 @@ - /* Portions taken from the skey distribution on Oct 21 1993 */ -#ifdef SKEY -#include <sys/types.h> -#include <netinet/in.h> -#include <string.h> -#include <netdb.h> -#include <arpa/inet.h> -#include <stdio.h> -#include <termios.h> -#include <pwd.h> -#include <syslog.h> - -#include <skey.h> - -/* skey_getpass - read regular or s/key password */ - -char *skey_getpass(prompt, pwd, pwok) -char *prompt; -struct passwd *pwd; -int pwok; -{ - static char buf[128]; - struct skey skey; - char *cp; - void rip(); - struct termios saved_ttymode; - struct termios noecho_ttymode; - char *username = pwd ? pwd->pw_name : "nope"; - int sflag; - - /* Attempt an s/key challenge. */ - - if ((sflag = skeychallenge(&skey, username, buf)) == 0) { - printf("%s\n", buf); - } - if (!pwok) { - printf("(s/key required)\n"); - } - fputs(prompt, stdout); - fflush(stdout); - - /* Save current input modes and turn echo off. */ - - tcgetattr(0, &saved_ttymode); - tcgetattr(0, &noecho_ttymode); - noecho_ttymode.c_lflag &= ~ECHO; - tcsetattr(0, TCSANOW, &noecho_ttymode); - - /* Read password. */ - - buf[0] = 0; - fgets(buf, sizeof(buf), stdin); - rip(buf); - - /* Restore previous input modes. */ - - tcsetattr(0, TCSANOW, &saved_ttymode); - - /* Give S/Key users a chance to do it with echo on. */ - - if (sflag == 0 && feof(stdin) == 0 && buf[0] == 0) { - fputs(" (turning echo on)\n", stdout); - fputs(prompt, stdout); - fflush(stdout); - fgets(buf, sizeof(buf), stdin); - rip(buf); - } else { - putchar('\n'); - } - return (buf); -} - -/* skey_crypt - return encrypted UNIX passwd if s/key or regular password ok */ - -char *skey_crypt(pp, salt, pwd, pwok) -char *pp; -char *salt; -struct passwd *pwd; -int pwok; -{ - struct skey skey; - char *p; - char *crypt(); - - /* Try s/key authentication even when the UNIX password is permitted. */ - - if (pwd != 0 && skeylookup(&skey, pwd->pw_name) == 0 - && skeyverify(&skey, pp) == 0) { - /* s/key authentication succeeded */ - if (skey.n < 5) - printf("Warning! Change s/key password soon\n"); - return (pwd->pw_passwd); - } - - /* When s/key authentication does not work, always invoke crypt(). */ - - p = crypt(pp, salt); - if (pwok && pwd != 0 && strcmp(p, pwd->pw_passwd) == 0) - return (pwd->pw_passwd); - - /* The user does not exist or entered bad input. */ - - return (":"); -} -#endif SKEY diff --git a/usr.bin/mklocale/POSIX b/usr.bin/mklocale/POSIX deleted file mode 100644 index 4f1ae60..0000000 --- a/usr.bin/mklocale/POSIX +++ /dev/null @@ -1,33 +0,0 @@ -# @(#)POSIX 8.1 (Berkeley) 6/6/93 - -/* - * Standard LOCALE_CTYPE for the C Locale - */ -ENCODING "NONE" -VARIABLE A comment line or data line. Only 1 allowed. Copied verbatim. - -# -# This is a comment -# -ALPHA 'A' - 'Z' 'a' - 'z' -CONTROL 0x00 - 0x1f 0x7f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e -LOWER 'a' - 'z' -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e -SPACE 0x09 - 0x0d 0x20 -UPPER 'A' - 'Z' -XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' -PRINT 0x20 - 0x7e -# IDEOGRAM -# SPECIAL -# PHONEGRAM - -MAPLOWER <'A' - 'Z' : 'a'> -MAPLOWER <'a' - 'z' : 'a'> -MAPUPPER <'A' - 'Z' : 'A'> -MAPUPPER <'a' - 'z' : 'A'> -TODIGIT <'0' - '9' : 0> -TODIGIT <'A' - 'F' : 10> -TODIGIT <'a' - 'f' : 10> diff --git a/usr.bin/mklocale/data/ja_JP.EUC b/usr.bin/mklocale/data/ja_JP.EUC deleted file mode 100644 index 88fdc91..0000000 --- a/usr.bin/mklocale/data/ja_JP.EUC +++ /dev/null @@ -1,158 +0,0 @@ -# @(#)Japanese 8.1 (Berkeley) 6/6/93 - -/* - * Japanese LOCALE_CTYPE definitions using EUC of JIS character sets - */ - -ENCODING "EUC" - -/* JIS JIS JIS */ -/* X201 X208 X201 */ -/* 00-7f 84-fe */ - -VARIABLE 1 0x0000 2 0x8080 2 0x0080 3 0x8000 0x8080 - -/* - * Code Set 1 - */ -ALPHA 'A' - 'Z' 'a' - 'z' -CONTROL 0x00 - 0x1f 0x7f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e -LOWER 'a' - 'z' -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e -SPACE 0x09 - 0x0d 0x20 -UPPER 'A' - 'Z' -XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' -PRINT 0x20 - 0x7e - -MAPLOWER < 'A' - 'Z' : 'a' > -MAPLOWER < 'a' - 'z' : 'a' > -MAPUPPER < 'A' - 'Z' : 'A' > -MAPUPPER < 'a' - 'z' : 'A' > -TODIGIT < '0' - '9' : 0 > -TODIGIT < 'A' - 'F' : 10 > -TODIGIT < 'a' - 'f' : 10 > - -/* - * Code Set 2 - */ - -SPACE 0xa1a1 -PHONOGRAM 0xa1bc -SPECIAL 0xa1a2 - 0xa1fe -PUNCT 0xa1a2 - 0xa1f8 /* A few too many in here... */ - -SPECIAL 0xa2a1 - 0xa2ae 0xa2ba - 0xa2c1 0xa2ca - 0xa2d0 0xa2dc - 0xa2ea -SPECIAL 0xa2f2 - 0xa2f9 0xa2fe - -DIGIT 0xa3b0 - 0xa3b9 -UPPER 0xa3c1 - 0xa3da /* Romaji */ -LOWER 0xa3e1 - 0xa3fa /* Romaji */ -MAPLOWER < 0xa3c1 - 0xa3da : 0xa3e1 > /* English */ -MAPLOWER < 0xa3e1 - 0xa3fa : 0xa3e1 > /* English */ -MAPUPPER < 0xa3c1 - 0xa3da : 0xa3c1 > -MAPUPPER < 0xa3e1 - 0xa3fa : 0xa3c1 > - -XDIGIT 0xa3c1 - 0xa3c6 0xa3e1 - 0xa3e6 - -TODIGIT < 0xa3b0 - 0xa3b9 : 0 > -TODIGIT < 0xa3c1 - 0xa3c6 : 10 > -TODIGIT < 0xa3e1 - 0xa3e6 : 10 > - -PHONOGRAM 0xa4a1 - 0xa4f3 -PHONOGRAM 0xa5a1 - 0xa5f6 - -UPPER 0xa6a1 - 0xa6b8 /* Greek */ -LOWER 0xa6c1 - 0xa6d8 /* Greek */ -MAPLOWER < 0xa6a1 - 0xa6b8 : 0xa6c1 > -MAPLOWER < 0xa6c1 - 0xa6d8 : 0xa6c1 > -MAPUPPER < 0xa6a1 - 0xa6b8 : 0xa6a1 > -MAPUPPER < 0xa6c1 - 0xa6d8 : 0xa6a1 > - -UPPER 0xa7a1 - 0xa7c1 /* Cyrillic */ -LOWER 0xa7d1 - 0xa7f1 /* Cyrillic */ -MAPLOWER < 0xa7a1 - 0xa7c1 : 0xa7d1 > -MAPLOWER < 0xa7d1 - 0xa7f1 : 0xa7d1 > -MAPUPPER < 0xa7a1 - 0xa7c1 : 0xa7a1 > -MAPUPPER < 0xa7d1 - 0xa7f1 : 0xa7a1 > - -SPECIAL 0xa8a1 - 0xa8c0 - -IDEOGRAM 0xb0a1 - 0xb0fe -IDEOGRAM 0xb1a1 - 0xb1fe -IDEOGRAM 0xb2a1 - 0xb2fe -IDEOGRAM 0xb3a1 - 0xb3fe -IDEOGRAM 0xb4a1 - 0xb4fe -IDEOGRAM 0xb5a1 - 0xb5fe -IDEOGRAM 0xb6a1 - 0xb6fe -IDEOGRAM 0xb7a1 - 0xb7fe -IDEOGRAM 0xb8a1 - 0xb8fe -IDEOGRAM 0xb9a1 - 0xb9fe -IDEOGRAM 0xbaa1 - 0xbafe -IDEOGRAM 0xbba1 - 0xbbfe -IDEOGRAM 0xbca1 - 0xbcfe -IDEOGRAM 0xbda1 - 0xbdfe -IDEOGRAM 0xbea1 - 0xbefe -IDEOGRAM 0xbfa1 - 0xbffe -IDEOGRAM 0xc0a1 - 0xc0fe -IDEOGRAM 0xc1a1 - 0xc1fe -IDEOGRAM 0xc2a1 - 0xc2fe -IDEOGRAM 0xc3a1 - 0xc3fe -IDEOGRAM 0xc4a1 - 0xc4fe -IDEOGRAM 0xc5a1 - 0xc5fe -IDEOGRAM 0xc6a1 - 0xc6fe -IDEOGRAM 0xc7a1 - 0xc7fe -IDEOGRAM 0xc8a1 - 0xc8fe -IDEOGRAM 0xc9a1 - 0xc9fe -IDEOGRAM 0xcaa1 - 0xcafe -IDEOGRAM 0xcba1 - 0xcbfe -IDEOGRAM 0xcca1 - 0xccfe -IDEOGRAM 0xcda1 - 0xcdfe -IDEOGRAM 0xcea1 - 0xcefe -IDEOGRAM 0xcfa1 - 0xcfd3 -IDEOGRAM 0xd0a1 - 0xd0fe -IDEOGRAM 0xd1a1 - 0xd1fe -IDEOGRAM 0xd2a1 - 0xd2fe -IDEOGRAM 0xd3a1 - 0xd3fe -IDEOGRAM 0xd4a1 - 0xd4fe -IDEOGRAM 0xd5a1 - 0xd5fe -IDEOGRAM 0xd6a1 - 0xd6fe -IDEOGRAM 0xd7a1 - 0xd7fe -IDEOGRAM 0xd8a1 - 0xd8fe -IDEOGRAM 0xd9a1 - 0xd9fe -IDEOGRAM 0xdaa1 - 0xdafe -IDEOGRAM 0xdba1 - 0xdbfe -IDEOGRAM 0xdca1 - 0xdcfe -IDEOGRAM 0xdda1 - 0xddfe -IDEOGRAM 0xdea1 - 0xdefe -IDEOGRAM 0xdfa1 - 0xdffe -IDEOGRAM 0xe0a1 - 0xe0fe -IDEOGRAM 0xe1a1 - 0xe1fe -IDEOGRAM 0xe2a1 - 0xe2fe -IDEOGRAM 0xe3a1 - 0xe3fe -IDEOGRAM 0xe4a1 - 0xe4fe -IDEOGRAM 0xe5a1 - 0xe5fe -IDEOGRAM 0xe6a1 - 0xe6fe -IDEOGRAM 0xe7a1 - 0xe7fe -IDEOGRAM 0xe8a1 - 0xe8fe -IDEOGRAM 0xe9a1 - 0xe9fe -IDEOGRAM 0xeaa1 - 0xeafe -IDEOGRAM 0xeba1 - 0xebfe -IDEOGRAM 0xeca1 - 0xecfe -IDEOGRAM 0xeda1 - 0xedfe -IDEOGRAM 0xeea1 - 0xeefe -IDEOGRAM 0xefa1 - 0xeffe -IDEOGRAM 0xf0a1 - 0xf0fe -IDEOGRAM 0xf1a1 - 0xf1fe -IDEOGRAM 0xf2a1 - 0xf2fe -IDEOGRAM 0xf3a1 - 0xf3fe -IDEOGRAM 0xf4a1 - 0xf4a4 - -/* - * This is for Code Set 3, half-width kana - */ -SPECIAL 0xa1 - 0xdf -PHONOGRAM 0xa1 - 0xdf -CONTROL 0x84 - 0x97 0x9b - 0x9f 0xe0 - 0xfe diff --git a/usr.bin/mklocale/data/lt_LN.ASCII b/usr.bin/mklocale/data/lt_LN.ASCII deleted file mode 100644 index 95cbeeb..0000000 --- a/usr.bin/mklocale/data/lt_LN.ASCII +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Standard LOCALE_CTYPE for the ASCII Locale - */ -ENCODING "NONE" -VARIABLE Strict 7bit ASCII locale - -ALPHA 'A' - 'Z' 'a' - 'z' -CONTROL 0x00 - 0x1f 0x7f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e -LOWER 'a' - 'z' -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e -SPACE 0x09 - 0x0d 0x20 -UPPER 'A' - 'Z' -XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' -PRINT 0x20 - 0x7e -# IDEOGRAM -# SPECIAL -# PHONEGRAM - -MAPLOWER <'A' - 'Z' : 'a'> -MAPLOWER <'a' - 'z' : 'a'> -MAPUPPER <'A' - 'Z' : 'A'> -MAPUPPER <'a' - 'z' : 'A'> -TODIGIT <'0' - '9' : 0> -TODIGIT <'A' - 'F' : 10> -TODIGIT <'a' - 'f' : 10> diff --git a/usr.bin/mklocale/data/lt_LN.ISO8859-1 b/usr.bin/mklocale/data/lt_LN.ISO8859-1 deleted file mode 100644 index 5232ae3..0000000 --- a/usr.bin/mklocale/data/lt_LN.ISO8859-1 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Standard LOCALE_CTYPE for the iso_8859_1 Locale - */ -ENCODING "NONE" -VARIABLE ISO 8859-1 Latin-1 character set - -# -# This is a comment -# -ALPHA 'A' - 'Z' 'a' - 'z' 0xc0 - 0xff -CONTROL 0x00 - 0x1f 0x7f - 0x9f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e 0xa0 - 0xff -LOWER 'a' - 'z' 0xe0 - 0xff -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e 0xa1 - 0xbf -SPACE 0x09 - 0x0d 0x20 0xa0 -UPPER 'A' - 'Z' 0xc0 - 0xde -XDIGIT 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' 0xa0 -PRINT 0x20 - 0x7e 0xa0 - 0xff -# IDEOGRAM -# SPECIAL -# PHONEGRAM - -MAPLOWER <'A' - 'Z' : 'a'> -MAPLOWER <'a' - 'z' : 'a'> -MAPLOWER <0xc0 - 0xdd : 0xe0> -MAPLOWER <0xe0 - 0xff : 0xe0> -MAPUPPER <'A' - 'Z' : 'A'> -MAPUPPER <'a' - 'z' : 'A'> -MAPUPPER <0xc0 - 0xdd : 0xc0> -MAPUPPER <0xe0 - 0xff : 0xc0> -TODIGIT <'0' - '9' : 0> -TODIGIT <'A' - 'F' : 10> -TODIGIT <'a' - 'f' : 10> diff --git a/usr.bin/mklocale/data/lt_LN.ISO_8859-1 b/usr.bin/mklocale/data/lt_LN.ISO_8859-1 deleted file mode 100644 index 5c74641..0000000 --- a/usr.bin/mklocale/data/lt_LN.ISO_8859-1 +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Standard LOCALE_CTYPE for the iso_8859_1 Locale - */ -ENCODING "NONE" -VARIABLE ISO 8859-1 Latin-1 character set - -# -# This is a comment -# -ALPHA 'A' - 'Z' 'a' - 'z' 0xc0 - 0xd6 0xd8 - 0xf6 0xf8 - 0xff -CONTROL 0x00 - 0x1f 0x7f - 0x9f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e 0xa0 - 0xff -LOWER 'a' - 'z' 0xdf - 0xf6 0xf8 - 0xff -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e 0xa1 - 0xbf 0xd7 0xf7 -SPACE 0x09 - 0x0d ' ' 0xa0 -UPPER 'A' - 'Z' 0xc0 - 0xd6 0xd8 - 0xde -XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' -PRINT 0x20 - 0x7e 0xa0 - 0xff -# IDEOGRAM -# SPECIAL -# PHONEGRAM - -MAPLOWER <'A' - 'Z' : 'a'> -MAPLOWER <'a' - 'z' : 'a'> -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 <0xc0 - 0xd6 : 0xc0> -MAPUPPER <0xd8 - 0xde : 0xd8> -MAPUPPER <0xe0 - 0xf6 : 0xc0> -MAPUPPER <0xf8 - 0xfe : 0xd8> -TODIGIT <'0' - '9' : 0> -TODIGIT <'A' - 'F' : 10> -TODIGIT <'a' - 'f' : 10> diff --git a/usr.bin/mklocale/data/ru_SU.CP866 b/usr.bin/mklocale/data/ru_SU.CP866 deleted file mode 100644 index 659482b..0000000 --- a/usr.bin/mklocale/data/ru_SU.CP866 +++ /dev/null @@ -1,42 +0,0 @@ -/* - * LOCALE_CTYPE for Russian Alternative character set (CP866) - */ -ENCODING "NONE" -VARIABLE Russian Alternative charset (CP866) by ache@astral.msk.su - -# -# This is a comment -# -ALPHA 'A' - 'Z' 'a' - 'z' 0x80 - 0xaf 0xe0 - 0xf1 -CONTROL 0x00 - 0x1f 0x7f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e 0x80 - 0xff -LOWER 'a' - 'z' 0xa0 - 0xaf 0xe0 - 0xef 0xf1 -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e -SPACE 0x09 - 0x0d 0x20 -UPPER 'A' - 'Z' 0x80 - 0x9f 0xf0 -XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' -PRINT 0x20 - 0x7e 0x80 - 0xff -# IDEOGRAM -# SPECIAL -# PHONEGRAM - -MAPLOWER <'A' - 'Z' : 'a'> -MAPLOWER <'a' - 'z' : 'a'> -MAPLOWER <0x80 - 0x8f : 0xa0> -MAPLOWER <0x90 - 0x9f : 0xe0> -MAPLOWER <0xf0 0xf1> -MAPLOWER <0xa0 - 0xaf : 0xa0> -MAPLOWER <0xe0 - 0xef : 0xe0> -MAPLOWER <0xf1 0xf1> -MAPUPPER <'A' - 'Z' : 'A'> -MAPUPPER <'a' - 'z' : 'A'> -MAPUPPER <0x80 - 0x9f : 0x80> -MAPUPPER <0xf0 0xf0> -MAPUPPER <0xa0 - 0xaf : 0x80> -MAPUPPER <0xe0 - 0xef : 0x90> -MAPUPPER <0xf1 0xf0> -TODIGIT <'0' - '9' : 0> -TODIGIT <'A' - 'F' : 10> -TODIGIT <'a' - 'f' : 10> diff --git a/usr.bin/mklocale/data/ru_SU.KOI8-R b/usr.bin/mklocale/data/ru_SU.KOI8-R deleted file mode 100644 index 6d9f539..0000000 --- a/usr.bin/mklocale/data/ru_SU.KOI8-R +++ /dev/null @@ -1,39 +0,0 @@ -/* - * LOCALE_CTYPE for Russian koi8-r character set (RFC1489) - */ -ENCODING "NONE" -VARIABLE Russian koi8-r character set by ache@astral.msk.su - -# -# This is a comment -# -ALPHA 'A' - 'Z' 'a' - 'z' 0xa3 0xb3 0xc0 - 0xff -CONTROL 0x00 - 0x1f 0x7f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e 0x80 - 0xff -LOWER 'a' - 'z' 0xa3 0xc0 - 0xdf -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e -SPACE 0x09 - 0x0d 0x20 -UPPER 'A' - 'Z' 0xb3 0xe0 - 0xff -XDIGIT '0' - '9' 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' -PRINT 0x20 - 0x7e 0x80 - 0xff -# IDEOGRAM -# SPECIAL -# PHONEGRAM - -MAPLOWER <'A' - 'Z' : 'a'> -MAPLOWER <'a' - 'z' : 'a'> -MAPLOWER <0xb3 0xa3> -MAPLOWER <0xa3 0xa3> -MAPLOWER <0xe0 - 0xff : 0xc0> -MAPLOWER <0xc0 - 0xdf : 0xc0> -MAPUPPER <'A' - 'Z' : 'A'> -MAPUPPER <'a' - 'z' : 'A'> -MAPUPPER <0xb3 0xb3> -MAPUPPER <0xa3 0xb3> -MAPUPPER <0xe0 - 0xff : 0xe0> -MAPUPPER <0xc0 - 0xdf : 0xe0> -TODIGIT <'0' - '9' : 0> -TODIGIT <'A' - 'F' : 10> -TODIGIT <'a' - 'f' : 10> diff --git a/usr.bin/mklocale/iso_8859_1 b/usr.bin/mklocale/iso_8859_1 deleted file mode 100644 index 5232ae3..0000000 --- a/usr.bin/mklocale/iso_8859_1 +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Standard LOCALE_CTYPE for the iso_8859_1 Locale - */ -ENCODING "NONE" -VARIABLE ISO 8859-1 Latin-1 character set - -# -# This is a comment -# -ALPHA 'A' - 'Z' 'a' - 'z' 0xc0 - 0xff -CONTROL 0x00 - 0x1f 0x7f - 0x9f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e 0xa0 - 0xff -LOWER 'a' - 'z' 0xe0 - 0xff -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e 0xa1 - 0xbf -SPACE 0x09 - 0x0d 0x20 0xa0 -UPPER 'A' - 'Z' 0xc0 - 0xde -XDIGIT 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' 0xa0 -PRINT 0x20 - 0x7e 0xa0 - 0xff -# IDEOGRAM -# SPECIAL -# PHONEGRAM - -MAPLOWER <'A' - 'Z' : 'a'> -MAPLOWER <'a' - 'z' : 'a'> -MAPLOWER <0xc0 - 0xdd : 0xe0> -MAPLOWER <0xe0 - 0xff : 0xe0> -MAPUPPER <'A' - 'Z' : 'A'> -MAPUPPER <'a' - 'z' : 'A'> -MAPUPPER <0xc0 - 0xdd : 0xc0> -MAPUPPER <0xe0 - 0xff : 0xc0> -TODIGIT <'0' - '9' : 0> -TODIGIT <'A' - 'F' : 10> -TODIGIT <'a' - 'f' : 10> diff --git a/usr.bin/mklocale/ja_JP.EUC b/usr.bin/mklocale/ja_JP.EUC deleted file mode 100644 index 55eb155..0000000 --- a/usr.bin/mklocale/ja_JP.EUC +++ /dev/null @@ -1,158 +0,0 @@ -# @(#)Japanese 8.1 (Berkeley) 6/6/93 - -/* - * Japanese LOCALE_CTYPE definitions using EUC of JIS character sets - */ - -ENCODING "EUC" - -/* JIS JIS JIS */ -/* X201 X208 X201 */ -/* 00-7f 84-fe */ - -VARIABLE 1 0x0000 2 0x8080 2 0x0080 3 0x8000 0x8080 - -/* - * Code Set 1 - */ -ALPHA 'A' - 'Z' 'a' - 'z' -CONTROL 0x00 - 0x1f 0x7f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e -LOWER 'a' - 'z' -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e -SPACE 0x09 - 0x0d 0x20 -UPPER 'A' - 'Z' -XDIGIT 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' -PRINT 0x20 - 0x7e - -MAPLOWER < 'A' - 'Z' : 'a' > -MAPLOWER < 'a' - 'z' : 'a' > -MAPUPPER < 'A' - 'Z' : 'A' > -MAPUPPER < 'a' - 'z' : 'A' > -TODIGIT < '0' - '9' : 0 > -TODIGIT < 'A' - 'F' : 10 > -TODIGIT < 'a' - 'f' : 10 > - -/* - * Code Set 2 - */ - -SPACE 0xa1a1 -PHONOGRAM 0xa1bc -SPECIAL 0xa1a2 - 0xa1fe -PUNCT 0xa1a2 - 0xa1f8 /* A few too many in here... */ - -SPECIAL 0xa2a1 - 0xa2ae 0xa2ba - 0xa2c1 0xa2ca - 0xa2d0 0xa2dc - 0xa2ea -SPECIAL 0xa2f2 - 0xa2f9 0xa2fe - -DIGIT 0xa3b0 - 0xa3b9 -UPPER 0xa3c1 - 0xa3da /* Romaji */ -LOWER 0xa3e1 - 0xa3fa /* Romaji */ -MAPLOWER < 0xa3c1 - 0xa3da : 0xa3e1 > /* English */ -MAPLOWER < 0xa3e1 - 0xa3fa : 0xa3e1 > /* English */ -MAPUPPER < 0xa3c1 - 0xa3da : 0xa3c1 > -MAPUPPER < 0xa3e1 - 0xa3fa : 0xa3c1 > - -XDIGIT 0xa3c1 - 0xa3c6 0xa3e1 - 0xa3e6 - -TODIGIT < 0xa3b0 - 0xa3b9 : 0 > -TODIGIT < 0xa3c1 - 0xa3c6 : 10 > -TODIGIT < 0xa3e1 - 0xa3e6 : 10 > - -PHONOGRAM 0xa4a1 - 0xa4f3 -PHONOGRAM 0xa5a1 - 0xa5f6 - -UPPER 0xa6a1 - 0xa6b8 /* Greek */ -LOWER 0xa6c1 - 0xa6d8 /* Greek */ -MAPLOWER < 0xa6a1 - 0xa6b8 : 0xa6c1 > -MAPLOWER < 0xa6c1 - 0xa6d8 : 0xa6c1 > -MAPUPPER < 0xa6a1 - 0xa6b8 : 0xa6a1 > -MAPUPPER < 0xa6c1 - 0xa6d8 : 0xa6a1 > - -UPPER 0xa7a1 - 0xa7c1 /* Cyrillic */ -LOWER 0xa7d1 - 0xa7f1 /* Cyrillic */ -MAPLOWER < 0xa7a1 - 0xa7c1 : 0xa7d1 > -MAPLOWER < 0xa7d1 - 0xa7f1 : 0xa7d1 > -MAPUPPER < 0xa7a1 - 0xa7c1 : 0xa7a1 > -MAPUPPER < 0xa7d1 - 0xa7f1 : 0xa7a1 > - -SPECIAL 0xa8a1 - 0xa8c0 - -IDEOGRAM 0xb0a1 - 0xb0fe -IDEOGRAM 0xb1a1 - 0xb1fe -IDEOGRAM 0xb2a1 - 0xb2fe -IDEOGRAM 0xb3a1 - 0xb3fe -IDEOGRAM 0xb4a1 - 0xb4fe -IDEOGRAM 0xb5a1 - 0xb5fe -IDEOGRAM 0xb6a1 - 0xb6fe -IDEOGRAM 0xb7a1 - 0xb7fe -IDEOGRAM 0xb8a1 - 0xb8fe -IDEOGRAM 0xb9a1 - 0xb9fe -IDEOGRAM 0xbaa1 - 0xbafe -IDEOGRAM 0xbba1 - 0xbbfe -IDEOGRAM 0xbca1 - 0xbcfe -IDEOGRAM 0xbda1 - 0xbdfe -IDEOGRAM 0xbea1 - 0xbefe -IDEOGRAM 0xbfa1 - 0xbffe -IDEOGRAM 0xc0a1 - 0xc0fe -IDEOGRAM 0xc1a1 - 0xc1fe -IDEOGRAM 0xc2a1 - 0xc2fe -IDEOGRAM 0xc3a1 - 0xc3fe -IDEOGRAM 0xc4a1 - 0xc4fe -IDEOGRAM 0xc5a1 - 0xc5fe -IDEOGRAM 0xc6a1 - 0xc6fe -IDEOGRAM 0xc7a1 - 0xc7fe -IDEOGRAM 0xc8a1 - 0xc8fe -IDEOGRAM 0xc9a1 - 0xc9fe -IDEOGRAM 0xcaa1 - 0xcafe -IDEOGRAM 0xcba1 - 0xcbfe -IDEOGRAM 0xcca1 - 0xccfe -IDEOGRAM 0xcda1 - 0xcdfe -IDEOGRAM 0xcea1 - 0xcefe -IDEOGRAM 0xcfa1 - 0xcfd3 -IDEOGRAM 0xd0a1 - 0xd0fe -IDEOGRAM 0xd1a1 - 0xd1fe -IDEOGRAM 0xd2a1 - 0xd2fe -IDEOGRAM 0xd3a1 - 0xd3fe -IDEOGRAM 0xd4a1 - 0xd4fe -IDEOGRAM 0xd5a1 - 0xd5fe -IDEOGRAM 0xd6a1 - 0xd6fe -IDEOGRAM 0xd7a1 - 0xd7fe -IDEOGRAM 0xd8a1 - 0xd8fe -IDEOGRAM 0xd9a1 - 0xd9fe -IDEOGRAM 0xdaa1 - 0xdafe -IDEOGRAM 0xdba1 - 0xdbfe -IDEOGRAM 0xdca1 - 0xdcfe -IDEOGRAM 0xdda1 - 0xddfe -IDEOGRAM 0xdea1 - 0xdefe -IDEOGRAM 0xdfa1 - 0xdffe -IDEOGRAM 0xe0a1 - 0xe0fe -IDEOGRAM 0xe1a1 - 0xe1fe -IDEOGRAM 0xe2a1 - 0xe2fe -IDEOGRAM 0xe3a1 - 0xe3fe -IDEOGRAM 0xe4a1 - 0xe4fe -IDEOGRAM 0xe5a1 - 0xe5fe -IDEOGRAM 0xe6a1 - 0xe6fe -IDEOGRAM 0xe7a1 - 0xe7fe -IDEOGRAM 0xe8a1 - 0xe8fe -IDEOGRAM 0xe9a1 - 0xe9fe -IDEOGRAM 0xeaa1 - 0xeafe -IDEOGRAM 0xeba1 - 0xebfe -IDEOGRAM 0xeca1 - 0xecfe -IDEOGRAM 0xeda1 - 0xedfe -IDEOGRAM 0xeea1 - 0xeefe -IDEOGRAM 0xefa1 - 0xeffe -IDEOGRAM 0xf0a1 - 0xf0fe -IDEOGRAM 0xf1a1 - 0xf1fe -IDEOGRAM 0xf2a1 - 0xf2fe -IDEOGRAM 0xf3a1 - 0xf3fe -IDEOGRAM 0xf4a1 - 0xf4a4 - -/* - * This is for Code Set 3, half-width kana - */ -SPECIAL 0xa1 - 0xdf -PHONOGRAM 0xa1 - 0xdf -CONTROL 0x84 - 0x97 0x9b - 0x9f 0xe0 - 0xfe diff --git a/usr.bin/mklocale/ru_SU.KOI8-R b/usr.bin/mklocale/ru_SU.KOI8-R deleted file mode 100644 index d2164c4..0000000 --- a/usr.bin/mklocale/ru_SU.KOI8-R +++ /dev/null @@ -1,39 +0,0 @@ -/* - * LOCALE_CTYPE for Russian koi8-r character set (RFC1489) - */ -ENCODING "NONE" -VARIABLE Russian koi8-r character set by ache@astral.msk.su - -# -# This is a comment -# -ALPHA 'A' - 'Z' 'a' - 'z' 0xa3 0xb3 0xc0 - 0xff -CONTROL 0x00 - 0x1f 0x7f -DIGIT '0' - '9' -GRAPH 0x21 - 0x7e 0x80 - 0xff -LOWER 'a' - 'z' 0xa3 0xc0 - 0xdf -PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e -SPACE 0x09 - 0x0d 0x20 -UPPER 'A' - 'Z' 0xb3 0xe0 - 0xff -XDIGIT 'a' - 'f' 'A' - 'F' -BLANK ' ' '\t' -PRINT 0x20 - 0x7e 0x80 - 0xff -# IDEOGRAM -# SPECIAL -# PHONEGRAM - -MAPLOWER <'A' - 'Z' : 'a'> -MAPLOWER <'a' - 'z' : 'a'> -MAPLOWER <0xb3 0xa3> -MAPLOWER <0xa3 0xa3> -MAPLOWER <0xe0 - 0xff : 0xc0> -MAPLOWER <0xc0 - 0xdf : 0xc0> -MAPUPPER <'A' - 'Z' : 'A'> -MAPUPPER <'a' - 'z' : 'A'> -MAPUPPER <0xb3 0xb3> -MAPUPPER <0xa3 0xb3> -MAPUPPER <0xe0 - 0xff : 0xe0> -MAPUPPER <0xc0 - 0xdf : 0xe0> -TODIGIT <'0' - '9' : 0> -TODIGIT <'A' - 'F' : 10> -TODIGIT <'a' - 'f' : 10> diff --git a/usr.bin/passwd/yppasswd.1 b/usr.bin/passwd/yppasswd.1 deleted file mode 100644 index 7004490..0000000 --- a/usr.bin/passwd/yppasswd.1 +++ /dev/null @@ -1,115 +0,0 @@ -.\" -.\" Manpage Copyright 1994 Olaf Kirch, <okir@monad.swb.de> -.\" -.Dd 18 December 1994 -.Dt YPPASSWD 1 -.Os FreeBSD 2.x -.Sh NAME -.Nm yppasswd, ypchpass, ypchfn, ypchsh -.Nd modify a user's NIS password data -.Sh SYNOPSIS -.Nm yppasswd -.Op Fl f -.Op Fl s -.Op Ar user -.Nm ypchpass -.Op Ar user -.Nm ypchfn -.Op Ar user -.Nm ypchsh -.Op Ar user -.Sh DESCRIPTION -When distributing your users' passwords over NIS (a.k.a. YP), the standard -.Nm passwd , -.Nm chpass , -.Nm chfn , and -.Nm chsh -utilities cannot be -used anymore to let a user change her password, because they only modify -the password file on the local host. They are usually replaced by their -YP counterparts, \fByppasswd\fP, \fBypchpass\fP, \fBypchfn\fP and \fBypchsh\fP. -.Pp -These commands are in fact the very same program, linked to different names. -Using the command line switches, you can choose whether to update your -password, your login shell (\fB-s\fP), or your GECOS field -information (\fB-f\fP), or a combination of them. \fBchfn\fP and -\fByppasswd\fP \fB-f\fP are equivalent, as are \fBchsh\fP and -\fByppasswd\fP \fB-s\fP. -.Pp -When invoked without the \fIuser\fP argument, the account information for -the invoking user will be updated, otherwise that of \fIuser\fP will be -updated. This option is only available to the superuser. -.Pp -All tools will first prompt the user for the current NIS password needed -for authentication with the \fByppasswdd\fP daemon. Subsequently, the -program prompts for the updated information: -.\" -.\" -.Pp "\fByppasswd\fP -Change the user's NIS password. The user is prompted for the new password. -While typing the password, echoing is turned off, so the password does not -appear on the screen. An empty password is rejected, as are passwords shorter -than six characters. The user will then be requested to retype the -password to make sure it wasn't misspelled the first time. -.\" -.\" -.Pp "\fBypchsh\fP or \fB-s\fP -Change the user's login shell. The user is prompted for a new shell, -offering the old one as default: -.Pp -.in +2n -.ft B -.nf -Login shell [/bin/bash]: _ -.fi -.ft -.in -.Pp -To accept the default, simply press return. To clear the shell field in -your \fBpasswd\fP file entry (so that the system's default shell is selected), -enter the string \fInone\fP. -.\" -.\" -.Pp "\fBypchfn\fP or \fB-f\fP -Change the user's full name and related information. Traditionally, some -applications expect the GECOS field (field 4) of the \fBpasswd\fP file to -contain the user's real name (as opposed to the login name) plus some -additional information like the office phone number. This information is -displayed by \fBfinger(1)\fP and probably some other tools, too. -.Pp -When setting the full name, \fBypchfn\fP displays the following prompts, -with the defaults in brackets: -.Pp -.in +2n -.ft B -.nf -Name [Joe Doe]: -Location [2nd floor, bldg 34]: -Office Phone [12345]: -Home Phone []: -.fi -.ft -.in -.Pp -To accept a default, simply press return. To clear a field, enter the string -\fInone\fP. -.Sh LICENSE -This program is a heavily beefed-up version of Theo de Raadt's \fByppasswd\fP -client, which is covered by the BSD license. Therefore, the BSD license -applies to this program as well. - -.Sh SEE ALSO -.Xr finger 1 , -.Xr passwd 5 , -.Xr passwd 1 , -.Xr yppasswdd 8 . -.Sh AUTHOR -Theo de Raadt <deraadt@fsa.ca> (original client) -.br -Olaf Kirch <okir@monad.swb.de> (heavy modifications and manpages) -.br -Bill Paul <wpaul@ctr.columbia.edu> (port to FreeBSD and merger with -.Xr passwd 1 -.Sh NOTES -All these commands are really only symbolic links to -.Xr passwd 1 diff --git a/usr.bin/timedef/data/ru_SU.KOI8-R b/usr.bin/timedef/data/ru_SU.KOI8-R deleted file mode 100644 index e7a869f..0000000 --- a/usr.bin/timedef/data/ru_SU.KOI8-R +++ /dev/null @@ -1,76 +0,0 @@ -# WARNING: spaces may be essential at the end of lines -# WARNING: empty lines are essential too -# -# Short months names -# - - - - - - - - - - - - -# -# Long months names -# - - - - - - - - - - - - -# -# Short weekdays names -# - - - - - - - -# -# Long weekdays names -# - - - - - - - -# -# X_fmt -# -%H:%M:%S -# -# x_fmt -# -%d.%m.%y -# -# c_fmt -# -%x %X -# -# am -# - -# -# pm -# - -# -# date_fmt -# -%a %e %b %H:%M:%S %Z %Y diff --git a/usr.bin/tip/pathnames.h b/usr.bin/tip/pathnames.h deleted file mode 100644 index fae04cb..0000000 --- a/usr.bin/tip/pathnames.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * 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. - * - * @(#)pathnames.h 8.1 (Berkeley) 6/6/93 - */ - -#include <paths.h> - -#define _PATH_ACULOG "/var/log/aculog" -#define _PATH_LOCKDIRNAME "/var/spool/lock/LCK..%s" -#ifdef notdef -#define _PATH_LOCKDIRNAME "/var/spool/uucp/LCK/LCK..%s" -#endif -#define _PATH_PHONES "/etc/phones" -#define _PATH_REMOTE "/etc/remote" diff --git a/usr.bin/tip/tip.c b/usr.bin/tip/tip.c deleted file mode 100644 index 0d84e75..0000000 --- a/usr.bin/tip/tip.c +++ /dev/null @@ -1,608 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * 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 char copyright[] = -"@(#) Copyright (c) 1983, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)tip.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - -/* - * tip - UNIX link to other systems - * tip [-v] [-speed] system-name - * or - * cu phone-number [-s speed] [-l line] [-a acu] - */ -#include "tip.h" -#include "pathnames.h" - -/* - * Baud rate mapping table - */ -int bauds[] = { - 0, 50, 75, 110, 134, 150, 200, 300, 600, - 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, -1 -}; - -int disc = OTTYDISC; /* tip normally runs this way */ -void intprompt(); -void timeout(); -void cleanup(); -void tipdone(); -char *sname(); -char PNbuf[256]; /* This limits the size of a number */ - -main(argc, argv) - char *argv[]; -{ - char *system = NOSTR; - register int i; - register char *p; - char sbuf[12]; - - gid = getgid(); - egid = getegid(); - uid = getuid(); - euid = geteuid(); - if (equal(sname(argv[0]), "cu")) { - cumode = 1; - cumain(argc, argv); - goto cucommon; - } - - if (argc > 4) { - fprintf(stderr, "usage: tip [-v] [-speed] [system-name]\n"); - exit(1); - } - if (!isatty(0)) { - fprintf(stderr, "tip: must be interactive\n"); - exit(1); - } - - for (; argc > 1; argv++, argc--) { - if (argv[1][0] != '-') - system = argv[1]; - else switch (argv[1][1]) { - - case 'v': - vflag++; - break; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - BR = atoi(&argv[1][1]); - break; - - default: - fprintf(stderr, "tip: %s, unknown option\n", argv[1]); - break; - } - } - - if (system == NOSTR) - goto notnumber; - if (isalpha(*system)) - goto notnumber; - /* - * System name is really a phone number... - * Copy the number then stomp on the original (in case the number - * is private, we don't want 'ps' or 'w' to find it). - */ - if (strlen(system) > sizeof PNbuf - 1) { - fprintf(stderr, "tip: phone number too long (max = %d bytes)\n", - sizeof PNbuf - 1); - exit(1); - } - strncpy( PNbuf, system, sizeof PNbuf - 1 ); - for (p = system; *p; p++) - *p = '\0'; - PN = PNbuf; - (void)sprintf(sbuf, "tip%d", BR); - system = sbuf; - -notnumber: - (void)signal(SIGINT, cleanup); - (void)signal(SIGQUIT, cleanup); - (void)signal(SIGHUP, cleanup); - (void)signal(SIGTERM, cleanup); - (void)signal(SIGUSR1, tipdone); - - if ((i = hunt(system)) == 0) { - printf("all ports busy\n"); - exit(3); - } - if (i == -1) { - printf("link down\n"); - (void)uu_unlock(uucplock); - exit(3); - } - setbuf(stdout, NULL); - loginit(); - - /* - * Kludge, their's no easy way to get the initialization - * in the right order, so force it here - */ - if ((PH = getenv("PHONES")) == NOSTR) - PH = _PATH_PHONES; - vinit(); /* init variables */ - setparity("even"); /* set the parity table */ - if ((i = speed(number(value(BAUDRATE)))) == NULL) { - printf("tip: bad baud rate %d\n", number(value(BAUDRATE))); - (void)uu_unlock(uucplock); - exit(3); - } - - /* - * Now that we have the logfile and the ACU open - * return to the real uid and gid. These things will - * be closed on exit. Swap real and effective uid's - * so we can get the original permissions back - * for removing the uucp lock. - */ - user_uid(); - - /* - * Hardwired connections require the - * line speed set before they make any transmissions - * (this is particularly true of things like a DF03-AC) - */ - if (HW) - ttysetup(i); - if (p = connect()) { - printf("\07%s\n[EOT]\n", p); - daemon_uid(); - (void)uu_unlock(uucplock); - exit(1); - } - if (!HW) - ttysetup(i); -cucommon: - /* - * From here down the code is shared with - * the "cu" version of tip. - */ - - ioctl(0, TIOCGETP, (char *)&defarg); - ioctl(0, TIOCGETC, (char *)&defchars); - ioctl(0, TIOCGLTC, (char *)&deflchars); - ioctl(0, TIOCGETD, (char *)&odisc); - arg = defarg; - arg.sg_flags = ANYP | CBREAK; - tchars = defchars; - tchars.t_intrc = tchars.t_quitc = -1; - ltchars = deflchars; - ltchars.t_suspc = ltchars.t_dsuspc = ltchars.t_flushc - = ltchars.t_lnextc = -1; - raw(); - - pipe(fildes); pipe(repdes); - (void)signal(SIGALRM, timeout); - - /* - * Everything's set up now: - * connection established (hardwired or dialup) - * line conditioned (baud rate, mode, etc.) - * internal data structures (variables) - * so, fork one process for local side and one for remote. - */ - printf(cumode ? "Connected\r\n" : "\07connected\r\n"); - if (pid = fork()) - tipin(); - else - tipout(); - /*NOTREACHED*/ -} - -void -cleanup() -{ - - daemon_uid(); - (void)uu_unlock(uucplock); - if (odisc) - ioctl(0, TIOCSETD, (char *)&odisc); - exit(0); -} - -void -tipdone() -{ - tipabort("Hangup."); -} -/* - * Muck with user ID's. We are setuid to the owner of the lock - * directory when we start. user_uid() reverses real and effective - * ID's after startup, to run with the user's permissions. - * daemon_uid() switches back to the privileged uid for unlocking. - * Finally, to avoid running a shell with the wrong real uid, - * shell_uid() sets real and effective uid's to the user's real ID. - */ -static int uidswapped; - -user_uid() -{ - if (uidswapped == 0) { - seteuid(uid); - uidswapped = 1; - } -} - -daemon_uid() -{ - - if (uidswapped) { - seteuid(euid); - uidswapped = 0; - } -} - -shell_uid() -{ - - seteuid(uid); -} - -/* - * put the controlling keyboard into raw mode - */ -raw() -{ - - ioctl(0, TIOCSETP, &arg); - ioctl(0, TIOCSETC, &tchars); - ioctl(0, TIOCSLTC, <chars); - ioctl(0, TIOCSETD, (char *)&disc); -} - - -/* - * return keyboard to normal mode - */ -unraw() -{ - - ioctl(0, TIOCSETD, (char *)&odisc); - ioctl(0, TIOCSETP, (char *)&defarg); - ioctl(0, TIOCSETC, (char *)&defchars); - ioctl(0, TIOCSLTC, (char *)&deflchars); -} - -static jmp_buf promptbuf; - -/* - * Print string ``s'', then read a string - * in from the terminal. Handles signals & allows use of - * normal erase and kill characters. - */ -prompt(s, p) - char *s; - register char *p; -{ - register char *b = p; - sig_t oint, oquit; - - stoprompt = 0; - oint = signal(SIGINT, intprompt); - oquit = signal(SIGQUIT, SIG_IGN); - unraw(); - printf("%s", s); - if (setjmp(promptbuf) == 0) - while ((*p = getchar()) != EOF && *p != '\n') - p++; - *p = '\0'; - - raw(); - (void)signal(SIGINT, oint); - (void)signal(SIGQUIT, oquit); - return (stoprompt || p == b); -} - -/* - * Interrupt service routine during prompting - */ -void -intprompt() -{ - - (void)signal(SIGINT, SIG_IGN); - stoprompt = 1; - printf("\r\n"); - longjmp(promptbuf, 1); -} - -/* - * ****TIPIN TIPIN**** - */ -tipin() -{ - char gch, bol = 1; - - /* - * Kinda klugey here... - * check for scripting being turned on from the .tiprc file, - * but be careful about just using setscript(), as we may - * send a SIGEMT before tipout has a chance to set up catching - * it; so wait a second, then setscript() - */ - if (boolean(value(SCRIPT))) { - sleep(1); - setscript(); - } - - while (1) { - gch = getchar()&0177; - if ((gch == character(value(ESCAPE))) && bol) { - if (!(gch = escape())) - continue; - } else if (!cumode && gch == character(value(RAISECHAR))) { - boolean(value(RAISE)) = !boolean(value(RAISE)); - continue; - } else if (gch == '\r') { - bol = 1; - pwrite(FD, &gch, 1); - if (boolean(value(HALFDUPLEX))) - printf("\r\n"); - continue; - } else if (!cumode && gch == character(value(FORCE))) - gch = getchar()&0177; - bol = any(gch, value(EOL)); - if (boolean(value(RAISE)) && islower(gch)) - gch = toupper(gch); - pwrite(FD, &gch, 1); - if (boolean(value(HALFDUPLEX))) - printf("%c", gch); - } -} - -extern esctable_t etable[]; - -/* - * Escape handler -- - * called on recognition of ``escapec'' at the beginning of a line - */ -escape() -{ - register char gch; - register esctable_t *p; - char c = character(value(ESCAPE)); - - gch = (getchar()&0177); - for (p = etable; p->e_char; p++) - if (p->e_char == gch) { - if ((p->e_flags&PRIV) && uid) - continue; - printf("%s", ctrl(c)); - (*p->e_func)(gch); - return (0); - } - /* ESCAPE ESCAPE forces ESCAPE */ - if (c != gch) - pwrite(FD, &c, 1); - return (gch); -} - -speed(n) - int n; -{ - register int *p; - - for (p = bauds; *p != -1; p++) - if (*p == n) - return (p - bauds); - return (NULL); -} - -any(c, p) - register char c, *p; -{ - while (p && *p) - if (*p++ == c) - return (1); - return (0); -} - -size(s) - register char *s; -{ - register int i = 0; - - while (s && *s++) - i++; - return (i); -} - -char * -interp(s) - register char *s; -{ - static char buf[256]; - register char *p = buf, c, *q; - - while (c = *s++) { - for (q = "\nn\rr\tt\ff\033E\bb"; *q; q++) - if (*q++ == c) { - *p++ = '\\'; *p++ = *q; - goto next; - } - if (c < 040) { - *p++ = '^'; *p++ = c + 'A'-1; - } else if (c == 0177) { - *p++ = '^'; *p++ = '?'; - } else - *p++ = c; - next: - ; - } - *p = '\0'; - return (buf); -} - -char * -ctrl(c) - char c; -{ - static char s[3]; - - if (c < 040 || c == 0177) { - s[0] = '^'; - s[1] = c == 0177 ? '?' : c+'A'-1; - s[2] = '\0'; - } else { - s[0] = c; - s[1] = '\0'; - } - return (s); -} - -/* - * Help command - */ -help(c) - char c; -{ - register esctable_t *p; - - printf("%c\r\n", c); - for (p = etable; p->e_char; p++) { - if ((p->e_flags&PRIV) && uid) - continue; - printf("%2s", ctrl(character(value(ESCAPE)))); - printf("%-2s %c %s\r\n", ctrl(p->e_char), - p->e_flags&EXP ? '*': ' ', p->e_help); - } -} - -/* - * Set up the "remote" tty's state - */ -ttysetup(speed) - int speed; -{ - unsigned bits = LDECCTQ; - - arg.sg_ispeed = arg.sg_ospeed = speed; - arg.sg_flags = RAW; - if (boolean(value(TAND))) - arg.sg_flags |= TANDEM; - ioctl(FD, TIOCSETP, (char *)&arg); - ioctl(FD, TIOCLBIS, (char *)&bits); -} - -/* - * Return "simple" name from a file name, - * strip leading directories. - */ -char * -sname(s) - register char *s; -{ - register char *p = s; - - while (*s) - if (*s++ == '/') - p = s; - return (p); -} - -static char partab[0200]; -static int bits8; - -/* - * Do a write to the remote machine with the correct parity. - * We are doing 8 bit wide output, so we just generate a character - * with the right parity and output it. - */ -pwrite(fd, buf, n) - int fd; - char *buf; - register int n; -{ - register int i; - register char *bp; - extern int errno; - - bp = buf; - if (bits8 == 0) - for (i = 0; i < n; i++) { - *bp = partab[(*bp) & 0177]; - bp++; - } - if (write(fd, buf, n) < 0) { - if (errno == EIO) - tipabort("Lost carrier."); - if (errno == ENODEV) - tipabort("tty not available."); - /* this is questionable */ - perror("write"); - } -} - -/* - * Build a parity table with appropriate high-order bit. - */ -setparity(defparity) - char *defparity; -{ - register int i, flip, clr, set; - char *parity; - extern char evenpartab[]; - - if (value(PARITY) == NOSTR) - value(PARITY) = defparity; - parity = value(PARITY); - if (equal(parity, "none")) { - bits8 = 1; - return; - } - bits8 = 0; - flip = 0; - clr = 0377; - set = 0; - if (equal(parity, "odd")) - flip = 0200; /* reverse bit 7 */ - else if (equal(parity, "zero")) - clr = 0177; /* turn off bit 7 */ - else if (equal(parity, "one")) - set = 0200; /* turn on bit 7 */ - else if (!equal(parity, "even")) { - (void) fprintf(stderr, "%s: unknown parity value\r\n", parity); - (void) fflush(stderr); - } - for (i = 0; i < 0200; i++) - partab[i] = evenpartab[i] ^ flip | set & clr; -} diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h deleted file mode 100644 index f1b833d..0000000 --- a/usr.bin/tip/tip.h +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * 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. - * - * @(#)tip.h 8.1 (Berkeley) 6/6/93 - */ - -/* - * tip - terminal interface program - */ - -#include <sys/types.h> -#include <machine/endian.h> -#include <sys/file.h> -#include <sys/time.h> - -#include <sgtty.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <pwd.h> -#include <ctype.h> -#include <setjmp.h> -#include <unistd.h> -#include <errno.h> - -/* - * Remote host attributes - */ -char *DV; /* UNIX device(s) to open */ -char *EL; /* chars marking an EOL */ -char *CM; /* initial connection message */ -char *IE; /* EOT to expect on input */ -char *OE; /* EOT to send to complete FT */ -char *CU; /* call unit if making a phone call */ -char *AT; /* acu type */ -char *PN; /* phone number(s) */ -char *DI; /* disconnect string */ -char *PA; /* parity to be generated */ - -char *PH; /* phone number file */ -char *RM; /* remote file name */ -char *HO; /* host name */ - -long BR; /* line speed for conversation */ -long FS; /* frame size for transfers */ - -char DU; /* this host is dialed up */ -char HW; /* this device is hardwired, see hunt.c */ -char *ES; /* escape character */ -char *EX; /* exceptions */ -char *FO; /* force (literal next) char*/ -char *RC; /* raise character */ -char *RE; /* script record file */ -char *PR; /* remote prompt */ -long DL; /* line delay for file transfers to remote */ -long CL; /* char delay for file transfers to remote */ -long ET; /* echocheck timeout */ -char HD; /* this host is half duplex - do local echo */ - -/* - * String value table - */ -typedef - struct { - char *v_name; /* whose name is it */ - char v_type; /* for interpreting set's */ - char v_access; /* protection of touchy ones */ - char *v_abrev; /* possible abreviation */ - char *v_value; /* casted to a union later */ - } - value_t; - -#define STRING 01 /* string valued */ -#define BOOL 02 /* true-false value */ -#define NUMBER 04 /* numeric value */ -#define CHAR 010 /* character value */ - -#define WRITE 01 /* write access to variable */ -#define READ 02 /* read access */ - -#define CHANGED 01 /* low bit is used to show modification */ -#define PUBLIC 1 /* public access rights */ -#define PRIVATE 03 /* private to definer */ -#define ROOT 05 /* root defined */ - -#define TRUE 1 -#define FALSE 0 - -#define ENVIRON 020 /* initialize out of the environment */ -#define IREMOTE 040 /* initialize out of remote structure */ -#define INIT 0100 /* static data space used for initialization */ -#define TMASK 017 - -/* - * Definition of ACU line description - */ -typedef - struct { - char *acu_name; - int (*acu_dialer)(); - int (*acu_disconnect)(); - int (*acu_abort)(); - } - acu_t; - -#define equal(a, b) (strcmp(a,b)==0)/* A nice function to string compare */ - -/* - * variable manipulation stuff -- - * if we defined the value entry in value_t, then we couldn't - * initialize it in vars.c, so we cast it as needed to keep lint - * happy. - */ -typedef - union { - int zz_number; - short zz_boolean[2]; - char zz_character[4]; - int *zz_address; - } - zzhack; - -#define value(v) vtable[v].v_value - -#define number(v) ((((zzhack *)(&(v))))->zz_number) - -#if BYTE_ORDER == LITTLE_ENDIAN -#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean[0]) -#define character(v) ((((zzhack *)(&(v))))->zz_character[0]) -#endif - -#if BYTE_ORDER == BIG_ENDIAN -#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean[1]) -#define character(v) ((((zzhack *)(&(v))))->zz_character[3]) -#endif - -#define address(v) ((((zzhack *)(&(v))))->zz_address) - -/* - * Escape command table definitions -- - * lookup in this table is performed when ``escapec'' is recognized - * at the begining of a line (as defined by the eolmarks variable). -*/ - -typedef - struct { - char e_char; /* char to match on */ - char e_flags; /* experimental, priviledged */ - char *e_help; /* help string */ - int (*e_func)(); /* command */ - } - esctable_t; - -#define NORM 00 /* normal protection, execute anyone */ -#define EXP 01 /* experimental, mark it with a `*' on help */ -#define PRIV 02 /* priviledged, root execute only */ - -extern int vflag; /* verbose during reading of .tiprc file */ -extern value_t vtable[]; /* variable table */ - -#ifndef ACULOG -#define logent(a, b, c, d) -#define loginit() -#endif - -/* - * Definition of indices into variable table so - * value(DEFINE) turns into a static address. - */ - -#define BEAUTIFY 0 -#define BAUDRATE 1 -#define DIALTIMEOUT 2 -#define EOFREAD 3 -#define EOFWRITE 4 -#define EOL 5 -#define ESCAPE 6 -#define EXCEPTIONS 7 -#define FORCE 8 -#define FRAMESIZE 9 -#define HOST 10 -#define LOG 11 -#define PHONES 12 -#define PROMPT 13 -#define RAISE 14 -#define RAISECHAR 15 -#define RECORD 16 -#define REMOTE 17 -#define SCRIPT 18 -#define TABEXPAND 19 -#define VERBOSE 20 -#define SHELL 21 -#define HOME 22 -#define ECHOCHECK 23 -#define DISCONNECT 24 -#define TAND 25 -#define LDELAY 26 -#define CDELAY 27 -#define ETIMEOUT 28 -#define RAWFTP 29 -#define HALFDUPLEX 30 -#define LECHO 31 -#define PARITY 32 - -#define NOVAL ((value_t *)NULL) -#define NOACU ((acu_t *)NULL) -#define NOSTR ((char *)NULL) -#define NOFILE ((FILE *)NULL) -#define NOPWD ((struct passwd *)0) - -struct sgttyb arg; /* current mode of local terminal */ -struct sgttyb defarg; /* initial mode of local terminal */ -struct tchars tchars; /* current state of terminal */ -struct tchars defchars; /* initial state of terminal */ -struct ltchars ltchars; /* current local characters of terminal */ -struct ltchars deflchars; /* initial local characters of terminal */ - -FILE *fscript; /* FILE for scripting */ - -int fildes[2]; /* file transfer synchronization channel */ -int repdes[2]; /* read process sychronization channel */ -int FD; /* open file descriptor to remote host */ -int AC; /* open file descriptor to dialer (v831 only) */ -int vflag; /* print .tiprc initialization sequence */ -int sfd; /* for ~< operation */ -int pid; /* pid of tipout */ -uid_t uid, euid; /* real and effective user id's */ -gid_t gid, egid; /* real and effective group id's */ -int stop; /* stop transfer session flag */ -int quit; /* same; but on other end */ -int intflag; /* recognized interrupt */ -int stoprompt; /* for interrupting a prompt session */ -int timedout; /* ~> transfer timedout */ -int cumode; /* simulating the "cu" program */ - -char fname[80]; /* file name buffer for ~< */ -char copyname[80]; /* file name buffer for ~> */ -char ccc; /* synchronization character */ -char ch; /* for tipout */ -char *uucplock; /* name of lock file for uucp's */ - -int odisc; /* initial tty line discipline */ -extern int disc; /* current tty discpline */ - -extern char *ctrl(); -extern char *vinterp(); -extern char *connect(); - -int tipabort __P((char *)); diff --git a/usr.bin/tip/tipout.c b/usr.bin/tip/tipout.c deleted file mode 100644 index 246cfb7..0000000 --- a/usr.bin/tip/tipout.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * 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 char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - -#include "tip.h" -/* - * tip - * - * lower fork of tip -- handles passive side - * reading from the remote host - */ - -static jmp_buf sigbuf; - -/* - * TIPOUT wait state routine -- - * sent by TIPIN when it wants to posses the remote host - */ -void -intIOT() -{ - - write(repdes[1],&ccc,1); - read(fildes[0], &ccc,1); - longjmp(sigbuf, 1); -} - -/* - * Scripting command interpreter -- - * accepts script file name over the pipe and acts accordingly - */ -void -intEMT() -{ - char c, line[256]; - register char *pline = line; - char reply; - - read(fildes[0], &c, 1); - while (c != '\n') { - *pline++ = c; - read(fildes[0], &c, 1); - } - *pline = '\0'; - if (boolean(value(SCRIPT)) && fscript != NULL) - fclose(fscript); - if (pline == line) { - boolean(value(SCRIPT)) = FALSE; - reply = 'y'; - } else { - if ((fscript = fopen(line, "a")) == NULL) - reply = 'n'; - else { - reply = 'y'; - boolean(value(SCRIPT)) = TRUE; - } - } - write(repdes[1], &reply, 1); - longjmp(sigbuf, 1); -} - -void -intTERM() -{ - - if (boolean(value(SCRIPT)) && fscript != NULL) - fclose(fscript); - exit(0); -} - -void -intSYS() -{ - - boolean(value(BEAUTIFY)) = !boolean(value(BEAUTIFY)); - longjmp(sigbuf, 1); -} - -/* - * ****TIPOUT TIPOUT**** - */ -tipout() -{ - char buf[BUFSIZ]; - register char *cp; - register int cnt; - extern int errno; - int omask; - - signal(SIGINT, SIG_IGN); - signal(SIGQUIT, SIG_IGN); - signal(SIGEMT, intEMT); /* attention from TIPIN */ - signal(SIGTERM, intTERM); /* time to go signal */ - signal(SIGIOT, intIOT); /* scripting going on signal */ - signal(SIGHUP, intTERM); /* for dial-ups */ - signal(SIGSYS, intSYS); /* beautify toggle */ - (void) setjmp(sigbuf); - for (omask = 0;; sigsetmask(omask)) { - cnt = read(FD, buf, BUFSIZ); - if (cnt <= 0) { - /* lost carrier */ - if (cnt < 0 && errno == EIO) { - sigblock(sigmask(SIGTERM)); - intTERM(); - /*NOTREACHED*/ - } else if (cnt == 0 && errno == ENOENT) { - kill(getppid(),SIGUSR1); - sigblock(sigmask(SIGTERM)); - intTERM(); - /*NOTREACHED*/ - } else { - printf("%d %d\r",cnt,errno); - fflush(stdout); - } - continue; - } -#define ALLSIGS sigmask(SIGEMT)|sigmask(SIGTERM)|sigmask(SIGIOT)|sigmask(SIGSYS) - omask = sigblock(ALLSIGS); - for (cp = buf; cp < buf + cnt; cp++) - *cp &= 0177; - write(1, buf, cnt); - if (boolean(value(SCRIPT)) && fscript != NULL) { - if (!boolean(value(BEAUTIFY))) { - fwrite(buf, 1, cnt, fscript); - continue; - } - for (cp = buf; cp < buf + cnt; cp++) - if ((*cp >= ' ' && *cp <= '~') || - any(*cp, value(EXCEPTIONS))) - putc(*cp, fscript); - } - } -} diff --git a/usr.bin/tip/uucplock.c b/usr.bin/tip/uucplock.c deleted file mode 100644 index 917d812..0000000 --- a/usr.bin/tip/uucplock.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 1988, 1993 - * 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 char sccsid[] = "@(#)uucplock.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - -#include <sys/types.h> -#include <sys/file.h> -#include <sys/dir.h> -#include <errno.h> -#include <unistd.h> -#include <stdio.h> -#include "pathnames.h" - -/* - * uucp style locking routines - * return: 0 - success - * -1 - failure - */ - -uu_lock(ttyname) - char *ttyname; -{ - int fd, pid; - char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN]; - FILE *ff; - - (void)sprintf(tbuf, _PATH_LOCKDIRNAME, ttyname); - fd = open(tbuf, O_WRONLY|O_CREAT|O_EXCL, 0644); - if (fd >= 0) - ff = fdopen(fd, "w"); - if (fd < 0 || ff == NULL) { - /* - * file is already locked - * check to see if the process holding the lock still exists - */ - ff = fopen(tbuf, "r+"); - if (ff == NULL) { - perror("lock open"); - return(-1); - } - if (fscanf(ff, "%10d\n", &pid) != 1) { - perror("lock read"); - (void)fclose(ff); - return(-1); - } - - if (kill(pid, 0) == 0 || errno != ESRCH) { - (void)fclose(ff); /* process is still running */ - return(-1); - } - /* - * The process that locked the file isn't running, so - * we'll lock it ourselves - */ - rewind(ff); - /* fall out and finish the locking process */ - } - (void)fprintf(ff, "%10d\n", getpid()); - (void)fclose(ff); - return(0); -} - -uu_unlock(ttyname) - char *ttyname; -{ - char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN]; - - (void)sprintf(tbuf, _PATH_LOCKDIRNAME, ttyname); - return(unlink(tbuf)); -} diff --git a/usr.bin/uucp/acucntrl/Makefile b/usr.bin/uucp/acucntrl/Makefile deleted file mode 100644 index 8a2b44f..0000000 --- a/usr.bin/uucp/acucntrl/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 - -PROG= acucntrl -CFLAGS+=-I${.CURDIR}/../includes -BINDIR= ${LIBDIR} -BINOWN= root -BINMODE=6550 -MAN8= acucntrl.8 - -.include <bsd.prog.mk> diff --git a/usr.bin/uucp/acucntrl/acucntrl.8 b/usr.bin/uucp/acucntrl/acucntrl.8 deleted file mode 100644 index b2b7f0e..0000000 --- a/usr.bin/uucp/acucntrl/acucntrl.8 +++ /dev/null @@ -1,164 +0,0 @@ -.\" Copyright (c) 1985, 1993 -.\" 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. -.\" -.\" @(#)acucntrl.8 8.2 (Berkeley) 12/11/93 -.\" -.TH ACUCNTRL 8 "December 11, 1993" -.UC 6 -.SH NAME -acucntrl \- turn around tty line between dialin and dialout -.SH SYNOPSIS -.B /usr/lib/uucp/acucntrl -keyword ttyline -.SH DESCRIPTION -.PP -.I Acucntrl -turns around the terminal line, -enabling it to be used for both dialin and dialout. -On dialin a terminal line is assumed to have modem control enabled and a getty -process in existence waiting for logins. On dialout modem control is disabled -and there is no getty process. -.PP -This program must be run setuid to root. -.PP -.I keyword -is chosen from the list: -.I disable -or -.IR dialout , -to condition a line for dialout; -and -.I enable -or -.IR dialin , -to condition a line for dialin. -.PP -When the line is conditioned for dialing out, the login name of the real uid -of the process is placed in /etc/utmp in capitals. -This declares that the line is in use and acts as an additional locking -mechanism. -.I Acucntrl -will refuse to act if the /etc/utmp entry for the line is not null, -is not the the user's login name (capitalized or not), -and if the process is not running as the superuser. -The last condition is to allow the superuser to clear the state of the line. -.PP -Turning modem control on or off is handled by poking into /dev/kmem. -It is currently implemented for dz, dh, and dmf lines. -.PP -Under 4.2 BSD the program will also refuse to disable a line if carrier is -sensed on it. This is to avoid the dead period where someone has just dialed -in and made the connection but has not yet logged in. -.PP -.I Ttyline -can be either of the form tty* or /dev/tty*. -Enabling/disabling a line whose name does not begin with ttyd? is prohibited -unless the real uid of the process is 0 or if the login name corresponding to -the real uid is uucp. This is a security precaution. -.PP -Steps taken when disabling -.RI ( i . e . -setup for dialing out) -.IP 1) -check input arguments -.IP 2) -look in /etc/utmp to check that the line is not in use by another user -.IP 3) -disable modem control on line -.IP 4) -check for carrier on device -.IP 5) -change owner of device to real uid -.IP 6) -edit /etc/ttys, changing the first character of the appropriate line to 0 -.IP 7) -send a hangup to process 1 to poke init to disable getty -.IP 8) -post uid name in capitals in /etc/utmp to let world know device has been grabbed -.IP 9) -make sure that DTR is on -.PP -Steps taken when enabling -.RI ( i . e . -setup for dialing in) -.IP 1) -check input arguments -.IP 2) -look in /etc/utmp to check that the line is not in use by another user -.IP 3) -make sure modem control on line is disabled -.IP 4) -turn off DTR to make sure line is hung up -.IP 5) -condition line: clear exclusive use and set hangup on close modes -.IP 6) -turn on modem control -.IP 7) -edit /etc/ttys, changing the first character of the appropriate line to 1 -.IP 8) -send a hangup to process 1 to poke init to enable getty -.IP 9) -clear uid name for /etc/utmp -.SH HISTORY -.PP -First written by Allan Wilkes (fisher!allan) -.PP -Modified June 8,1983 by W.Sebok (astrovax!wls) to poke the kernel rather -than use a kernel hack to turn on/off modem control, using a subroutine -stolen from a program written by Tsutomu Shimomura {astrovax,escher}!tsutomu -.PP -Worked over many times by W.Sebok -.RI ( i . e . -hacked to death) -.SH FILES -/dev/kmem, /kernel, /etc/ttys, /etc/utmp, /dev/tty* -.SH BUGS -.PP -Sensing carrier requires the 4.2 BSD TIOCMGET ioctl call. Unfortunately this -ioctl is not implemented in the vanilla 4.2 BSD dh driver even though the -dz and dmf drivers use an emulation of the DH11's modem control bits. This -has been fixed here. -.PP -Some time (currently 2 seconds) is required between disabling modem control -and opening the device. This is probably because of a race with getty whose -open is finally being allowed to complete. This time interval may not be -enough on a loaded system. Because of this problem and the above problem with -the dh driver there is deliberately no error message given when the TIOCMGET -ioctl fails. -.PP -Previously there were similar synchronization problems with the init process. -When dialins are disabled the capitalized name of the process cannot be posted -into /etc/utmp until init has finished clearing /etc/utmp. However one does -not know how long that will take, and, on a loaded system, it can take quite -a while. This was solved by the strategy of 1) posting the name, 2) poking -init, 3) going into a loop where the process repeatedly waits a second and -checks whether the entry has been cleared from /etc/utmp, and 4) posting the -name again. diff --git a/usr.bin/uucp/uupoll/Makefile b/usr.bin/uucp/uupoll/Makefile deleted file mode 100644 index 97794d5..0000000 --- a/usr.bin/uucp/uupoll/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 - -PROG= uupoll -CFLAGS+=-I${.CURDIR}/../includes -BINMODE=6555 -DPADD= ${LIBCOMPAT} -LDADD= ${LIBUU} -lcompat -MAN8= uupoll.8 - -.include <bsd.prog.mk> diff --git a/usr.bin/uucp/uusnap/Makefile b/usr.bin/uucp/uusnap/Makefile deleted file mode 100644 index d23ab2a..0000000 --- a/usr.bin/uucp/uusnap/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 - -PROG= uusnap -CFLAGS+=-I${.CURDIR}/../includes -BINMODE=6555 -MAN8= uusnap.8 - -.include <bsd.prog.mk> diff --git a/usr.bin/watch/Makefile b/usr.bin/watch/Makefile deleted file mode 100644 index 7a9f602..0000000 --- a/usr.bin/watch/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -PROG= watch -MAN8= watch.8 -BINMODE=500 -LDADD= -ltermcap - -.include <bsd.prog.mk> diff --git a/usr.bin/watch/snp.4 b/usr.bin/watch/snp.4 deleted file mode 100644 index 47b97d8..0000000 --- a/usr.bin/watch/snp.4 +++ /dev/null @@ -1,49 +0,0 @@ -.Dd Februar 17, 1995 -.Dt SNP(4) -.Os -.Sh NAME - - snp - tty snoop interface. - -.Sh SYNOPSIS -#include <sys/snoop.h> - -.Sh DESCRIPTION - /dev/snp? are snoop devices which allow user to attach to any tty -and watch activities on it. Device can be used by root only. - To connect device to tty use special iocontrol SNPSTTY.Argument to -it is a structure 'snptty'. - struct snptty { - int st_type; - int st_unit; - } - -st_type - type of tty to attach. Currently supported are : - ST_PTY - pseudo-tty devices. - ST_VTY - virtual ttys (syscons). - ST_SIO - serial ttys. - -st_unit - number of tty unit. -By specifying ever st_type or st_unit -1 user can detach snp -device from tty. - - SNPGTTY - iocontrol returns current tty attached. - FIONREAD - iocontrol returns ever positive value equal to number of - characters in read buffer. Also special values defined: - SNP_OFLOW - device overflow occured,device automatically - detached. - SNP_TTYCLOSE - tty still has not been attached. - SNP_DETACH - snp device has been detached by user or - tty device has been closed and detached - automatically. - -.Sh SEE ALSO - -watch(8), pty(4), sio(4) -.Sh BUGS - -While in line mode,user input can't be seen. -Has no ability to write to attached tty device. - -.Sh HISTORY -FreeBSD 2.1 by Ugen J.S.Antsilevich <ugen@NetVision.net.il> diff --git a/usr.bin/watch/watch.8 b/usr.bin/watch/watch.8 deleted file mode 100644 index a57a70c..0000000 --- a/usr.bin/watch/watch.8 +++ /dev/null @@ -1,77 +0,0 @@ -.\" -.\" @(#)watch.8 1.1 (FreeBSD) 2/17/95 -.\" -.Dd February 17, 1995 -.Dt WATCH 8 -.Os -.Sh NAME -.Nm watch -.Nd snoop on another tty line -.Sh SYNOPSYS -.Nm watch -.Op Fl ciot -.Ar tty -.\" watch [-ciot] [<tty name>] -.Sh DESCRIPTION -.Nm Watch -allows the superuser to examine all data coming through a specified tty. -.Nm Watch -writes to standard output. -.Pp -The options are as follows: -.Bl -tag -width "-l nul " -.It Fl c -Reconnect on close. If the tty observed by -.Nm watch -is closed, automatically reattach to the same tty. -If this option is not specified, -.Nm watch -will request a new tty if running in interactive mode or exit if running -without a controlling tty. -.It Fl i -Force interactive mode. -Interactive mode is a default if -.Nm watch -is started from a tty. -If output is redirected to a file, interactive mode can still be requested -by specifying this option. -.It Fl o -Reconnect on overflow. -The behaviour of -.Nm watch -if the observed tty overflows is similar to the behavior if the observed tty -is closed. -For more info see -.Xr snp 4 . -.It Fl t -Print the date and time when observation of a given tty is started. -.It Ar tty -Tty may be specified as a remote pseudo tty device, a virtual console, or -a serial line. -Names may be preceded by "/dev/". -.Sh OPERATION -While running in interactive mode, all user input is discarded except for: -.Pp -.Bl -tag -width "XXXX" -compact -.It Sy "<control-C>" -Exit -.Nm watch . -.It Sy "<control-W>" -Clear screen. -.It Sy "<control-X>" -Change attached tty. -.Sh RESTRICTIONS -Only the superuser can run -.Nm watch . -.Sh SEE ALSO -.Xr snpl4 , -.Xr pty 4 , -.Xr sio 4 . -.Sh BUGS -No terminal emulation is performed. -All user output is reproduced as-is. -.Sh AUTHOR -Ugen J.S. Antsilevich <ugen@NetVision.net.il> -.Sh HISTORY -.Nm Watch -first appeared in FreeBSD 2.1 diff --git a/usr.bin/watch/watch.c b/usr.bin/watch/watch.c deleted file mode 100644 index f5e4007..0000000 --- a/usr.bin/watch/watch.c +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Copyright (c) 1995 Ugen J.S.Antsilevich - * - * Redistribution and use in source forms, with and without modification, - * are permitted provided that this entire comment appears intact. - * - * Redistribution in binary form may occur without any restrictions. - * Obviously, it would be nice if you gave credit where credit is due - * but requiring it would be too onerous. - * - * This software is provided ``AS IS'' without any warranties of any kind. - * - * Snoop stuff. - */ - -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <signal.h> -#include <sys/types.h> -#include <sys/time.h> -#include <sys/select.h> -#include <sys/fcntl.h> -#include <sys/ioctl.h> -#include <sys/ioctl_compat.h> -#include <sys/snoop.h> - - -#define MSG_INIT "Snoop started." -#define MSG_OFLOW "Snoop stopped due to overflow.Reconnecting." -#define MSG_CLOSED "Snoop stopped due to tty close.Reconnecting." -#define MSG_CHANGE "Snoop device change by user request." - - -#define DEV_NAME_LEN 12 /* for /dev/ttyXX++ */ -#define MIN_SIZE 256 - -#define CHR_SWITCH 24 /* Ctrl+X */ -#define CHR_CLEAR 23 /* Ctrl+V */ - - -int opt_reconn_close = 0; -int opt_reconn_oflow = 0; -int opt_interactive = 1; -int opt_timestamp = 0; - -char dev_name[DEV_NAME_LEN]; -int snp_io; -struct snptty snp_tty; -int std_in = 0, std_out = 1; - - -int clear_ok = 0; -struct sgttyb sgo; -char tbuf[1024], buf[1024]; - - -void -clear() -{ - if (clear_ok) - tputs(buf, 1, putchar); - fflush(stdout); -} - -void -timestamp(buf) - char *buf; -{ - time_t t; - char btmp[1024]; - clear(); - printf("\n---------------------------------------------\n"); - t = time(NULL); - strftime(btmp, 1024, "Time: %d %b %H:%M", localtime(&t)); - printf("%s\n", btmp); - printf("%s\n", buf); - printf("---------------------------------------------\n"); - fflush(stdout); -} - -void -set_tty() -{ - struct sgttyb sgn; - ioctl(std_in, TIOCGETP, &sgo); - /* bcopy(&sgn, &sgo, sizeof(struct sgttyb)); */ - sgn = sgo; - sgn.sg_flags |= CBREAK; - sgn.sg_flags &= ~ECHO; - ioctl(std_in, TIOCSETP, &sgn); -} - -void -unset_tty() -{ - ioctl(std_in, TIOCSETP, &sgo); -} - - -void -fatal(buf) - char *buf; -{ - unset_tty(); - if (buf) - fprintf(stderr, "Fatal: %s\n", buf); - exit(1); -} - -int -open_snp() -{ - char snp[DEV_NAME_LEN] = "/dev/snpX"; - char c; - int f; - for (c = '0'; c <= '9'; c++) { - snp[8] = c; - if ((f = open(snp, O_RDONLY)) < 0) - continue; - return f; - } - fatal("Cannot open snoop device."); -} - - -void -cleanup() -{ - if (opt_timestamp) - timestamp("Logging Exited."); - close(snp_io); - unset_tty(); - exit(0); -} - - -void -show_usage() -{ - printf("watch -[ciot] [tty name]\n"); - exit(1); -} - -void -setup_scr() -{ - char *cbuf = buf, *term; - if (!opt_interactive) - return; - if ((term = getenv("TERM"))) - if (tgetent(tbuf, term) == 1) - if (tgetstr("cl", &cbuf)) - clear_ok = 1; - clear(); - set_tty(); -} - - -int -ctoh(c) - char c; -{ - if (c >= '0' && c <= '9') - return (int) (c - '0'); - - if (c >= 'a' && c <= 'f') - return (int) (c - 'a' + 10); - - fatal("Bad tty number."); -} - - -void -detach_snp() -{ - struct snptty st; - st.st_type = -1; - st.st_unit = -1; - ioctl(snp_io, SNPSTTY, &st); -} - -void -attach_snp() -{ - if (ioctl(snp_io, SNPSTTY, &snp_tty) != 0) - fatal("Cannot attach to tty."); - if (opt_timestamp) - timestamp("Logging Started."); -} - - -void -set_dev(name) - char *name; -{ - char buf[DEV_NAME_LEN], num[DEV_NAME_LEN]; - int unitbase = 0; - - if (strlen(name) > 5 && !strncmp(name, "/dev/", 5)) - strcpy(buf, &(name[5])); - else - strcpy(buf, name); - - if (strlen(buf) < 4) - fatal("Bad tty name."); - - if (!strncmp(buf, "tty", 3)) - switch (buf[3]) { - case 'v': - snp_tty.st_unit = ctoh(buf[4]); - snp_tty.st_type = ST_VTY; - goto got_num; - case 'r': - unitbase += 16; - case 'q': - unitbase += 16; - case 'p': - snp_tty.st_unit = ctoh(buf[4]) + unitbase; - snp_tty.st_type = ST_PTY; - goto got_num; - case '0': - case 'd': - snp_tty.st_unit = ctoh(buf[4]); - snp_tty.st_type = ST_SIO; - goto got_num; - default: - fatal("Bad tty name."); - - } - - - if (!strncmp(buf, "vty", 3)) { - strcpy(num, &(buf[3])); - snp_tty.st_unit = atoi(num); - snp_tty.st_type = ST_VTY; - goto got_num; - } - if (!strncmp(buf, "pty", 3)) { - strcpy(num, &(buf[3])); - snp_tty.st_unit = atoi(num); - snp_tty.st_type = ST_PTY; - goto got_num; - } - if (!strncmp(buf, "sio", 3) || !strncmp(buf, "cua", 3)) { - strcpy(num, &(buf[3])); - snp_tty.st_unit = atoi(num); - snp_tty.st_type = ST_SIO; - goto got_num; - } - fatal("Bad tty name."); -got_num: - attach_snp(); -} - -void -ask_dev(dev_name, msg) - char *dev_name, *msg; -{ - char buf[DEV_NAME_LEN]; - int len; - - clear(); - unset_tty(); - - if (msg) - printf("%s\n", msg); - if (dev_name) - printf("Enter device name [%s]:", dev_name); - else - printf("Enter device name:"); - - if (fgets(buf, DEV_NAME_LEN - 1, stdin)) { - len = strlen(buf); - if (buf[len - 1] == '\n') - buf[len - 1] = '\0'; - if (buf[0] != '\0' && buf[0] != ' ') - strcpy(dev_name, buf); - } - set_tty(); -} - - -void -main(ac, av) - int ac; - char **av; -{ - int res, nread, b_size = MIN_SIZE; - extern int optind; - char ch, *buf; - fd_set fd_s; - - if (getuid() != 0) - fatal(NULL); - - if (isatty(std_out)) - opt_interactive = 1; - else - opt_interactive = 0; - - - while ((ch = getopt(ac, av, "ciot")) != EOF) - switch (ch) { - case 'c': - opt_reconn_close = 1; - break; - case 'i': - opt_interactive = 1; - break; - case 'o': - opt_reconn_oflow = 1; - break; - case 't': - opt_timestamp = 1; - break; - case '?': - default: - show_usage(); - exit(1); - } - - signal(SIGINT, cleanup); - - setup_scr(); - snp_io = open_snp(); - - if (*(av += optind) == NULL) { - if (opt_interactive) - ask_dev(dev_name, MSG_INIT); - else - fatal("No device name given."); - } else - strncpy(dev_name, *av, DEV_NAME_LEN); - - set_dev(dev_name); - - if (!(buf = (char *) malloc(b_size))) - fatal("Cannot malloc()."); - - FD_ZERO(&fd_s); - - while (1) { - if (opt_interactive) - FD_SET(std_in, &fd_s); - FD_SET(snp_io, &fd_s); - res = select(snp_io + 1, &fd_s, NULL, NULL, NULL); - if (opt_interactive && FD_ISSET(std_in, &fd_s)) { - switch (ch = getchar()) { - case CHR_CLEAR: - clear(); - break; - case CHR_SWITCH: - /* detach_snp(); */ - ask_dev(dev_name, MSG_CHANGE); - set_dev(dev_name); - break; - default: - } - } - if (!FD_ISSET(snp_io, &fd_s)) - continue; - - if ((res = ioctl(snp_io, FIONREAD, &nread)) != 0) - fatal("ioctl() failed."); - - switch (nread) { - case SNP_OFLOW: - if (opt_reconn_oflow) - attach_snp(); - else if (opt_interactive) { - ask_dev(dev_name, MSG_OFLOW); - set_dev(dev_name); - } else - cleanup(); - case SNP_DETACH: - case SNP_TTYCLOSE: - if (opt_reconn_close) - attach_snp(); - else if (opt_interactive) { - ask_dev(dev_name, MSG_CLOSED); - set_dev(dev_name); - } else - cleanup(); - default: - if (nread < (b_size / 2) && (b_size / 2) > MIN_SIZE) { - free(buf); - if (!(buf = (char *) malloc(b_size / 2))) - fatal("Cannot malloc()"); - b_size = b_size / 2; - } - if (nread > b_size) { - b_size = (nread % 2) ? (nread + 1) : (nread); - free(buf); - if (!(buf = (char *) malloc(b_size))) - fatal("Cannot malloc()"); - } - if (read(snp_io, buf, nread) < nread) - fatal("read failed."); - if (write(std_out, buf, nread) < nread) - fatal("write failed."); - } - } /* While */ -} |