summaryrefslogtreecommitdiff
path: root/gnu/libexec
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>1993-08-04 19:30:05 +0000
committermycroft <mycroft@NetBSD.org>1993-08-04 19:30:05 +0000
commit7283ab9b15064eb3c97e3bb99c8f1aef16934d6b (patch)
treecae843d442dfef8fbd749af8f2db9338b33f6477 /gnu/libexec
parent4b184f33d9d535c89b98e934f8044b4652a01852 (diff)
Clean up deleted files.
Diffstat (limited to 'gnu/libexec')
-rw-r--r--gnu/libexec/uucp/MANIFEST67
-rw-r--r--gnu/libexec/uucp/Makefile.in297
-rw-r--r--gnu/libexec/uucp/alloca.c97
-rw-r--r--gnu/libexec/uucp/bnu.c1334
-rw-r--r--gnu/libexec/uucp/chat.c1430
-rw-r--r--gnu/libexec/uucp/conf.h313
-rw-r--r--gnu/libexec/uucp/conf.h-dist311
7 files changed, 0 insertions, 3849 deletions
diff --git a/gnu/libexec/uucp/MANIFEST b/gnu/libexec/uucp/MANIFEST
deleted file mode 100644
index 41d7f0f0550..00000000000
--- a/gnu/libexec/uucp/MANIFEST
+++ /dev/null
@@ -1,67 +0,0 @@
-COPYING
-ChangeLog
-MANIFEST
-Makefile.in
-README
-TODO
-alloca.c
-bnu.c
-chat.c
-conf.h-dist
-config.c
-configure
-configure.in
-copy.c
-file.c
-getopt.c
-getopt.h
-log.c
-parse.c
-policy.h
-port.c
-port.h
-prot.c
-prot.h
-prote.c
-protf.c
-protg.c
-prott.c
-prtinf.c
-sys1.unx
-sys2.unx
-sys3.unx
-sys4.unx
-sys5.unx
-sys6.unx
-sys7.unx
-sysh.unx
-sysinf.c
-system.h
-tcp.c
-time.c
-tstuu.c
-util.c
-uuchk.c
-uucico.8
-uucico.c
-uucp.1
-uucp.c
-uucp.h
-uucp.texi
-uucp.info
-uucp.info-1
-uucp.info-2
-uucp.info-3
-uucp.info-4
-uudir.c
-uulog.c
-uuname.c
-uustat.1
-uustat.c
-uutime.h
-uux.1
-uux.c
-uuxqt.8
-uuxqt.c
-v2.c
-version.c
diff --git a/gnu/libexec/uucp/Makefile.in b/gnu/libexec/uucp/Makefile.in
deleted file mode 100644
index 1fa5bf9e50b..00000000000
--- a/gnu/libexec/uucp/Makefile.in
+++ /dev/null
@@ -1,297 +0,0 @@
-# This is the Makefile for Taylor UUCP
-#
-# $Id: Makefile.in,v 1.2 1993/08/02 17:25:01 mycroft Exp $
-#
-# The file Makefile.in should be processed by configure to generate
-# Makefile. If you want to generate Makefile by hand, you must find
-# all variables surrounded by @ and replace them with the correct
-# value (e.g. @CC@ must be replaced by something like cc or gcc).
-#
-# Once you have done that, you should check the definitions at the top
-# of this file to make sure that they are reasonable for your system.
-
-# Prefix directory for installation directories.
-prefix = /usr
-
-# The user name that should own the resulting executables, several of
-# which are suid.
-owner = uucp
-
-# Where to install uucico and uuxqt, and where to read configuration files
-# from by default. If you use this definition, $(prefix)/lib must exist.
-libdir = $(prefix)/libexec/uucp
-
-# Where to install uucp, uux, uuchk, uustat, uuname and uulog.
-bindir = $(prefix)/bin
-
-# Where to install man pages. Section 1 for user programs, 8 for daemons.
-man1dir = $(prefix)/share/man/cat1
-man1ext = .0
-man8dir = $(prefix)/share/man/cat8
-man8ext = .0
-
-# Where to install the info files.
-infodir = $(prefix)/info
-
-# The directory to look in for new style configuration files (when
-# using HAVE_TAYLOR_CONFIG). Note that by default this is different
-# from libdir, unlike traditional UUCP packages.
-newconfigdir = /etc/uucp
-
-# The directory to look in for BNU (when using HAVE_BNU_CONFIG) or
-# V2 (when using HAVE_V2_CONFIG) style configuration files.
-oldconfigdir = /etc/uucp
-
-# If you don't want to compile tstuu, which requires BSD style ptys
-# and the Taylor configuration files, comment out the following line
-# The tstuu program is only used to test the package; it is described
-# further in the documentation.
-TSTUU = tstuu
-
-#
-# The next few lines are set up by the configuration script. You may
-# want to look them over.
-#
-
-# If you do not have the mkdir system call, undefine the following three
-# lines. This will install uudir as an suid root program. This is
-# necessary because invoking /bin/mkdir from an suid program will
-# leave the directories owned by the wrong user.
-@UUDIR@UUDIR = uudir
-@UUDIR@uudirdir = $(libdir)/util
-@UUDIR@UUDIRFLAGS = -DUUDIR_PROGRAM=\"$(uudirdir)/$(UUDIR)\"
-
-# Source directory and, if necessary, VPATH
-srcdir = @srcdir@
-@VPATH@
-
-# Define programs and flags
-CC = @CC@
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-ALLOCA = @ALLOCA@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = @INSTALLDATA@
-
-LN_S = @LN_S@
-
-#
-# Nothing else to configure
-#
-
-SHELL = /bin/sh
-
-VERSION = 1.03
-
-MORECFLAGS = -I$(srcdir) -I. -DLIBDIR=\"$(libdir)\" -DNEWCONFIGLIB=\"$(newconfigdir)\" -DOLDCONFIGLIB=\"$(oldconfigdir)\" -DOWNER=\"$(owner)\" $(UUDIRFLAGS)
-
-PROGRAMS = uucico uuxqt uux uucp uuchk uustat uuname uulog
-
-UUOBJS = uucico.o prot.o protg.o protf.o prott.o prote.o config.o v2.o bnu.o \
- file.o util.o sysinf.o prtinf.o time.o log.o chat.o port.o tcp.o \
- parse.o copy.o sys1.o sys2.o sys3.o sys4.o version.o getopt.o \
- $(ALLOCA)
-XQTOBJS = uuxqt.o config.o v2.o bnu.o util.o sysinf.o prtinf.o log.o \
- copy.o sys1.o sys3.o sys5.o version.o getopt.o $(ALLOCA)
-UUXOBJS = uux.o config.o v2.o bnu.o util.o sysinf.o prtinf.o log.o \
- copy.o sys1.o sys3.o sys6.o version.o getopt.o $(ALLOCA)
-UUCPOBJS = uucp.o config.o v2.o bnu.o util.o sysinf.o prtinf.o log.o \
- copy.o sys1.o sys3.o sys6.o version.o getopt.o $(ALLOCA)
-UUCHKOBJS = uuchk.o config.o v2.o bnu.o util.o sysinf.o prtinf.o time.o \
- log.o sys1.o version.o getopt.o $(ALLOCA)
-UUSTATOBJS = uustat.o config.o v2.o bnu.o util.o sysinf.o prtinf.o \
- log.o parse.o copy.o sys1.o sys3.o sys4.o sys5.o sys7.o version.o \
- getopt.o $(ALLOCA)
-UUNAMEOBJS = uuname.o config.o v2.o bnu.o util.o sysinf.o prtinf.o \
- log.o sys1.o version.o getopt.o $(ALLOCA)
-UULOGOBJS = uulog.o config.o v2.o bnu.o util.o sysinf.o prtinf.o \
- log.o sys1.o version.o getopt.o $(ALLOCA)
-TSTOBJS = tstuu.o version.o getopt.o $(ALLOCA)
-
-ALLOBJS = uucico.o uuxqt.o uux.o uucp.o uuchk.o uustat.o uuname.o uulog.o \
- uudir.o tstuu.o prot.o protg.o protf.o prott.o prote.o config.o v2.o \
- bnu.o file.o util.o sysinf.o prtinf.o time.o log.o chat.o port.o \
- tcp.o parse.o copy.o sys1.o sys2.o sys3.o sys4.o sys5.o sys6.o \
- sys7.o version.o getopt.o
-
-all: $(PROGRAMS) $(TSTUU) $(UUDIR)
-
-install: $(PROGRAMS) uucp.info $(UUDIR)
- -mkdir $(libdir) $(bindir)
- -ln $(libdir)/uucico $(libdir)/uucico.old
- -ln $(libdir)/uuxqt $(libdir)/uuxqt.old
- rm -f $(libdir)/uucico $(libdir)/uuxqt
- $(INSTALL_PROGRAM) uucico $(libdir)/uucico
- $(INSTALL_PROGRAM) uuxqt $(libdir)/uuxqt
- $(INSTALL_PROGRAM) uuchk $(libdir)/uuchk
- chown $(owner) $(libdir)/uucico $(libdir)/uuxqt $(libdir)/uuchk
- chmod 4555 $(libdir)/uucico $(libdir)/uuxqt
- -if test "$(UUDIR)X" != "X"; then if test ! -d $(uudirdir); then mkdir $(uudirdir); fi; chown $(owner) $(uudirdir); chmod 100 $(uudirdir); $(INSTALL_PROGRAM) uudir $(uudirdir)/uudir; chown root $(uudirdir)/uudir; chmod 4555 $(uudirdir)/uudir; else true; fi
- -ln $(bindir)/uux $(bindir)/uux.old
- -ln $(bindir)/uucp $(bindir)/uucp.old
- -ln $(bindir)/uustat $(bindir)/uustat.old
- -ln $(bindir)/uuname $(bindir)/uuname.old
- -ln $(bindir)/uulog $(bindir)/uulog.old
- rm -f $(bindir)/uux $(bindir)/uucp $(bindir)/uustat
- rm -f $(bindir)/uuname $(bindir)/uulog
- $(INSTALL_PROGRAM) uux $(bindir)/uux
- $(INSTALL_PROGRAM) uucp $(bindir)/uucp
- $(INSTALL_PROGRAM) uustat $(bindir)/uustat
- $(INSTALL_PROGRAM) uuname $(bindir)/uuname
- $(INSTALL_PROGRAM) uulog $(bindir)/uulog
- chown $(owner) $(bindir)/uux $(bindir)/uucp $(bindir)/uustat
- chown $(owner) $(bindir)/uuname
- chmod 4555 $(bindir)/uux $(bindir)/uucp $(bindir)/uustat
- chmod 4555 $(bindir)/uuname
-
-uninstall:
- rm -f $(libdir)/uucico $(libdir)/uuxqt
- -cp $(libdir)/uucico.old $(libdir)/uucico
- -cp $(libdir)/uuxqt.old $(libdir)/uuxqt
- -chown $(owner) $(libdir)/uucico $(libdir)/uuxqt $(libdir)/uuchk
- -chmod 4555 $(libdir)/uucico $(libdir)/uuxqt
- rm -f $(bindir)/uux $(bindir)/uucp $(bindir)/uustat
- rm -f $(bindir)/uuname $(bindir)/uulog
- -cp $(bindir)/uux.old $(bindir)/uux
- -cp $(bindir)/uucp.old $(bindir)/uucp
- -cp $(bindir)/uustat.old $(bindir)/uustat
- -cp $(bindir)/uuname.old $(bindir)/uuname
- -cp $(bindir)/uulog.old $(bindir)/uulog
- -chown $(owner) $(bindir)/uux $(bindir)/uucp $(bindir)/uustat
- -chown $(owner) $(bindir)/uuname
- -chmod 4555 $(bindir)/uux $(bindir)/uucp $(bindir)/uustat
- -chmod 4555 $(bindir)/uuname
-
-uucico: $(UUOBJS)
- $(CC) $(LDFLAGS) -o uucico $(UUOBJS) $(LIBS)
-
-uuxqt: $(XQTOBJS)
- $(CC) $(LDFLAGS) -o uuxqt $(XQTOBJS) $(LIBS)
-
-uux: $(UUXOBJS)
- $(CC) $(LDFLAGS) -o uux $(UUXOBJS) $(LIBS)
-
-uucp: $(UUCPOBJS)
- $(CC) $(LDFLAGS) -o uucp $(UUCPOBJS) $(LIBS)
-
-uuchk: $(UUCHKOBJS)
- $(CC) $(LDFLAGS) -o uuchk $(UUCHKOBJS) $(LIBS)
-
-uustat: $(UUSTATOBJS)
- $(CC) $(LDFLAGS) -o uustat $(UUSTATOBJS) $(LIBS)
-
-uuname: $(UUNAMEOBJS)
- $(CC) $(LDFLAGS) -o uuname $(UUNAMEOBJS) $(LIBS)
-
-uulog: $(UULOGOBJS)
- $(CC) $(LDFLAGS) -o uulog $(UULOGOBJS) $(LIBS)
-
-tstuu: $(TSTOBJS)
- $(CC) $(LDFLAGS) -o tstuu $(TSTOBJS) $(LIBS)
-
-uudir: uudir.o
- $(CC) $(LDFLAGS) -o uudir uudir.o $(LIBS)
-
-.c.o:
- $(CC) -c $(CFLAGS) $(MORECFLAGS) $<
-
-.SUFFIXES: .unx
-
-sysdep.h: sysh.unx
- rm -f sysdep.h
- $(LN_S) sysh.unx sysdep.h
-
-.unx.c:
- rm -f $@
- $(LN_S) $< $@
-
-clean:
- rm -f $(ALLOBJS) uucico uuxqt uux uucp uuchk tstuu
- rm -f uucp-$(VERSION).tar.Z
- rm -rf uucp-$(VERSION)
-
-# The distribution targets are mostly for my own use; they are not
-# expected to work on other systems.
-
-dist: uucp.info conf.h-dist
- -rm -rf uucp-$(VERSION)
- -rm -f taylor-uucp-$(VERSION).tar taylor-uucp-$(VERSION).tar.Z
- mkdir uucp-$(VERSION)
- ln `cat MANIFEST` uucp-$(VERSION)
- rm -f uucp-$(VERSION)/policy.h uucp-$(VERSION)/Makefile.in
- cp policy.h Makefile.in uucp-$(VERSION)
- chmod 0644 uucp-$(VERSION)/policy.h uucp-$(VERSION)/Makefile.in
- mkdir uucp-$(VERSION)/contrib
- ln contrib/* uucp-$(VERSION)/contrib
- tar -cvf taylor-uucp-$(VERSION).tar uucp-$(VERSION)
- compress taylor-uucp-$(VERSION).tar
-
-uucp.info: uucp.texi
- makeinfo uucp.texi
-
-conf.h-dist: conf.h
- cp conf.h conf.h-dist
-
-conf.h Makefile: configure
- configure
-
-Makefile: Makefile.in
-
-configure: configure.in
- autoconf
-
-# GNU standards want these targets
-
-mostlyclean: clean
-
-realclean: clean
- rm conf.h
-
-TAGS:
- etags *.h *.c
-
-# Header file dependencies. These are maintained by hand.
-
-uucico.o: uucp.h conf.h policy.h system.h prot.h port.h sysdep.h uutime.h
-uucico.o: getopt.h
-uuxqt.o: uucp.h conf.h policy.h system.h getopt.h sysdep.h
-uux.o: uucp.h conf.h policy.h system.h getopt.h sysdep.h
-uucp.o: uucp.h conf.h policy.h system.h getopt.h sysdep.h
-uuchk.o: uucp.h conf.h policy.h port.h sysdep.h system.h uutime.h getopt.h
-uustat.o: uucp.h conf.h policy.h system.h sysdep.h getopt.h
-uuname.o: uucp.h conf.h policy.h system.h sysdep.h getopt.h
-uulog.o: uucp.h conf.h policy.h system.h sysdep.h getopt.h
-tstuu.o: uucp.h conf.h policy.h sysdep.h getopt.h
-uudir.o: uucp.h conf.h policy.h sysdep.h
-prot.o: uucp.h conf.h policy.h system.h prot.h port.h sysdep.h
-protg.o: uucp.h conf.h policy.h system.h prot.h port.h sysdep.h
-protf.o: uucp.h conf.h policy.h prot.h port.h sysdep.h system.h
-prott.o: uucp.h conf.h policy.h prot.h port.h sysdep.h system.h
-prote.o: uucp.h conf.h policy.h prot.h port.h sysdep.h system.h
-config.o: uucp.h conf.h policy.h system.h sysdep.h
-v2.o: uucp.h conf.h policy.h port.h sysdep.h
-bnu.o: uucp.h conf.h policy.h port.h sysdep.h
-file.o: uucp.h conf.h policy.h system.h
-util.o: uucp.h conf.h policy.h
-sysinf.o: uucp.h conf.h policy.h system.h port.h sysdep.h uutime.h
-time.o: uucp.h conf.h policy.h uutime.h
-log.o: uucp.h conf.h policy.h system.h
-chat.o: uucp.h conf.h policy.h system.h port.h sysdep.h
-port.o: uucp.h conf.h policy.h port.h sysdep.h
-tcp.o: uucp.h conf.h policy.h port.h sysdep.h system.h
-prtinf.o: uucp.h conf.h policy.h port.h sysdep.h
-parse.o: uucp.h conf.h policy.h
-copy.o: uucp.h conf.h policy.h system.h sysdep.h
-sys1.o: uucp.h conf.h policy.h system.h sysdep.h
-sys2.o: uucp.h conf.h policy.h system.h port.h sysdep.h
-sys3.o: uucp.h conf.h policy.h system.h sysdep.h
-sys4.o: uucp.h conf.h policy.h system.h sysdep.h
-sys5.o: uucp.h conf.h policy.h system.h sysdep.h
-sys6.o: uucp.h conf.h policy.h system.h sysdep.h
-sys7.o: uucp.h conf.h policy.h system.h sysdep.h
-version.o: uucp.h conf.h policy.h
-getopt.o: getopt.h
-alloca.o: uucp.h conf.h policy.h
diff --git a/gnu/libexec/uucp/alloca.c b/gnu/libexec/uucp/alloca.c
deleted file mode 100644
index 019a8b2f9b8..00000000000
--- a/gnu/libexec/uucp/alloca.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* alloca.c
- A very simplistic alloca routine.
-
- Copyright (C) 1991, 1992 Ian Lance Taylor
-
- This file is part of the Taylor UUCP package.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- The author of the program may be contacted at ian@airs.com or
- c/o AIRS, P.O. Box 520, Waltham, MA 02254.
-
- $Log: alloca.c,v $
- Revision 1.1.1.1 1993/03/21 09:45:37 cgd
- initial import of 386bsd-0.1 sources
-
- Revision 1.1 1992/02/23 03:26:51 ian
- Initial revision
-
- */
-
-#include "uucp.h"
-
-#if USE_RCS_ID
-char alloca_rcsid[] = "$Id: alloca.c,v 1.1.1.1 1993/03/21 09:45:37 cgd Exp $";
-#endif
-
-/* A simplistic implementation of alloca. I could just include Doug
- Gwyn's alloca, but this is simpler for what I need and it's
- guaranteed to be portable. It will only work for a simple program
- like this one. Obviously a real alloca will be preferable. */
-
-static void uaclear_alloca P((void));
-
-struct salloca
-{
- struct salloca *qnext;
- pointer pbuf;
-};
-
-static struct salloca *qAlloca;
-
-/* Allocate temporary storage. */
-
-pointer
-alloca (isize)
- int isize;
-{
- struct salloca *q;
-
- if (isize == 0)
- {
- uaclear_alloca ();
- return NULL;
- }
- q = (struct salloca *) malloc (sizeof (struct salloca));
- if (q == NULL)
- abort ();
- q->qnext = qAlloca;
- qAlloca = q;
- q->pbuf = malloc (isize);
- if (q->pbuf == NULL)
- abort ();
- return q->pbuf;
-}
-
-/* Free up all temporary storage. */
-
-static void
-uaclear_alloca ()
-{
- struct salloca *q;
-
- q = qAlloca;
- while (q != NULL)
- {
- struct salloca *qnext;
-
- free (q->pbuf);
- qnext = q->qnext;
- free ((pointer) q);
- q = qnext;
- }
- qAlloca = NULL;
-}
diff --git a/gnu/libexec/uucp/bnu.c b/gnu/libexec/uucp/bnu.c
deleted file mode 100644
index 97f2c682012..00000000000
--- a/gnu/libexec/uucp/bnu.c
+++ /dev/null
@@ -1,1334 +0,0 @@
-/* bnu.c
- Read BNU configuration files.
-
- Copyright (C) 1991, 1992 Ian Lance Taylor
-
- This file is part of the Taylor UUCP package.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- The author of the program may be contacted at ian@airs.com or
- c/o AIRS, P.O. Box 520, Waltham, MA 02254.
-
- $Log: bnu.c,v $
- Revision 1.1.1.1 1993/03/21 09:45:37 cgd
- initial import of 386bsd-0.1 sources
-
- Revision 1.35 1992/04/06 19:49:49 ian
- Erik Forsberg: support multiple character modem classes
-
- Revision 1.34 1992/03/15 05:21:12 ian
- Scott Ballantyne: accept "Any" as a device speed
-
- Revision 1.33 1992/03/12 19:56:10 ian
- Debugging based on types rather than number
-
- Revision 1.32 1992/03/11 22:06:37 ian
- Marty Shannon: added max-uuxqts command
-
- Revision 1.31 1992/03/10 21:47:39 ian
- Added protocol command for ports
-
- Revision 1.30 1992/02/24 20:36:27 ian
- Roberto Biancardi: skip spaces after strtok (NULL, "")
-
- Revision 1.29 1992/02/24 04:58:47 ian
- Only permit files to be received into directories that are world-writeable
-
- Revision 1.28 1992/02/24 04:02:45 ian
- Doug Evans: WRITE only applies to remote requests
-
- Revision 1.27 1992/02/23 19:50:50 ian
- Handle READ and WRITE in Permissions correctly
-
- Revision 1.26 1992/02/14 16:45:09 ian
- This time for sure
-
- Revision 1.25 1992/02/14 16:43:07 ian
- Make the last patch better
-
- Revision 1.24 1992/02/14 16:39:31 ian
- T. William Wells: must xstrdup before calling uadd_validate
-
- Revision 1.23 1992/02/08 03:54:18 ian
- Include <string.h> only in <uucp.h>, added 1992 copyright
-
- Revision 1.22 1992/01/30 23:18:59 ian
- Michael Nolan: stupid error in ubadd_perm
-
- Revision 1.21 1992/01/15 07:06:29 ian
- Set configuration directory in Makefile rather than sysdep.h
-
- Revision 1.20 1991/12/28 03:49:23 ian
- Added HAVE_MEMFNS and HAVE_BFNS; changed uses of memset to bzero
-
- Revision 1.19 1991/12/17 23:14:08 ian
- T. William Wells: allow dialer complete and abort to be chat scripts
-
- Revision 1.18 1991/12/16 16:25:57 ian
- Mike Bernson: ignore lines beginning with whitespace
-
- Revision 1.17 1991/12/15 03:42:33 ian
- Added tprocess_chat_cmd for all chat commands, and added CMDTABTYPE_PREFIX
-
- Revision 1.16 1991/12/09 19:20:51 ian
- Arne Ludwig: devices entry can be followed by list of protocols
-
- Revision 1.15 1991/12/03 03:43:36 ian
- Dave Buck: time strings with grades were not parsed correctly
-
- Revision 1.14 1991/12/01 19:35:38 ian
- David Nugent: read V2 and BNU files by default even with TAYLOR_CONFIG
-
- Revision 1.13 1991/12/01 03:10:36 ian
- Niels Baggesen: accept dialers with no substitutions
-
- Revision 1.12 1991/12/01 03:04:20 ian
- Niels Baggesen: don't free up zline in ubadd_perm; don't even pass it in
-
- Revision 1.11 1991/12/01 02:44:12 ian
- Niels Baggesen: didn't handle combinations of multiple MACHINE/LOGNAME
-
- Revision 1.10 1991/12/01 02:31:36 ian
- Made zread and zwrite fields of sperm structure const char *
-
- Revision 1.9 1991/11/30 23:39:37 ian
- Marty Shannon: allow comments in Sysfiles
-
- Revision 1.8 1991/11/30 22:39:39 ian
- Marty Shannon: don't initialize an auto array
-
- Revision 1.7 1991/11/26 01:04:04 ian
- Marty Shannon: initialize ireliable for BNU and V2 configuration files
-
- Revision 1.6 1991/11/13 20:38:00 ian
- Added TCP port type for connections over TCP
-
- Revision 1.5 1991/11/11 23:47:24 ian
- Added chat-program to run a program to do a chat script
-
- Revision 1.4 1991/11/11 16:59:05 ian
- Eliminate fread_port_info, allow NULL pflock arg to ffind_port
-
- Revision 1.3 1991/11/07 18:26:13 ian
- Chip Salzenberg: can't portably take address of casted value, obviously
-
- Revision 1.2 1991/09/19 02:22:44 ian
- Chip Salzenberg's patch to allow ";retrytime" at the end of a time string
-
- Revision 1.1 1991/09/10 19:37:52 ian
- Initial revision
-
- */
-
-#include "uucp.h"
-
-#if HAVE_BNU_CONFIG
-
-#if USE_RCS_ID
-char bnu_rcsid[] = "$Id: bnu.c,v 1.1.1.1 1993/03/21 09:45:37 cgd Exp $";
-#endif
-
-#include <ctype.h>
-
-#include "port.h"
-#include "sysdep.h"
-
-/* Whether to use BNU configuration files. */
-boolean fBnu = TRUE;
-
-/* A list of space separated file names to interpret as Systems. */
-char *zBnu_systems;
-
-/* A list of space separated file names to interpret as Dialers. */
-char *zBnu_dialers;
-
-/* A list of space separated file names to interpret as Devices. */
-char *zBnu_devices;
-
-/* Local functions. */
-
-static void ubadd_perm P((int csystems, struct ssysteminfo *passystems,
- boolean **paffound));
-static void ubadd_perm_alternate P((struct ssysteminfo *q,
- boolean fmachine,
- boolean flogname));
-
-/* Read Sysfiles to get the file names to use. */
-
-void
-ubnu_read_sysfiles ()
-{
- char ab[sizeof OLDCONFIGLIB + sizeof BNU_SYSFILES - 1];
- FILE *e;
- char *zline;
-
- zBnu_systems = NULL;
- zBnu_dialers = NULL;
- zBnu_devices = NULL;
-
- sprintf (ab, "%s%s", OLDCONFIGLIB, BNU_SYSFILES);
- e = fopen (ab, "r");
- if (e != NULL)
- {
- while ((zline = zfgets (e, TRUE)) != NULL)
- {
- int inl;
- char *ztok;
-
- inl = strlen (zline) - 1;
- if (zline[inl] == '\n')
- zline[inl] = '\0';
- if (isspace (BUCHAR (zline[0])) || zline[0] == '#')
- {
- xfree ((pointer) zline);
- continue;
- }
-
- ztok = strtok (zline, " \t");
- if (ztok == NULL)
- {
- xfree ((pointer) zline);
- continue;
- }
- if (strncmp (ztok, "service=", sizeof "service=" - 1) != 0)
- {
- ulog (LOG_ERROR, "Unrecognized Sysfiles line: %s", ztok);
- xfree ((pointer) zline);
- continue;
- }
-
- do
- {
- int c;
-
- c = strcspn (ztok, ":");
- if (c == sizeof "uucico" - 1
- && strncmp (ztok, "uucico", sizeof "uucico" - 1) == 0)
- break;
- ztok += c;
- if (*ztok == ':')
- ++ztok;
- }
- while (*ztok != '\0');
-
- if (*ztok == '\0')
- {
- xfree ((pointer) zline);
- continue;
- }
-
- while ((ztok = strtok ((char *) NULL, " \t")) != NULL)
- {
- char **pz;
- char *z;
- boolean fend;
-
- if (strncmp (ztok, "systems=", sizeof "systems=" - 1) == 0)
- {
- pz = &zBnu_systems;
- ztok += sizeof "systems=" - 1;
- }
- else if (strncmp (ztok, "dialers=", sizeof "dialers=" - 1) == 0)
- {
- pz = &zBnu_dialers;
- ztok += sizeof "dialers=" - 1;
- }
- else if (strncmp (ztok, "devices=", sizeof "devices=" - 1) == 0)
- {
- pz = &zBnu_devices;
- ztok += sizeof "devices=" - 1;
- }
- else
- {
- ulog (LOG_ERROR, "Unrecognized Sysfiles command: %s", ztok);
- continue;
- }
-
- /* Stick the configuration file directory in front of each
- file. */
- z = ztok;
- do
- {
- int c;
-
- c = strcspn (z, ":");
- fend = z[c] == '\0';
- z[c] = '\0';
-
- /* Looking for a leading '/' is Unix dependent, and
- should be changed. */
- if (*z == '/')
- uadd_string (pz, z, ' ');
- else
- {
- char *zdir;
-
- zdir = (char *) xmalloc (sizeof OLDCONFIGLIB
- + strlen (z));
- sprintf (zdir, "%s%s", OLDCONFIGLIB, z);
- uadd_string (pz, zdir, ' ');
- xfree ((pointer) zdir);
- }
-
- z += c + 1;
- }
- while (! fend);
- }
-
- xfree ((pointer) zline);
- }
-
- (void) fclose (e);
- }
-
- if (zBnu_systems == NULL)
- {
- zBnu_systems = (char *) xmalloc (sizeof OLDCONFIGLIB
- + sizeof BNU_SYSTEMS - 1);
- sprintf (zBnu_systems, "%s%s", OLDCONFIGLIB, BNU_SYSTEMS);
- }
- if (zBnu_dialers == NULL)
- {
- zBnu_dialers = (char *) xmalloc (sizeof OLDCONFIGLIB
- + sizeof BNU_DIALERS - 1);
- sprintf (zBnu_dialers, "%s%s", OLDCONFIGLIB, BNU_DIALERS);
- }
- if (zBnu_devices == NULL)
- {
- zBnu_devices = (char *) xmalloc (sizeof OLDCONFIGLIB
- + sizeof BNU_DEVICES - 1);
- sprintf (zBnu_devices, "%s%s", OLDCONFIGLIB, BNU_DEVICES);
- }
-
-#if ! HAVE_TAYLOR_CONFIG
- /* If we are NOT reading the new configuration files, then look for
- Maxuuxqts. It would be more efficient to only read the file in
- uuxqt.c. Too bad. */
- {
- char *zmax;
-
- zmax = (char *) alloca (sizeof OLDCONFIGLIB +
- sizeof BNU_MAXUUXQTS - 1);
- sprintf (zmax, "%s%s", OLDCONFIGLIB, BNU_MAXUUXQTS);
- e = fopen (zmax, "r");
- if (e != NULL)
- {
- zline = zfgets (e, FALSE);
- if (zline != NULL)
- {
- cMaxuuxqts = atoi (zline);
- if (cMaxuuxqts < 0)
- cMaxuuxqts = 0;
- xfree ((pointer) zline);
- }
- (void) fclose (e);
- }
- }
-#endif /* ! HAVE_TAYLOR_CONFIG */
-}
-
-/* A little routine to add a grade and a time string to a system. */
-
-static void ubadd_time P((struct ssysteminfo *q, int bgrade,
- const char *ztime, int cretry));
-
-static void
-ubadd_time (q, bgrade, ztime, cretry)
- struct ssysteminfo *q;
- int bgrade;
- const char *ztime;
- int cretry;
-{
- char *zset;
-
- zset = (char *) alloca (strlen (ztime) + 20);
- if (cretry == 0)
- sprintf (zset, "%c%s", bgrade, ztime);
- else
- sprintf (zset, "%c%s;%d", bgrade, ztime, cretry);
- uadd_string (&q->ztime, zset, ' ');
-}
-
-/* These structures are used to read the Permissions file. */
-
-static struct sperm
-{
- char *zlogname;
- char *zmachine;
- boolean frequest;
- enum { SENDFILES_YES, SENDFILES_CALL, SENDFILES_NO } tsendfiles;
- const char *zread;
- const char *zwrite;
- char *znoread;
- char *znowrite;
- boolean fcallback;
- const char *zcommands;
- char *zvalidate;
- char *zmyname;
- char *zpubdir;
-} sBperm;
-
-static enum tcmdtabret tbsendfiles P((int argc, char **argv,
- pointer pvar, const char *zerr));
-
-static struct scmdtab asBperm_cmds[] =
-{
- { "LOGNAME", CMDTABTYPE_STRING, (pointer) &sBperm.zlogname, NULL },
- { "MACHINE", CMDTABTYPE_STRING, (pointer) &sBperm.zmachine, NULL },
- { "REQUEST", CMDTABTYPE_BOOLEAN, (pointer) &sBperm.frequest, NULL },
- { "SENDFILES", CMDTABTYPE_FN | 2, NULL, tbsendfiles },
- { "READ", CMDTABTYPE_STRING, (pointer) &sBperm.zread, NULL },
- { "WRITE", CMDTABTYPE_STRING, (pointer) &sBperm.zwrite, NULL },
- { "NOREAD", CMDTABTYPE_STRING, (pointer) &sBperm.znoread, NULL },
- { "NOWRITE", CMDTABTYPE_STRING, (pointer) &sBperm.znowrite, NULL },
- { "CALLBACK", CMDTABTYPE_BOOLEAN, (pointer) &sBperm.fcallback, NULL },
- { "COMMANDS", CMDTABTYPE_STRING, (pointer) &sBperm.zcommands, NULL },
- { "VALIDATE", CMDTABTYPE_STRING, (pointer) &sBperm.zvalidate, NULL },
- { "MYNAME", CMDTABTYPE_STRING, (pointer) &sBperm.zmyname, NULL },
- { "PUBDIR", CMDTABTYPE_STRING, (pointer) &sBperm.zpubdir, NULL },
- { NULL, 0, NULL, NULL }
-};
-
-static struct spermlist
-{
- struct spermlist *qnext;
- struct sperm sperm;
-} *qBothers;
-
-/* Read BNU system information. This means reading the Systems file
- and the Permissions file. */
-
-void
-ubnu_read_systems (pc, ppas)
- int *pc;
- struct ssysteminfo **ppas;
-{
- int calc;
- struct smulti_file *qmulti;
- char *zline;
-
- *pc = 0;
- *ppas = NULL;
- calc = 0;
-
- /* Read the Systems file(s) first. */
- qmulti = qmulti_open (zBnu_systems);
- if (qmulti == NULL)
- return;
-
- while ((zline = zmulti_gets (qmulti, (boolean *) NULL,
- (const char **) NULL, TRUE)) != NULL)
- {
- int inl;
- char *ztok;
- int i, cretry;
- struct ssysteminfo *qset;
- char *zsemi, *zslash;
-
- inl = strlen (zline) - 1;
- if (zline[inl] == '\n')
- zline[inl] = '\0';
- if (isspace (BUCHAR (zline[0])) || zline[0] == '#')
- {
- xfree ((pointer) zline);
- continue;
- }
-
- ztok = strtok (zline, " \t");
- if (ztok == NULL)
- {
- xfree ((pointer) zline);
- continue;
- }
-
- DEBUG_MESSAGE1 (DEBUG_CONFIG,
- "ubnu_read_systems: Reading system %s", ztok);
-
- /* See if we already have information for this system. */
- for (i = 0; i < *pc; i++)
- if (strcmp ((*ppas)[i].zname, ztok) == 0)
- break;
- if (i >= *pc)
- {
- if (*pc >= calc)
- {
- calc += 10;
- *ppas = ((struct ssysteminfo *)
- xrealloc ((pointer) *ppas,
- calc * sizeof (struct ssysteminfo)));
- }
- qset = &(*ppas)[*pc];
- (*pc)++;
- }
- else
- {
- struct ssysteminfo **pq;
-
- for (pq = &(*ppas)[i].qalternate;
- *pq != NULL;
- pq = &(*pq)->qalternate)
- ;
- *pq = (struct ssysteminfo *) xmalloc (sizeof (struct ssysteminfo));
- qset = *pq;
- }
-
- uset_system_defaults (qset);
- qset->zname = ztok;
-
- /* Under BNU, a local request is permitted to write into any
- directory that is world writeable. */
- qset->zlocal_receive = "/";
-
- /* Get the time string. */
- ztok = strtok ((char *) NULL, " \t");
- if (ztok == NULL)
- continue;
-
- /* The time string is "time/grade,time/grade;retry". A missing
- grade is taken as 'z'. */
-
- cretry = 0;
- zsemi = strchr (ztok, ';');
- if (zsemi != NULL)
- {
- *zsemi = '\0';
- cretry = atoi (zsemi + 1);
- }
-
- qset->ztime = NULL;
- while (TRUE)
- {
- char *zcomma;
-
- zcomma = strchr (ztok, ',');
- if (zcomma != NULL)
- *zcomma = '\0';
-
- zslash = strchr (ztok, '/');
- if (zslash == NULL || zslash[1] == '\0')
- ubadd_time (qset, BGRADE_LOW, ztok, cretry);
- else
- {
- *zslash = '\0';
- ubadd_time (qset, zslash[1], ztok, cretry);
- }
-
- if (zcomma == NULL)
- break;
-
- ztok = zcomma + 1;
- }
-
- /* Get the devices entry. */
- qset->zport = strtok ((char *) NULL, " \t");
-
- /* Get the speed entry. If it starts with a nondigit, it's a
- modem class. We append it to the device name, and do the
- same thing when reading the Devices file, since we don't need
- to preserve the ``ACU''. I've heard that the modem class is
- permitted at either end, but this code doesn't support that.
- A range of speeds is also permitted. */
- if (qset->zport != NULL)
- {
-
- /* According to Arne Ludwig, the devices entry can be
- followed by a comma and a list of protocols. */
- ztok = strrchr (qset->zport, ',');
- if (ztok != NULL && ztok[1] != '\0')
- {
- qset->zprotocols = ztok + 1;
- *ztok = '\0';
- }
-
- ztok = strtok ((char *) NULL, " \t");
- if (ztok != NULL)
- {
- boolean fany;
-
- fany = (strcmp (ztok, "Any") == 0
- || strcmp (ztok, "-") == 0);
-
- if (! isdigit (*ztok) && ! fany)
- {
- int clen;
- char *zport, *zset;
-
- clen = strlen (qset->zport);
- zport = (char *) xmalloc (clen + strlen (ztok) + 1);
- strcpy (zport, qset->zport);
- zset = zport + clen;
- while (*ztok != '\0' && ! isdigit (*ztok))
- *zset++ = *ztok++;
- *zset = '\0';
- qset->zport = zport;
- }
-
- if (fany)
- qset->ibaud = 0;
- else
- {
- qset->ibaud = strtol (ztok, &ztok, 10);
- if (*ztok == '-')
- qset->ihighbaud = atol (ztok + 1);
- }
-
- /* Get the phone number. */
- qset->zphone = strtok ((char *) NULL, " \t");
-
- /* The rest of the line is the login script. */
- if (qset->zphone != NULL)
- {
- qset->schat.zchat = strtok ((char *) NULL, "");
- qset->schat.zchat += strspn (qset->schat.zchat, " \t");
- }
- }
- }
- }
-
- (void) fmulti_close (qmulti);
-
- /* Now we have to read the Permissions file. */
-
- {
- char abperm[sizeof OLDCONFIGLIB + sizeof BNU_PERMISSIONS - 1];
- const char * const zpubdir = PUBDIR;
- FILE *e;
- boolean *affound;
-
- sprintf (abperm, "%s%s", OLDCONFIGLIB, BNU_PERMISSIONS);
- e = fopen (abperm, "r");
- if (e == NULL)
- return;
-
- affound = (boolean *) alloca (*pc * sizeof (boolean));
- bzero (affound, *pc * sizeof (boolean));
-
- while ((zline = zfgets (e, TRUE)) != NULL)
- {
- int inl;
- char *ztok;
- boolean fany;
-
- inl = strlen (zline) - 1;
- if (zline[inl] == '\n')
- zline[inl] = '\0';
- if (isspace (BUCHAR (zline[0])) || zline[0] == '#')
- {
- xfree ((pointer) zline);
- continue;
- }
-
- sBperm.zlogname = NULL;
- sBperm.zmachine = NULL;
- sBperm.frequest = FALSE;
- sBperm.tsendfiles = SENDFILES_CALL;
- sBperm.zread = zpubdir;
- sBperm.zwrite = zpubdir;
- sBperm.znoread = NULL;
- sBperm.znowrite = NULL;
- sBperm.fcallback = FALSE;
- sBperm.zcommands = "rnews rmail";
- sBperm.zvalidate = NULL;
- sBperm.zmyname = NULL;
- sBperm.zpubdir = NULL;
-
- fany = FALSE;
-
- for (ztok = strtok (zline, " \t");
- ztok != NULL;
- ztok = strtok ((char *) NULL, " \t"))
- {
- char *zeq;
- char *azargs[2];
-
- fany = TRUE;
-
- zeq = strchr (ztok, '=');
- if (zeq == NULL)
- {
- ulog (LOG_ERROR, "Bad %s entry: %s", BNU_PERMISSIONS,
- ztok);
- continue;
- }
- *zeq = '\0';
-
- azargs[0] = ztok;
- azargs[1] = zeq + 1;
- (void) tprocess_one_cmd (2, azargs, asBperm_cmds,
- BNU_PERMISSIONS, CMDFLAG_WARNUNRECOG);
- }
-
- if (! fany)
- continue;
-
- if (sBperm.zlogname != NULL)
- {
- char *zstart;
- boolean fend;
-
- /* Process each LOGNAME separately. */
- zstart = sBperm.zlogname;
- do
- {
- int c;
-
- c = strcspn (zstart, ":");
- fend = zstart[c] == '\0';
- zstart[c] = '\0';
-
- sBperm.zlogname = zstart;
- ubadd_perm (*pc, *ppas, &affound);
-
- zstart += c + 1;
- }
- while (! fend);
- }
- else if (sBperm.zmachine != NULL)
- ubadd_perm (*pc, *ppas, &affound);
- else
- {
- ulog (LOG_ERROR,
- "%s: No MACHINE or LOGNAME entry: \"%s\"",
- BNU_PERMISSIONS, zline);
- xfree ((pointer) zline);
- }
- }
-
- (void) fclose (e);
-
- /* If there were any MACHINE=OTHER entry, add the permissions for
- each machine that was not specified by name. */
-
- while (qBothers != NULL)
- {
- int i;
- struct spermlist *qnext;
-
- sBperm = qBothers->sperm;
- for (i = 0; i < *pc; i++)
- {
- if (! affound[i])
- {
- sBperm.zmachine = xstrdup ((*ppas)[i].zname);
- ubadd_perm (*pc, *ppas, &affound);
- xfree ((pointer) sBperm.zmachine);
- }
- }
-
- qnext = qBothers->qnext;
- xfree ((pointer) qBothers);
- qBothers = qnext;
- }
- }
-}
-
-/* Look up a machine and attach permissions to it. */
-
-static void
-ubadd_perm (csystems, passystems, paffound)
- int csystems;
- struct ssysteminfo *passystems;
- boolean **paffound;
-{
- if (sBperm.zmachine != NULL)
- {
- char *zcopy;
- char *ztok;
-
- if (strcmp (sBperm.zmachine, "OTHER") == 0)
- {
- struct spermlist *qnew;
-
- qnew = (struct spermlist *) xmalloc (sizeof (struct spermlist));
- qnew->qnext = qBothers;
- qnew->sperm = sBperm;
- qBothers = qnew;
- return;
- }
-
- zcopy = (char *) alloca (strlen (sBperm.zmachine) + 1);
- strcpy (zcopy, sBperm.zmachine);
-
- for (ztok = strtok (zcopy, ":");
- ztok != NULL;
- ztok = strtok ((char *) NULL, ":"))
- {
- int i;
- struct ssysteminfo *q;
-
- for (i = 0; i < csystems; i++)
- if (strcmp (passystems[i].zname, ztok) == 0)
- break;
- if (i >= csystems)
- {
- /* We just ignore Permissions entries for unknown
- systems. */
- continue;
- }
-
- if ((*paffound)[i])
- {
- struct ssysteminfo **pq;
-
- /* We have already handled this machine. Make a copy of
- the first alternate and set the login name to
- whatever this entry wants. Then put the new entry at
- the end of list of alternates. This will make
- whatever we saw first the default. */
- q = ((struct ssysteminfo *)
- xmalloc (sizeof (struct ssysteminfo)));
- *q = passystems[i];
- q->qalternate = NULL;
- for (pq = &passystems[i].qalternate;
- *pq != NULL;
- pq = &(*pq)->qalternate)
- ;
- *pq = q;
- q->zcalled_login = "ANY";
- ubadd_perm_alternate (q, TRUE, sBperm.zlogname != NULL);
- }
- else
- {
- (*paffound)[i] = TRUE;
- for (q = &passystems[i]; q != NULL; q = q->qalternate)
- ubadd_perm_alternate (q, TRUE,
- sBperm.zlogname != NULL);
- }
- }
- }
- else
- {
- int i;
-
-#if DEBUG > 0
- if (sBperm.zlogname == NULL)
- ulog (LOG_FATAL, "bnu.c: ubadd_perm: Can't happen");
-#endif
-
- /* There was a LOGNAME= but no MACHINE=. We must add an
- alternate specifying this LOGNAME to all machines. */
-
- for (i = 0; i < csystems; i++)
- {
- struct ssysteminfo *q;
-
- if (passystems[i].zcalled_login == NULL)
- passystems[i].zcalled_login = "ANY";
-
- q = (struct ssysteminfo *) xmalloc (sizeof (struct ssysteminfo));
- *q = passystems[i];
- q->qalternate = passystems[i].qalternate;
- passystems[i].qalternate = q;
-
- ubadd_perm_alternate (q, FALSE, TRUE);
- }
- }
-}
-
-/* Attach permissions to a specific alternate of a machine. */
-
-static void
-ubadd_perm_alternate (q, fmachine, flogname)
- struct ssysteminfo *q;
- boolean fmachine;
- boolean flogname;
-{
- char *z, *zset;
-
- if (flogname)
- {
- if (q->zcalled_login != NULL
- && strcmp (q->zcalled_login, "ANY") != 0)
- ulog (LOG_ERROR, "%s: Can't handle two login names for one machine",
- q->zname);
- else
- q->zcalled_login = sBperm.zlogname;
- }
- if (fmachine)
- q->fcall_request = sBperm.frequest;
- if (flogname)
- q->fcalled_request = sBperm.frequest;
- if (flogname)
- {
- q->fcall_transfer = (sBperm.tsendfiles == SENDFILES_CALL
- || (sBperm.tsendfiles == SENDFILES_YES));
- q->fcalled_transfer = sBperm.tsendfiles == SENDFILES_YES;
- }
-
- zset = xstrdup (sBperm.zread);
- while ((z = strchr (zset, ':')) != NULL)
- *z = ' ';
- if (sBperm.znoread != NULL)
- {
- char *zstart;
- boolean fend;
-
- zstart = xstrdup (sBperm.znoread);
- do
- {
- char *zalloc;
- int c;
-
- c = strcspn (zstart, ":");
- fend = zstart[c] == '\0';
- zstart[c] = '\0';
-
- zalloc = (char *) xmalloc (c + 2);
- sprintf (zalloc, "!%s", zstart);
- uadd_string (&zset, zalloc, ' ');
- xfree ((pointer) zalloc);
-
- zstart += c + 1;
- }
- while (! fend);
- }
- if (fmachine)
- q->zremote_send = zset;
- if (flogname)
- {
- if (fmachine)
- q->zcalled_remote_send = NULL;
- else
- q->zcalled_remote_send = zset;
- }
-
- zset = xstrdup (sBperm.zwrite);
- while ((z = strchr (zset, ':')) != NULL)
- *z = ' ';
- if (sBperm.znowrite != NULL)
- {
- char *zstart;
- boolean fend;
-
- zstart = xstrdup (sBperm.znowrite);
- do
- {
- char *zalloc;
- int c;
-
- c = strcspn (zstart, ":");
- fend = zstart[c] == '\0';
- zstart[c] = '\0';
-
- zalloc = (char *) xmalloc (c + 2);
- sprintf (zalloc, "!%s", zstart);
- uadd_string (&zset, zalloc, ' ');
- xfree ((pointer) zalloc);
-
- zstart += c + 1;
- }
- while (! fend);
- }
- if (fmachine)
- q->zremote_receive = zset;
- if (flogname)
- {
- if (fmachine)
- q->zcalled_remote_receive = NULL;
- else
- q->zcalled_remote_receive = zset;
- }
-
- if (flogname)
- q->fcallback = sBperm.fcallback;
-
- if (fmachine && sBperm.zcommands != NULL)
- {
- q->zcmds = sBperm.zcommands;
- while ((z = strchr (q->zcmds, ':')) != NULL)
- *z = ' ';
- }
-
- if (flogname && sBperm.zvalidate != NULL)
- {
- char *zcopy;
- boolean fend;
-
- zcopy = xstrdup (sBperm.zvalidate);
-
- do
- {
- int c;
-
- c = strcspn (zcopy, ":");
- fend = zcopy[c] == '\0';
- zcopy[c] = '\0';
-
- uadd_validate (sBperm.zlogname, 1, (const char **) &zcopy);
-
- zcopy += c + 1;
- }
- while (! fend);
- }
-
- if (fmachine)
- q->zlocalname = sBperm.zmyname;
-
- /* This isn't quite right, since the BNU Permissions file can
- specify a different public directory based on whether we are
- calling out or are being called. */
- if (sBperm.zpubdir != NULL)
- q->zpubdir = sBperm.zpubdir;
-}
-
-/* Handle SENDFILES=string, where string can be YES, NO or CALL. We
- actually only switch off on the first letter. */
-
-/*ARGSUSED*/
-static enum tcmdtabret
-tbsendfiles (argc, argv, pvar, zerr)
- int argc;
- char **argv;
- pointer pvar;
- const char *zerr;
-{
- switch (argv[1][0])
- {
- case 'C':
- case 'c':
- sBperm.tsendfiles = SENDFILES_CALL;
- break;
- case 'N':
- case 'n':
- sBperm.tsendfiles = SENDFILES_NO;
- break;
- case 'Y':
- case 'y':
- sBperm.tsendfiles = SENDFILES_YES;
- break;
- default:
- ulog (LOG_ERROR, "%s: Unrecognized SENDFILES=%s", zerr, argv[1]);
- break;
- }
-
- return CMDTABRET_FREE;
-}
-
-/* Find a port with a given name and baud rate in the Devices file,
- and lock it. If found and locked, fill in the structure pointed at
- by qport. Set *pffound to TRUE if a port was found but could not
- be locked. */
-
-boolean
-fbnu_find_port (zname, ibaud, ihighbaud, qport, pflock, pffound)
- const char *zname;
- long ibaud;
- long ihighbaud;
- struct sport *qport;
- boolean (*pflock) P((struct sport *, boolean fin));
- boolean *pffound;
-{
- struct smulti_file *qmulti;
- char *zline;
-
- qmulti = qmulti_open (zBnu_devices);
- if (qmulti == NULL)
- return FALSE;
-
- while ((zline = zmulti_gets (qmulti, (boolean *) NULL,
- (const char **) NULL, TRUE)) != NULL)
- {
- int inl;
- char *ztok, *zportname, *zprotocols, *zdevice, *zdial_device;
- long ilow, ihigh;
-
- inl = strlen (zline) - 1;
- if (zline[inl] == '\n')
- zline[inl] = '\0';
- if (isspace (BUCHAR (zline[0])) || zline[0] == '#')
- {
- xfree ((pointer) zline);
- continue;
- }
-
- /* An entry in Devices is type device dial-device baud
- dialer-token pairs. */
-
- /* Get the port type. */
- zportname = strtok (zline, " \t");
- if (zportname == NULL)
- {
- xfree ((pointer) zline);
- continue;
- }
-
- /* There may be a comma separated list of protocols following
- the port name. */
- zprotocols = strchr (zportname, ',');
- if (zprotocols != NULL)
- {
- *zprotocols = '\0';
- ++zprotocols;
- }
-
- /* Get the device name. */
- zdevice = strtok ((char *) NULL, " \t");
- if (zdevice == NULL)
- {
- xfree ((pointer) zline);
- continue;
- }
-
- /* Some systems seem to permit ,M at the end of the device name;
- this means to open the port with O_NDELAY and then allow
- delays later. We always do this anyhow, so I just ignore the
- ,M. There may be portability problems here. */
- zdevice[strcspn (zdevice, ",")] = '\0';
-
- /* Get the dial-device. A value of ``-'' means none. */
- zdial_device = strtok ((char *) NULL, " \t");
- if (zdial_device == NULL)
- {
- xfree ((pointer) zline);
- continue;
- }
- if (strcmp (zdial_device, "-") == 0)
- zdial_device = NULL;
-
- /* Get the speed. */
- ztok = strtok ((char *) NULL, " \t");
- if (ztok == NULL)
- {
- xfree ((pointer) zline);
- continue;
- }
-
- /* See whether we match the port name we are looking for. If
- the speed starts with a non-digit, it is a modem class (but
- "-" or "Any" mean any speed). When reading the Systems file
- we appended the modem class to the device name, so we must
- match appropriately. */
- if (isdigit (*ztok)
- || strcmp (ztok, "-") == 0
- || strcmp (ztok, "Any") == 0)
- {
- if (zname != NULL && strcmp (zname, zportname) != 0)
- {
- xfree ((pointer) zline);
- continue;
- }
- }
- else
- {
- char *zclass, *zset;
-
- zclass = (char *) alloca (strlen (ztok) + 1);
- zset = zclass;
- while (*ztok != '\0' && ! isdigit (*ztok))
- *zset++ = *ztok++;
- *zset = '\0';
-
- if (zname != NULL)
- {
- int clen;
-
- clen = strlen (zportname);
- if (strncmp (zname, zportname, clen) != 0
- || strlen (zname) <= clen
- || strcmp (zname + clen, zclass) != 0)
- {
- xfree ((pointer) zline);
- continue;
- }
- }
- }
-
- ilow = strtol (ztok, &ztok, 10);
- if (ilow == 0)
- ihigh = 38400L;
- else
- {
- if (*ztok == '-')
- ihigh = atol (ztok + 1);
- else
- ihigh = ilow;
- }
-
- /* Now we must match the range ibaud to ihighbaud against to
- range ilow to ihigh. */
- if (ibaud != 0
- && (ihighbaud < ilow || ibaud > ihigh))
- {
- xfree ((pointer) zline);
- continue;
- }
-
- /* We have found a matching port. We now fill in the sport
- structure so that we can try to lock it. */
- if (zname != NULL)
- qport->zname = zname;
- else
- qport->zname = zportname;
- qport->zprotocols = zprotocols;
- qport->cproto_params = 0;
- qport->qproto_params = NULL;
- qport->ireliable = 0;
- qport->zlockname = NULL;
- if (strcmp (qport->zname, "Direct") == 0)
- {
- qport->ttype = PORTTYPE_DIRECT;
- qport->u.sdirect.zdevice = zdevice;
- qport->u.sdirect.ibaud = ilow;
-#ifdef SYSDEP_DIRECT_INIT
- SYSDEP_DIRECT_INIT (&qport->u.sdirect.s);
-#endif
- }
-#if HAVE_TCP
- else if (strcmp (qport->zname, "TCP") == 0)
- {
- qport->ttype = PORTTYPE_TCP;
- qport->ireliable = (RELIABLE_ENDTOEND
- | RELIABLE_RELIABLE
- | RELIABLE_EIGHT
- | RELIABLE_SPECIFIED);
- qport->u.stcp.o = -1;
- qport->u.stcp.zport = zdevice;
- }
-#endif /* HAVE_TCP */
- else
- {
- qport->ttype = PORTTYPE_MODEM;
- qport->u.smodem.zdevice = zdevice;
- qport->u.smodem.zdial_device = zdial_device;
- if (ilow != ihigh)
- qport->u.smodem.ibaud = 0;
- else
- qport->u.smodem.ibaud = ilow;
- qport->u.smodem.ilowbaud = ilow;
- qport->u.smodem.ihighbaud = ihigh;
- qport->u.smodem.fcarrier = TRUE;
- qport->u.smodem.zdialer = strtok ((char *) NULL, "");
- qport->u.smodem.zdialer += strspn (qport->u.smodem.zdialer,
- " \t");
- qport->u.smodem.qdialer = NULL;
-#ifdef SYSDEP_MODEM_INIT
- SYSDEP_MODEM_INIT (&qport->u.smodem.s);
-#endif
- }
-
- if (pffound != NULL)
- *pffound = TRUE;
-
- if (pflock != NULL
- && ! (*pflock) (qport, FALSE))
- {
- xfree ((pointer) zline);
- continue;
- }
-
- (void) fmulti_close (qmulti);
-
- return TRUE;
- }
-
- (void) fmulti_close (qmulti);
-
- return FALSE;
-}
-
-/* Read dialer information from the Dialers file. */
-
-boolean
-fbnu_read_dialer_info (zdialer, qdialer)
- const char *zdialer;
- struct sdialer *qdialer;
-{
- struct smulti_file *qmulti;
- char *zline;
-
- qmulti = qmulti_open (zBnu_dialers);
- if (qmulti == NULL)
- return FALSE;
-
- while ((zline = zmulti_gets (qmulti, (boolean *) NULL,
- (const char **) NULL, TRUE)) != NULL)
- {
- int inl;
- char *zname, *zsubs;
-
- inl = strlen (zline) - 1;
- if (zline[inl] == '\n')
- zline[inl] = '\0';
- if (isspace (BUCHAR (zline[0])) || zline[0] == '#')
- {
- xfree ((pointer) zline);
- continue;
- }
-
- zname = strtok (zline, " \t");
- if (zname == NULL
- || strcmp (zname, zdialer) != 0)
- {
- xfree ((pointer) zline);
- continue;
- }
-
- /* We found the dialer we want. Get information from it. */
-
- qdialer->zname = zdialer;
- INIT_CHAT (&qdialer->schat);
- qdialer->zdialtone = ",";
- qdialer->zpause = ",";
- qdialer->fcarrier = TRUE;
- qdialer->ccarrier_wait = 60;
- qdialer->fdtr_toggle = FALSE;
- qdialer->fdtr_toggle_wait = FALSE;
- INIT_CHAT (&qdialer->scomplete);
- INIT_CHAT (&qdialer->sabort);
- qdialer->cproto_params = 0;
- qdialer->qproto_params = NULL;
- qdialer->ireliable = 0;
-
- zsubs = strtok ((char *) NULL, " \t");
-
- if (zsubs != NULL && strcmp (zsubs, "\"\"") != 0)
- {
- char bnext;
-
- bnext = *zsubs;
- while (bnext != '\0')
- {
- if (zsubs[1] == '\0')
- break;
- if (bnext == '=')
- qdialer->zdialtone = zsubs + 1;
- else if (bnext == '-')
- qdialer->zpause = zsubs + 1;
- zsubs += 2;
- bnext = *zsubs;
- *zsubs = '\0';
- }
- }
-
- if (zsubs == NULL)
- qdialer->schat.zchat = NULL;
- else
- {
- qdialer->schat.zchat = strtok ((char *) NULL, "");
- qdialer->schat.zchat += strspn (qdialer->schat.zchat, " \t");
- }
-
- (void) fmulti_close (qmulti);
-
- return TRUE;
- }
-
- (void) fmulti_close (qmulti);
-
- return FALSE;
-}
-
-#endif /* HAVE_BNU_CONFIG */
diff --git a/gnu/libexec/uucp/chat.c b/gnu/libexec/uucp/chat.c
deleted file mode 100644
index 47c93389027..00000000000
--- a/gnu/libexec/uucp/chat.c
+++ /dev/null
@@ -1,1430 +0,0 @@
-/* chat.c
- Chat routine for the UUCP package.
-
- Copyright (C) 1991, 1992 Ian Lance Taylor
-
- This file is part of the Taylor UUCP package.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- The author of the program may be contacted at ian@airs.com or
- c/o AIRS, P.O. Box 520, Waltham, MA 02254.
-
- $Log: chat.c,v $
- Revision 1.1.1.1 1993/03/21 09:45:37 cgd
- initial import of 386bsd-0.1 sources
-
- Revision 1.26 1992/04/03 05:37:11 ian
- Minor cleanups for gcc 2.1
-
- Revision 1.25 1992/03/28 21:47:55 ian
- David J. MacKenzie: allow backslash to quote newline in config files
-
- Revision 1.24 1992/03/28 21:28:00 ian
- David J. MacKenzie: handle empty subexpect strings correctly
-
- Revision 1.23 1992/03/28 19:57:22 ian
- David J. MacKenzie: send port device for /Y rather than port name
-
- Revision 1.22 1992/03/17 01:03:03 ian
- Miscellaneous cleanup
-
- Revision 1.21 1992/03/16 21:21:59 ian
- Scott Ballantyne: go ahead and send an illegal send script character
-
- Revision 1.20 1992/03/16 00:47:15 ian
- Turn off DEBUG_PORT for chat script debugging
-
- Revision 1.19 1992/03/12 19:56:10 ian
- Debugging based on types rather than number
-
- Revision 1.18 1992/03/11 19:53:55 ian
- Improved chat script debugging
-
- Revision 1.17 1992/03/04 00:36:44 ian
- Michael Richardson: better chat script debugging
-
- Revision 1.16 1992/03/03 06:06:48 ian
- T. William Wells: don't complain about missing configuration files
-
- Revision 1.15 1992/02/19 19:36:07 ian
- Rearranged time functions
-
- Revision 1.14 1992/02/19 05:24:07 ian
- Bob Denny: if no trailing send string, don't send a carriage return
-
- Revision 1.13 1992/02/08 03:54:18 ian
- Include <string.h> only in <uucp.h>, added 1992 copyright
-
- Revision 1.12 1992/02/02 06:38:22 ian
- Michael Nolan: chat script strings might be separated by more than just ' '
-
- Revision 1.11 1992/01/05 03:11:06 ian
- Made fcsend static
-
- Revision 1.10 1991/12/28 03:49:23 ian
- Added HAVE_MEMFNS and HAVE_BFNS; changed uses of memset to bzero
-
- Revision 1.9 1991/12/17 23:14:08 ian
- T. William Wells: allow dialer complete and abort to be chat scripts
-
- Revision 1.8 1991/12/15 04:17:11 ian
- Added chat-seven-bit command to control parity bit stripping
-
- Revision 1.7 1991/12/15 03:42:33 ian
- Added tprocess_chat_cmd for all chat commands, and added CMDTABTYPE_PREFIX
-
- Revision 1.6 1991/12/13 04:27:33 ian
- Franc,ois Pinard: add some chat script debugging messages
-
- Revision 1.5 1991/12/07 17:58:38 ian
- Handle a chat script with nothing but a send string
-
- Revision 1.4 1991/12/06 21:10:27 ian
- Franc,ois Pinard: ccescape should never return a negative number
-
- Revision 1.3 1991/11/11 23:47:24 ian
- Added chat-program to run a program to do a chat script
-
- Revision 1.2 1991/11/11 19:32:03 ian
- Added breceive_char to read characters through protocol buffering
-
- Revision 1.1 1991/09/10 19:38:16 ian
- Initial revision
-
- */
-
-#include "uucp.h"
-
-#if USE_RCS_ID
-char chat_rcsid[] = "$Id: chat.c,v 1.1.1.1 1993/03/21 09:45:37 cgd Exp $";
-#endif
-
-#include <ctype.h>
-#include <errno.h>
-
-#include "port.h"
-#include "system.h"
-
-/* Local functions. */
-
-static int ccescape P((char *zbuf));
-static int icexpect P((int cstrings, char **azstrings, int *aclens,
- int ctimeout, boolean fstrip));
-static boolean fcsend P((const char *zsend,
- const struct ssysteminfo *qsys,
- const struct sdialer *qdial,
- const char *zphone,
- boolean ftranslate));
-static boolean fcecho_send P((const char *z, int clen));
-static boolean fcphone P((const struct sdialer *qdial, const char *zphone,
- boolean (*pfwrite) P((const char *zwrite,
- int cwrite)),
- boolean ftranslate, boolean *pfquote));
-static boolean fctranslate P((const char *zphone, const char **pzprefix,
- const char **pzsuffix));
-static boolean fcprogram P((const char *zprogram,
- const struct ssysteminfo *qsys,
- const struct sdialer *qdial,
- const char *zphone, const char *zport,
- long ibaud));
-
-/* Run a chat script with the other system. The chat script is a
- series of expect send pairs. We wait for the expect string to show
- up, and then we send the send string. The chat string for a system
- holds the expect and send strings separated by a single space. */
-
-boolean
-fchat (qchat, qsys, qdial, zphone, ftranslate, zport, ibaud)
- const struct schat_info *qchat;
- const struct ssysteminfo *qsys;
- const struct sdialer *qdial;
- const char *zphone;
- boolean ftranslate;
- const char *zport;
- long ibaud;
-{
- const char *zchat;
- int cstrings;
- char **azstrings;
- int *aclens;
- char *zbuf;
-
- /* First run the program, if any. */
- if (qchat->zprogram != NULL)
- {
- if (! fcprogram (qchat->zprogram, qsys, qdial, zphone, zport, ibaud))
- return FALSE;
- }
-
- /* If there's no chat script, we're done. */
- if (qchat->zchat == NULL)
- return TRUE;
-
- zchat = qchat->zchat;
-
- if (qchat->zfail == NULL)
- {
- cstrings = 1;
- azstrings = (char **) alloca (sizeof (char *));
- aclens = (int *) alloca (sizeof (int));
- }
- else
- {
- const char *zlook;
- char *zcopy, *z;
-
- /* We leave string number 0 for the chat script; after that
- we want 1 more than the number of spaces in the chat_fail
- string (the fencepost problem). */
- cstrings = 2;
- for (zlook = qchat->zfail; *zlook != '\0'; zlook++)
- if (*zlook == ' ')
- ++cstrings;
-
- azstrings = (char **) alloca (cstrings * sizeof (char *));
- aclens = (int *) alloca (cstrings * sizeof (int));
-
- zcopy = (char *) alloca (strlen (qchat->zfail) + 1);
- strcpy (zcopy, qchat->zfail);
-
- /* Get the strings into the array, and handle all the escape
- characters. */
- cstrings = 1;
- azstrings[1] = zcopy;
- for (z = zcopy; *z != '\0'; z++)
- {
- if (*z == ' ')
- {
- *z++ = '\0';
- aclens[cstrings] = ccescape (azstrings[cstrings]);
- ++cstrings;
- azstrings[cstrings] = z;
- }
- }
- aclens[cstrings] = ccescape (azstrings[cstrings]);
- ++cstrings;
- }
-
- zbuf = (char *) alloca (strlen (zchat) + 1);
-
- while (*zchat != '\0')
- {
- int cchatlen;
- char *znext;
-
- /* Get this expect string into zbuf. */
- cchatlen = strcspn (zchat, " \t");
- strncpy (zbuf, zchat, cchatlen);
- zbuf[cchatlen] = '\0';
- zchat += cchatlen;
- zchat += strspn (zchat, " \t");
-
- /* Separate out the first subexpect string. */
- azstrings[0] = zbuf;
- znext = strchr (zbuf, '-');
- if (znext != NULL)
- *znext = '\0';
- aclens[0] = ccescape (azstrings[0]);
-
- /* Loop over subexpects and subsends. */
- while (TRUE)
- {
- char *zsub;
-
- if (aclens[0] == 0
- || (aclens[0] == 2
- && strcmp (azstrings[0], "\"\"") == 0))
- {
- /* There is no subexpect sequence. If there is a
- subsend sequence we move on to it. Otherwise we let
- this expect succeed. This is somewhat inconsistent,
- but it seems to be the traditional approach. */
- if (znext == NULL)
- break;
- }
- else
- {
- int istr;
-
- istr = icexpect (cstrings, azstrings, aclens,
- qchat->ctimeout, qchat->fstrip);
-
- /* If we found the string, break out of the
- subexpect/subsend loop. */
- if (istr == 0)
- break;
-
- /* If we got an error, return FALSE. */
- if (istr < -1)
- return FALSE;
-
- /* If we found a failure string, log it and get out. */
- if (istr > 0)
- {
- const char *zfail;
- int clen;
- char *zcopy;
-
- zfail = qchat->zfail;
- for (--istr; istr > 0; --istr)
- zfail = strchr (zfail, ' ') + 1;
- clen = strcspn (zfail, " ");
- zcopy = (char *) alloca (clen + 1);
- strncpy (zcopy, zfail, clen);
- zcopy[clen] = '\0';
- ulog (LOG_ERROR, "Chat script failed: Got \"%s\"",
- zcopy);
- return FALSE;
- }
-
- /* We timed out; look for a send subsequence. If none,
- the chat script has failed. */
- if (znext == NULL)
- {
- ulog (LOG_ERROR, "Timed out in chat script");
- return FALSE;
- }
- }
-
- /* Send the send subsequence. A \"\" will send nothing. An
- empty string will send a carriage return. */
- ++znext;
- zsub = znext;
- znext = strchr (zsub, '-');
- if (znext != NULL)
- *znext = '\0';
- if (! fcsend (zsub, qsys, qdial, zphone, ftranslate))
- return FALSE;
-
- /* If there is no expect subsequence, we are done. */
- if (znext == NULL)
- break;
-
- /* Move on to next expect subsequence. */
- ++znext;
- azstrings[0] = znext;
- znext = strchr (azstrings[0], '-');
- if (znext != NULL)
- *znext = '\0';
- aclens[0] = ccescape (azstrings[0]);
- }
-
- /* We matched the expect string. */
- if (*zchat == '\0')
- return TRUE;
-
- /* Copy the send string into zbuf. */
- cchatlen = strcspn (zchat, " \t");
- strncpy (zbuf, zchat, cchatlen);
- zbuf[cchatlen] = '\0';
- zchat += cchatlen;
- zchat += strspn (zchat, " \t");
-
- if (*zbuf != '\0')
- {
- if (! fcsend (zbuf, qsys, qdial, zphone, ftranslate))
- return FALSE;
- }
- }
-
- /* The chat sequence has been completed. */
- return TRUE;
-}
-
-/* Translate escape sequences within an expect string. */
-
-static int
-ccescape (z)
- char *z;
-{
- char *zto, *zfrom;
-
- zto = z;
- zfrom = z;
- while (*zfrom != '\0')
- {
- if (*zfrom != '\\')
- {
- *zto++ = *zfrom++;
- continue;
- }
- ++zfrom;
- switch (*zfrom)
- {
- case 'b':
- *zto++ = '\b';
- break;
- case 'n':
- *zto++ = '\n';
- break;
- case 'N':
- *zto++ = '\0';
- break;
- case 'r':
- *zto++ = '\r';
- break;
- case 's':
- *zto++ = ' ';
- break;
- case 't':
- *zto++ = '\t';
- break;
- case '\0':
- --zfrom;
- /* Fall through. */
- case '\\':
- *zto++ = '\\';
- break;
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- {
- int i;
-
- i = *zfrom - '0';
- if (zfrom[1] >= '0' && zfrom[1] <= '7')
- i = 8 * i + *++zfrom - '0';
- if (zfrom[1] >= '0' && zfrom[1] <= '7')
- i = 8 * i + *++zfrom - '0';
- *zto++ = (char) i;
- }
- break;
- case 'x':
- {
- int i;
-
- i = 0;
- while (isxdigit (BUCHAR (zfrom[1])))
- {
- if (isdigit (BUCHAR (zfrom[1])))
- i = 16 * i + *++zfrom - '0';
- else if (isupper (BUCHAR (zfrom[1])))
- i = 16 * i + *++zfrom - 'A';
- else
- i = 16 * i + *++zfrom - 'a';
- }
- *zto++ = (char) i;
- }
- break;
- default:
- ulog (LOG_ERROR,
- "Unrecognized escape sequence \\%c in expect string",
- *zfrom);
- *zto++ = *zfrom;
- break;
- }
-
- ++zfrom;
- }
-
- *zto = '\0';
-
- return zto - z;
-}
-
-/* Read characters and wait for one of a set of memory strings to come
- in. This returns the index into the array of the string that
- arrives, or -1 on timeout, or -2 on error. */
-
-static int
-icexpect (cstrings, azstrings, aclens, ctimeout, fstrip)
- int cstrings;
- char **azstrings;
- int *aclens;
- int ctimeout;
- boolean fstrip;
-{
- int i;
- int cmin, cmax;
- char *zhave;
- int chave;
- long iendtime;
-#if DEBUG > 1
- int cchars;
- int iolddebug;
-#endif
-
- cmax = cmin = aclens[0];
- for (i = 1; i < cstrings; i++)
- {
- if (cmax < aclens[i])
- cmax = aclens[i];
- if (cmin > aclens[i])
- cmin = aclens[i];
- }
-
- zhave = (char *) alloca (cmax);
- chave = 0;
-
- iendtime = isysdep_time ((long *) NULL) + ctimeout;
-
-#if DEBUG > 1
- cchars = 0;
- iolddebug = iDebug;
- if (FDEBUGGING (DEBUG_CHAT))
- {
- udebug_buffer ("icexpect: Looking for", azstrings[0],
- aclens[0]);
- ulog (LOG_DEBUG_START, "icexpect: Got \"");
- iDebug &=~ (DEBUG_INCOMING | DEBUG_PORT);
- }
-#endif
-
- while (TRUE)
- {
- int bchar;
-
- /* If we have no more time, get out. */
- if (ctimeout <= 0)
- {
-#if DEBUG > 1
- if (FDEBUGGING (DEBUG_CHAT))
- {
- ulog (LOG_DEBUG_END, "\" (timed out)");
- iDebug = iolddebug;
- }
-#endif
- return -1;
- }
-
- /* Read one character at a time. We could use a more complex
- algorithm to read in larger batches, but it's probably not
- worth it. If the buffer is full, shift it left; we already
- know that no string matches, and the buffer holds the largest
- string, so this can't lose a match. */
- if (chave >= cmax)
- {
- xmemmove (zhave, zhave + 1, cmax - 1);
- --chave;
- }
-
- /* The timeout/error return values from breceive_char are the
- same as for this function. */
- bchar = breceive_char (ctimeout, TRUE);
- if (bchar < 0)
- {
-#if DEBUG > 1
- if (FDEBUGGING (DEBUG_CHAT))
- {
- /* If there was an error, it will probably be logged in
- the middle of our string, but this is only debugging
- so it's not a big deal. */
- ulog (LOG_DEBUG_END, "\" (%s)",
- bchar == -1 ? "timed out" : "error");
- iDebug = iolddebug;
- }
-#endif
- return bchar;
- }
-
- /* Strip the parity bit if desired. */
- if (fstrip)
- bchar &= 0x7f;
-
- zhave[chave] = (char) bchar;
- ++chave;
-
-#if DEBUG > 1
- if (FDEBUGGING (DEBUG_CHAT))
- {
- char ab[5];
-
- ++cchars;
- if (cchars > 60)
- {
- ulog (LOG_DEBUG_END, "\"");
- ulog (LOG_DEBUG_START, "icexpect: Got \"");
- cchars = 0;
- }
- (void) cdebug_char (ab, bchar);
- ulog (LOG_DEBUG_CONTINUE, "%s", ab);
- }
-#endif
-
- /* See if any of the strings can be found in the buffer. Since
- we read one character at a time, the string can only be found
- at the end of the buffer. */
- for (i = 0; i < cstrings; i++)
- {
- if (aclens[i] <= chave
- && memcmp (zhave + chave - aclens[i], azstrings[i],
- aclens[i]) == 0)
- {
-#if DEBUG > 1
- if (FDEBUGGING (DEBUG_CHAT))
- {
- if (i == 0)
- ulog (LOG_DEBUG_END, "\" (found it)");
- else
- {
- ulog (LOG_DEBUG_END, "\"");
- udebug_buffer ("icexpect: Found", azstrings[i],
- aclens[i]);
- }
- iDebug = iolddebug;
- }
-#endif
- return i;
- }
- }
-
- ctimeout = (int) (iendtime - isysdep_time ((long *) NULL));
- }
-}
-
-#if DEBUG > 1
-
-/* Debugging function for fcsend. This takes the fquote variable, the
- length of the string (0 if this an informational string which can
- be printed directly) and the string itself. It returns the new
- value for fquote. The fquote variable is TRUE if the debugging
- output is in the middle of a quoted string. */
-
-static int cCsend_chars;
-static int iColddebug;
-
-static boolean fcsend_debug P((boolean, int, const char *));
-
-static boolean
-fcsend_debug (fquote, clen, zbuf)
- boolean fquote;
- int clen;
- const char *zbuf;
-{
- int cwas;
-
- if (! FDEBUGGING (DEBUG_CHAT))
- return TRUE;
-
- cwas = cCsend_chars;
- if (clen > 0)
- cCsend_chars += clen;
- else
- cCsend_chars += strlen (zbuf);
- if (cCsend_chars > 60 && cwas > 10)
- {
- ulog (LOG_DEBUG_END, "%s", fquote ? "\"" : "");
- fquote = FALSE;
- ulog (LOG_DEBUG_START, "fcsend: Writing");
- cCsend_chars = 0;
- }
-
- if (clen == 0)
- {
- ulog (LOG_DEBUG_CONTINUE, "%s %s", fquote ? "\"" : "", zbuf);
- return FALSE;
- }
- else
- {
- int i;
-
- if (! fquote)
- ulog (LOG_DEBUG_CONTINUE, " \"");
- for (i = 0; i < clen; i++)
- {
- char ab[5];
-
- (void) cdebug_char (ab, zbuf[i]);
- ulog (LOG_DEBUG_CONTINUE, "%s", ab);
- }
-
- return TRUE;
- }
-}
-
-/* Finish up the debugging information for fcsend. */
-
-static void ucsend_debug_end P((boolean, boolean));
-
-static void
-ucsend_debug_end (fquote, ferr)
- boolean fquote;
- boolean ferr;
-{
- if (! FDEBUGGING (DEBUG_CHAT))
- return;
-
- if (fquote)
- ulog (LOG_DEBUG_CONTINUE, "\"");
-
- if (ferr)
- ulog (LOG_DEBUG_CONTINUE, " (error)");
-
- ulog (LOG_DEBUG_END, "%s", "");
-
- iDebug = iColddebug;
-}
-
-#else /* DEBUG <= 1 */
-
-/* Use macro definitions to make fcsend look neater. */
-
-#define fcsend_debug(fquote, clen, zbuf) TRUE
-
-#define ucsend_debug_end(fquote, ferror)
-
-#endif /* DEBUG <= 1 */
-
-/* Send a string out. This has to parse escape sequences as it goes.
- Note that it handles the dialer escape sequences (\e, \E, \D, \T)
- although they make no sense for chatting with a system. */
-
-static boolean
-fcsend (z, qsys, qdial, zphone, ftranslate)
- const char *z;
- const struct ssysteminfo *qsys;
- const struct sdialer *qdial;
- const char *zphone;
- boolean ftranslate;
-{
- boolean fnocr;
- boolean (*pfwrite) P((const char *, int));
- char *zcallout_login;
- char *zcallout_pass;
- boolean fquote;
-
- if (strcmp (z, "\"\"") == 0)
- return TRUE;
-
- fnocr = FALSE;
- pfwrite = fport_write;
- zcallout_login = NULL;
- zcallout_pass = NULL;
-
-#if DEBUG > 1
- if (FDEBUGGING (DEBUG_CHAT))
- {
- ulog (LOG_DEBUG_START, "fcsend: Writing");
- fquote = FALSE;
- cCsend_chars = 0;
- iColddebug = iDebug;
- iDebug &=~ (DEBUG_OUTGOING | DEBUG_PORT);
- }
-#endif
-
- while (*z != '\0')
- {
- const char *zlook;
- boolean fsend;
- char bsend;
-
- zlook = z + strcspn (z, "\\BE");
-
- if (zlook > z)
- {
- fquote = fcsend_debug (fquote, zlook - z, z);
- if (! (*pfwrite) (z, zlook - z))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- }
-
- if (*zlook == '\0')
- break;
-
- z = zlook;
-
- fsend = FALSE;
- switch (*z)
- {
- case 'B':
- if (strncmp (z, "BREAK", 5) == 0)
- {
- fquote = fcsend_debug (fquote, 0, "break");
- if (! fport_break ())
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- z += 5;
- }
- else
- {
- fsend = TRUE;
- bsend = 'B';
- ++z;
- }
- break;
- case 'E':
- if (strncmp (z, "EOT", 3) == 0)
- {
- fsend = TRUE;
- bsend = '\004';
- }
- else
- {
- fsend = TRUE;
- bsend = 'E';
- ++z;
- }
- break;
- case '\\':
- ++z;
- switch (*z)
- {
- case 'b':
- fsend = TRUE;
- bsend = '\b';
- break;
- case 'c':
- fnocr = TRUE;
- break;
- case 'd':
- fquote = fcsend_debug (fquote, 0, "sleep");
- usysdep_sleep (1);
- break;
- case 'e':
- fquote = fcsend_debug (fquote, 0, "echo-check-off");
- pfwrite = fport_write;
- break;
- case 'E':
- fquote = fcsend_debug (fquote, 0, "echo-check-on");
- pfwrite = fcecho_send;
- break;
- case 'K':
- fquote = fcsend_debug (fquote, 0, "break");
- if (! fport_break ())
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- break;
- case 'n':
- fsend = TRUE;
- bsend = '\n';
- break;
- case 'N':
- fsend = TRUE;
- bsend = '\0';
- break;
- case 'p':
- fquote = fcsend_debug (fquote, 0, "pause");
- usysdep_pause ();
- break;
- case 'r':
- fsend = TRUE;
- bsend = '\r';
- break;
- case 's':
- fsend = TRUE;
- bsend = ' ';
- break;
- case 't':
- fsend = TRUE;
- bsend = '\t';
- break;
- case '\0':
- --z;
- /* Fall through. */
- case '\\':
- fsend = TRUE;
- bsend = '\\';
- break;
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- fsend = TRUE;
- bsend = *z - '0';
- if (z[1] >= '0' && z[1] <= '7')
- bsend = (char) (8 * bsend + *++z - '0');
- if (z[1] >= '0' && z[1] <= '7')
- bsend = (char) (8 * bsend + *++z - '0');
- break;
- case 'x':
- fsend = TRUE;
- bsend = 0;
- while (isxdigit (BUCHAR (z[1])))
- {
- if (isdigit (BUCHAR (z[1])))
- bsend = (char) (16 * bsend + *++z - '0');
- else if (isupper (BUCHAR (z[1])))
- bsend = (char) (16 * bsend + *++z - 'A');
- else
- bsend = (char) (16 * bsend + *++z - 'a');
- }
- break;
- case 'L':
- {
- const char *zlog;
-
- if (qsys == NULL)
- {
- ucsend_debug_end (fquote, TRUE);
- ulog (LOG_ERROR, "Illegal use of \\L");
- return FALSE;
- }
- zlog = qsys->zcall_login;
- if (zlog == NULL)
- {
- ucsend_debug_end (fquote, TRUE);
- ulog (LOG_ERROR, "No login defined");
- return FALSE;
- }
- if (zlog[0] == '*' && zlog[1] == '\0')
- {
- if (zcallout_login == NULL
- && ! fcallout_login (qsys, &zcallout_login,
- &zcallout_pass))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- zlog = zcallout_login;
- }
- fquote = fcsend_debug (fquote, 0, "login");
- fquote = fcsend_debug (fquote, strlen (zlog), zlog);
- if (! (*pfwrite) (zlog, strlen (zlog)))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- }
- break;
- case 'P':
- {
- const char *zpass;
-
- if (qsys == NULL)
- {
- ucsend_debug_end (fquote, TRUE);
- ulog (LOG_ERROR, "Illegal use of \\P");
- return FALSE;
- }
- zpass = qsys->zcall_password;
- if (zpass == NULL)
- {
- ucsend_debug_end (fquote, TRUE);
- ulog (LOG_ERROR, "No password defined");
- return FALSE;
- }
- if (zpass[0] == '*' && zpass[1] == '\0')
- {
- if (zcallout_pass == NULL
- && ! fcallout_login (qsys, &zcallout_login,
- &zcallout_pass))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- zpass = zcallout_pass;
- }
- fquote = fcsend_debug (fquote, 0, "password");
- fquote = fcsend_debug (fquote, strlen (zpass), zpass);
- if (! (*pfwrite) (zpass, strlen (zpass)))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- }
- break;
- case 'D':
- if (qdial == NULL || zphone == NULL)
- {
- ucsend_debug_end (fquote, TRUE);
- ulog (LOG_ERROR, "Illegal use of \\D");
- return FALSE;
- }
- fquote = fcsend_debug (fquote, 0, "\\D");
- if (! fcphone (qdial, zphone, pfwrite, ftranslate, &fquote))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- break;
- case 'T':
- if (qdial == NULL || zphone == NULL)
- {
- ucsend_debug_end (fquote, TRUE);
- ulog (LOG_ERROR, "Illegal use of \\T");
- return FALSE;
- }
- fquote = fcsend_debug (fquote, 0, "\\T");
- if (! fcphone (qdial, zphone, pfwrite, TRUE, &fquote))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- break;
- case 'M':
- if (qdial == NULL)
- {
- ucsend_debug_end (fquote, TRUE);
- ulog (LOG_ERROR, "Illegal use of \\M");
- return FALSE;
- }
- fquote = fcsend_debug (fquote, 0, "ignore-carrier");
- if (! fport_no_carrier ())
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- break;
- case 'm':
- if (qdial == NULL)
- {
- ucsend_debug_end (fquote, TRUE);
- ulog (LOG_ERROR, "Illegal use of \\m");
- return FALSE;
- }
- fquote = fcsend_debug (fquote, 0, "need-carrier");
- if (! fport_need_carrier ())
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- break;
- default:
- /* This error message will screw up any debugging
- information, but it's easily avoidable. */
- ulog (LOG_ERROR,
- "Unrecognized escape sequence \\%c in send string",
- *z);
- fsend = TRUE;
- bsend = *z;
- break;
- }
- ++z;
- break;
-#if DEBUG > 0
- default:
- ulog (LOG_FATAL, "fcsend: Can't happen");
- break;
-#endif
- }
-
- if (fsend)
- {
- fquote = fcsend_debug (fquote, 1, &bsend);
- if (! (*pfwrite) (&bsend, 1))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- }
- }
-
- /* Clobber and free the login and password names that came from
- the call out file. We probably shouldn't even keep them around
- this long. */
-
- if (zcallout_login != NULL)
- {
- bzero (zcallout_login, strlen (zcallout_login));
- xfree ((pointer) zcallout_login);
- }
- if (zcallout_pass != NULL)
- {
- bzero (zcallout_pass, strlen (zcallout_pass));
- xfree ((pointer) zcallout_pass);
- }
-
- /* Output a final carriage return, unless there was a \c. Don't
- bother to check for an echo. */
- if (! fnocr)
- {
- char b;
-
- b = '\r';
- fquote = fcsend_debug (fquote, 1, &b);
- if (! fport_write (&b, 1))
- {
- ucsend_debug_end (fquote, TRUE);
- return FALSE;
- }
- }
-
- ucsend_debug_end (fquote, FALSE);
-
- return TRUE;
-}
-
-/* Write out a phone number with optional dialcode translation. The
- pfquote argument is only used for debugging. */
-
-static boolean
-fcphone (qdial, zphone, pfwrite, ftranslate, pfquote)
- const struct sdialer *qdial;
- const char *zphone;
- boolean (*pfwrite) P((const char *zwrite, int cwrite));
- boolean ftranslate;
- boolean *pfquote;
-{
- const char *zprefix, *zsuffix;
-
- if (ftranslate)
- {
- if (! fctranslate (zphone, &zprefix, &zsuffix))
- return FALSE;
- }
- else
- {
- zprefix = zphone;
- zsuffix = NULL;
- }
-
- while (zprefix != NULL)
- {
- while (TRUE)
- {
- const char *z;
- const char *zstr;
-
- z = zprefix + strcspn (zprefix, "=-");
- if (z > zprefix)
- {
- *pfquote = fcsend_debug (*pfquote, z - zprefix, zprefix);
- if (! (*pfwrite) (zprefix, z - zprefix))
- return FALSE;
- }
-
- if (*z == '=')
- zstr = qdial->zdialtone;
- else if (*z == '-')
- zstr = qdial->zpause;
- else /* *z == '\0' */
- break;
-
- if (zstr != NULL)
- {
- *pfquote = fcsend_debug (*pfquote, strlen (zstr), zstr);
- if (! (*pfwrite) (zstr, strlen (zstr)))
- return FALSE;
- }
-
- zprefix = z + 1;
- }
-
- zprefix = zsuffix;
- zsuffix = NULL;
- }
-
- return TRUE;
-}
-
-/* Given a phone number, run it through dial code translation
- returning two strings. */
-
-static boolean
-fctranslate (zphone, pzprefix, pzsuffix)
- const char *zphone;
- const char **pzprefix;
- const char **pzsuffix;
-{
- char *zdialcode, *zto;
- const char *zfrom;
-
- *pzprefix = zphone;
- *pzsuffix = NULL;
-
- if (zDialcodefile == NULL)
- return TRUE;
-
- zdialcode = (char *) alloca (strlen (zphone) + 1);
- zfrom = zphone;
- zto = zdialcode;
- while (*zfrom != '\0' && isalpha (BUCHAR (*zfrom)))
- *zto++ = *zfrom++;
- *zto = '\0';
-
- if (*zdialcode != '\0')
- {
- struct smulti_file *qmulti;
- struct scmdtab as[2];
- char *zpre;
-
- qmulti = qmulti_open (zDialcodefile);
- if (qmulti == NULL)
- return FALSE;
-
- as[0].zcmd = zdialcode;
- as[0].itype = CMDTABTYPE_STRING;
- as[0].pvar = (pointer) &zpre;
- as[0].ptfn = NULL;
- as[1].zcmd = NULL;
-
- zpre = NULL;
-
- uprocesscmds ((FILE *) NULL, qmulti, as, (const char *) NULL,
- CMDFLAG_BACKSLASH);
-
- (void) fmulti_close (qmulti);
-
- if (zpre == NULL)
- ulog (LOG_ERROR, "Unknown dial code %s", zdialcode);
- else
- {
- *pzprefix = zpre;
- *pzsuffix = zfrom;
- }
- }
-
- return TRUE;
-}
-
-/* Write out a string making sure the each character is echoed back. */
-
-static boolean
-fcecho_send (zwrite, cwrite)
- const char *zwrite;
- int cwrite;
-{
- const char *zend;
-
- zend = zwrite + cwrite;
-
- for (; zwrite < zend; zwrite++)
- {
- int b;
-
- if (! fport_write (zwrite, 1))
- return FALSE;
- do
- {
- /* We arbitrarily wait five seconds for the echo. */
- b = breceive_char (5, TRUE);
- /* Now b == -1 on timeout, -2 on error. */
- if (b < 0)
- {
- if (b == -1)
- ulog (LOG_ERROR, "Character not echoed");
- return FALSE;
- }
- }
- while (b != BUCHAR (*zwrite));
- }
-
- return TRUE;
-}
-
-/* Run a chat program. Expand any escape sequences and call a system
- dependent program to run it. */
-
-static boolean
-fcprogram (zprogram, qsys, qdial, zphone, zport, ibaud)
- const char *zprogram;
- const struct ssysteminfo *qsys;
- const struct sdialer *qdial;
- const char *zphone;
- const char *zport;
- long ibaud;
-{
- char *zbuf;
- int calc, clen;
- char *zto;
- const char *zfrom;
- char *zcallout_login;
- char *zcallout_pass;
- boolean fret;
-
- zcallout_login = NULL;
- zcallout_pass = NULL;
-
- /* Copy the string into memory expanding escape sequences. */
-
- zbuf = (char *) xmalloc (1);
- calc = 1;
- clen = 0;
- zto = zbuf;
- for (zfrom = zprogram; *zfrom != '\0'; zfrom++)
- {
- const char *zadd;
- int cadd;
-
- if (*zfrom != '\\')
- {
- if (clen + 2 > calc)
- {
- calc = clen + 80;
- zbuf = (char *) xrealloc ((pointer) zbuf, calc);
- zto = zbuf + clen;
- }
- *zto++ = *zfrom;
- ++clen;
- continue;
- }
-
- ++zfrom;
- switch (*zfrom)
- {
- case '\0':
- --zfrom;
- /* Fall through. */
- case '\\':
- zadd = "\\";
- break;
- case 'L':
- {
- const char *zlog;
-
- if (qsys == NULL)
- {
- ulog (LOG_ERROR, "chat-program: Illegal use of \\L");
- return FALSE;
- }
- zlog = qsys->zcall_login;
- if (zlog == NULL)
- {
- ulog (LOG_ERROR, "chat-program: No login defined");
- return FALSE;
- }
- if (zlog[0] == '*' && zlog[1] == '\0')
- {
- if (zcallout_login == NULL
- && ! fcallout_login (qsys, &zcallout_login,
- &zcallout_pass))
- return FALSE;
- zlog = zcallout_login;
- }
- zadd = zlog;
- }
- break;
- case 'P':
- {
- const char *zpass;
-
- if (qsys == NULL)
- {
- ulog (LOG_ERROR, "chat-program: Illegal use of \\P");
- return FALSE;
- }
- zpass = qsys->zcall_password;
- if (zpass == NULL)
- {
- ulog (LOG_ERROR, "chat-program: No password defined");
- return FALSE;
- }
- if (zpass[0] == '*' && zpass[1] == '\0')
- {
- if (zcallout_pass == NULL
- && ! fcallout_login (qsys, &zcallout_login,
- &zcallout_pass))
- return FALSE;
- zpass = zcallout_pass;
- }
- zadd = zpass;
- }
- break;
- case 'D':
- if (qdial == NULL || zphone == NULL)
- {
- ulog (LOG_ERROR, "chat-program: Illegal use of \\D");
- return FALSE;
- }
- zadd = zphone;
- break;
- case 'T':
- {
- const char *zprefix, *zsuffix;
-
- if (qdial == NULL || zphone == NULL)
- {
- ulog (LOG_ERROR, "chat-program: Illegal use of \\T");
- return FALSE;
- }
-
- if (! fctranslate (zphone, &zprefix, &zsuffix))
- return FALSE;
-
- if (zsuffix == NULL)
- zadd = zprefix;
- else
- {
- int cprefix;
-
- cprefix = strlen (zprefix);
- if (clen + cprefix + 1 > calc)
- {
- calc = clen + cprefix + 20;
- zbuf = (char *) xrealloc ((pointer) zbuf, calc);
- zto = zbuf + clen;
- }
- strcpy (zto, zprefix);
- zto += cprefix;
- clen += cprefix;
- zadd = zsuffix;
- }
- }
- break;
- case 'Y':
- if (zLdevice == NULL && zport == NULL)
- {
- ulog (LOG_ERROR, "chat-program: Illegal use of \\Y");
- return FALSE;
- }
- /* zLdevice will generally make more sense than zport, but
- it might not be set yet. */
- zadd = zLdevice;
- if (zadd == NULL)
- zadd = zport;
- break;
- case 'Z':
- if (qsys == NULL)
- {
- ulog (LOG_ERROR, "chat-program: Illegal use of \\Z");
- return FALSE;
- }
- zadd = qsys->zname;
- break;
- case 'S':
- {
- char *zalc;
-
- if (ibaud == 0)
- {
- ulog (LOG_ERROR, "chat-program: Illegal use of \\S");
- return FALSE;
- }
- zalc = (char *) alloca (15);
- sprintf (zalc, "%ld", ibaud);
- zadd = zalc;
- }
- break;
- default:
- {
- char *zset;
-
- ulog (LOG_ERROR,
- "chat-program: Unrecognized escape sequence \\%c",
- *zfrom);
- zset = (char *) alloca (2);
- zset[0] = *zfrom;
- zset[1] = '\0';
- zadd = zset;
- }
- break;
- }
-
- cadd = strlen (zadd);
- if (clen + cadd + 1 > calc)
- {
- calc = clen + cadd + 20;
- zbuf = (char *) xrealloc ((pointer) zbuf, calc);
- zto = zbuf + clen;
- }
- strcpy (zto, zadd);
- zto += cadd;
- clen += cadd;
- }
-
- *zto = '\0';
-
- /* Invoke the program. */
-
- fret = fport_run_chat (zbuf);
-
- xfree ((pointer) zbuf);
-
- return fret;
-}
diff --git a/gnu/libexec/uucp/conf.h b/gnu/libexec/uucp/conf.h
deleted file mode 100644
index d3788710c3a..00000000000
--- a/gnu/libexec/uucp/conf.h
+++ /dev/null
@@ -1,313 +0,0 @@
-/* $Id: conf.h,v 1.2 1993/08/02 17:25:02 mycroft Exp $ */
-
-/* Configuration header file for Taylor UUCP.
- Generated on Mon Jun 1 16:01:13 PDT 1992. */
-
-/* Set MAIL_PROGRAM to a program which takes a mail address as an argument
- and accepts a mail message to send to that address on stdin. */
-#define MAIL_PROGRAM "/bin/mail"
-
-/* Set ECHO_PROGRAM to a program which echoes its arguments; if echo
- is a shell builtin you can just use "echo". */
-#define ECHO_PROGRAM "/bin/echo"
-
-/* The following macros indicate what header files you have. Set the
- macro to 1 if you have the corresponding header file, or 0 if you
- do not. */
-#define HAVE_STRING_H 1 /* <string.h> */
-#define HAVE_STRINGS_H 1 /* <strings.h> */
-#define HAVE_UNISTD_H 1 /* <unistd.h> */
-#define HAVE_STDLIB_H 1 /* <stdlib.h> */
-#define HAVE_LIMITS_H 1 /* <limits.h> */
-#define HAVE_TIME_H 1 /* <time.h> */
-#define HAVE_SYS_WAIT_H 1 /* <sys/wait.h> */
-#define HAVE_SYS_IOCTL_H 1 /* <sys/ioctl.h> */
-#define HAVE_DIRENT_H 1 /* <dirent.h> */
-#define HAVE_MEMORY_H 1 /* <memory.h> */
-#define HAVE_SYS_PARAM_H 1 /* <sys/param.h> */
-#define HAVE_UTIME_H 1 /* <utime.h> */
-#define HAVE_FCNTL_H 1 /* <fcntl.h> */
-#define HAVE_SYS_FILE_H 1 /* <sys/file.h> */
-#define HAVE_LIBC_H 0 /* <libc.h> */
-#define HAVE_SYSEXITS_H 1 /* <sysexits.h> */
-#define HAVE_POLL_H 0 /* <poll.h> */
-#define HAVE_STROPTS_H 0 /* <stropts.h> */
-
-/* Set SIGtype to the return type of a signal handler. On newer systems
- this will be void; some older systems use int. */
-#define SIGtype int
-
-/* Set HAVE_TIME_T to 1 if time_t is defined in <time.h>, as required by
- the ANSI C standard. */
-#define HAVE_TIME_T 1
-
-/* Set HAVE_SYS_TIME_T to 1 if time_t is defined in <sys/types.h>; this
- is only checked if HAVE_TIME_T is 0. */
-#define HAVE_SYS_TIME_T 1
-
-/* Set HAVE_SYS_TIME_AND_TIME_H to 1 if <time.h> and <sys/time.h> can both
- be included in a single source file; if you don't have either or both of
- them, it doesn't matter what you set this to. */
-#define HAVE_SYS_TIME_AND_TIME_H 1
-
-/* Set HAVE_TERMIOS_AND_SYS_IOCTL_H to 1 if <termios.h> and <sys/ioctl.h>
- can both be included in a single source file; if you don't have either
- or both of them, it doesn't matter what you set this to. */
-#define HAVE_TERMIOS_AND_SYS_IOCTL_H 1
-
-/* If you are configuring by hand, you should set one of the terminal
- driver options in policy.h. If you are autoconfiguring, the script
- will check whether your system defines CBREAK, which is a terminal
- setting; if your system supports CBREAK, and you don't set a terminal
- driver in policy.h, the code will assume that you have a BSD style
- terminal driver. */
-#define HAVE_CBREAK 1
-
-/* The package needs several standard types. If you are using the
- configure script, it will look in standard places for these types,
- and give default definitions for them here if it doesn't find them.
- The default definitions should work on most systems, but you may
- want to check them. If you are configuring by hand, you will have
- to figure out whether the types are defined on your system, and
- what they should be defined to.
-
- Each of the types should be defined using #define. For example,
- #define pid_t int
- */
-
-/* The type pid_t is used to hold a process ID number. It is normally
- defined in <sys/types.h>. This is the type returned by the
- functions fork or getpid. Usually int will work fine. */
-/* A definition of pid_t was found on your system. */
-
-/* The type uid_t is used to hold a user ID number. It is normally
- defined in <sys/types.h>. This is the type returned by the getuid
- function. Usually int will work fine. */
-/* A definition of uid_t was found on your system. */
-
-/* The type gid_t is used to hold a group ID number. It is sometimes
- defined in <sys/types.h>. This is the type returned by the getgid
- function. Usually int will work fine. */
-/* A definition of gid_t was found on your system. */
-
-/* The type off_t is used to hold an offset in a file. It is sometimes
- defined in <sys/types.h>. This is the type of the second argument to
- the lseek function. Usually long will work fine. */
-/* A definition of off_t was found on your system. */
-
-/* Set HAVE_SIG_ATOMIC_T_IN_SIGNAL_H if the type sig_atomic_t is defined
- in <signal.h> as required by ANSI C. */
-#define HAVE_SIG_ATOMIC_T_IN_SIGNAL_H 0
-
-/* Set HAVE_SIG_ATOMIC_T_IN_TYPES_H if the type sig_atomic_t is defined
- in <sys/types.h>. This is ignored if HAVE_SIG_ATOMIC_T_IN_SIGNAL_H is
- set to 1. */
-#define HAVE_SIG_ATOMIC_T_IN_TYPES_H 0
-
-/* The type sig_atomic_t is used to hold a value which may be
- referenced in a single atomic operation. If it is not defined in
- either <signal.h> or <sys/types.h>, you may want to give it a
- definition here (if you don't, the code will use char). If your
- compiler does not support sig_atomic_t, there is no type which is
- really correct; fortunately, for this package it does not really
- matter very much. */
-
-/* When Taylor UUCP is talking to another instance of itself, it will
- tell the other side the size of a file before it is transferred.
- If the package can determine how much disk space is available, it
- will use this information to avoid filling up the disk. Define one
- of the following macros to tell the code how to determine the
- amount of available disk space. It is possible that none of these
- are appropriate; it will do no harm to use none of them, but, of
- course, nothing will then prevent the package from filling up the
- disk. Note that this space check is only useful when talking to
- another instance of Taylor UUCP.
-
- FS_STATVFS the statvfs function
- FS_USG_STATFS the four argument statfs function
- FS_MNTENT the two argument statfs function with the f_bsize field
- FS_STATFS the two argument statfs function with the f_fsize field
- FS_GETMNT the two argument statfs function with the fd_req field
- FS_USTAT the ustat function with 512 byte blocks. */
-#define FS_STATFS
-
-/* Set HAVE_VOID to 1 if the compiler supports declaring functions with
- a return type of void and casting values to void. */
-#define HAVE_VOID 1
-
-/* Set HAVE_UNSIGNED_CHAR to 1 if the compiler supports the type unsigned
- char. */
-#define HAVE_UNSIGNED_CHAR 1
-
-/* Set HAVE_ERRNO_DECLARATION to 1 if errno is declared in <errno.h>. */
-#define HAVE_ERRNO_DECLARATION 1
-
-/* Set COMBINED_UNBLOCK to 1 if the flags O_NONBLOCK and O_NDELAY can
- both be specified at once on a file descriptor. If your system
- does not support both flags, it doesn't matter what you set this
- to. */
-#define COMBINED_UNBLOCK 1
-
-/* There are now a number of functions to check for. For each of these,
- the macro HAVE_FUNC should be set to 1 if your system has FUNC. For
- example, HAVE_STRERROR should be set to 1 if your system has strerror,
- 0 otherwise. */
-
-/* Taylor UUCP provides its own versions of the following functions,
- or knows how to work around their absence. */
-#define HAVE_MEMSET 1
-#define HAVE_MEMCMP 1
-#define HAVE_MEMCHR 1
-#define HAVE_MEMCPY 1
-#define HAVE_BCOPY 1
-#define HAVE_BCMP 1
-#define HAVE_BZERO 1
-#define HAVE_MEMMOVE 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_INDEX 1
-#define HAVE_RINDEX 1
-#define HAVE_STRERROR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRSTR 1
-#define HAVE_STRDUP 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRICMP 0
-#define HAVE_STRLWR 0
-#define HAVE_BSEARCH 1
-#define HAVE_VFPRINTF 1
-#define HAVE_REMOVE 1
-#define HAVE_FTRUNCATE 1
-#define HAVE_LTRUNC 0
-#define HAVE_RENAME 1
-#define HAVE_OPENDIR 1
-#define HAVE_DUP2 1
-#define HAVE_WAITPID 1
-#define HAVE_WAIT4 1
-
-/* If you have either sigsetjmp or setret, it will be used instead of
- setjmp. These functions will only be used if your system restarts
- system calls after interrupts (see HAVE_RESTARTABLE_SYSCALLS,
- below). */
-#define HAVE_SIGSETJMP 0
-#define HAVE_SETRET 0
-
-/* The code needs to know what function to use to set a signal
- handler. If will try to use each of the following functions in
- turn. If none are available, it will use signal, which is assumed
- to always exist. */
-#define HAVE_SIGACTION 1
-#define HAVE_SIGVEC 1
-#define HAVE_SIGSET 0
-
-/* The code will try to use each of the following functions in turn
- when blocking signals from delivery. If none are available, a
- relatively unimportant race condition will exist. */
-#define HAVE_SIGPROCMASK 1
-#define HAVE_SIGBLOCK 1
-#define HAVE_SIGHOLD 0
-
-/* If you have either of the following functions, it will be used to
- determine the number of file descriptors which may be open.
- Otherwise, the code will use OPEN_MAX if defined, then NOFILE if
- defined, then 20. */
-#define HAVE_GETDTABLESIZE 1
-#define HAVE_SYSCONF 0
-
-/* The code will use one of the following functions when detaching
- from a terminal. One of these must exist. */
-#define HAVE_SETPGRP 1
-#define HAVE_SETSID 1
-
-/* If you do not specify the local node name in the main configuration
- file, Taylor UUCP will try to use each of the following functions
- in turn. If neither is available, you must specify the local node
- name in the configuration file. */
-#define HAVE_GETHOSTNAME 1
-#define HAVE_UNAME 0
-
-/* The code will try to use each of the following functions in turn to
- determine the current time. If none are available, it will use
- time, which is assume to always exist. */
-#define HAVE_GETTIMEOFDAY 1
-#define HAVE_FTIME 0
-
-/* If neither gettimeofday nor ftime is available, the code will use
- times (if available) to measure a span of time. See also the
- discussion of TIMES_TICK in policy.h. */
-#define HAVE_TIMES 1
-
-/* When a chat script requests a pause of less than a second with \p,
- Taylor UUCP will try to use each of the following functions in
- turn. If none are available, it will sleep for a full second.
- Also, the (non-portable) tstuu program requires either select or
- poll. */
-#define HAVE_NAPMS 0
-#define HAVE_NAP 0
-#define HAVE_USLEEP 1
-#define HAVE_POLL 0
-#define HAVE_SELECT 1
-
-/* If the getgrent function is available, it will be used to determine
- all the groups a user belongs to when checking file access
- permissions. */
-#define HAVE_GETGRENT 1
-
-/* If the socket function is available, TCP support code will be
- compiled in. */
-#define HAVE_SOCKET 1
-
-/* The code needs to know to how to get the name of the current
- directory. If getcwd is available it will be used, otherwise if
- getwd is available it will be used. Otherwise, set PWD_PROGRAM to
- the name of the program which will print the name of the current
- working directory. */
-#define HAVE_GETCWD 1
-#define HAVE_GETWD 1
-#define PWD_PROGRAM unused
-
-/* The code needs to know how to create directories. If you have the
- mkdir function, set HAVE_MKDIR to 1 and replace @UUDIR@ in
- Makefile.in with '# ' (the configure script will set @UUDIR@
- according to the variable UUDIR). Otherwise, set HAVE_MKDIR to 0,
- remove @UUDIR@ from Makefile.in, and set MKDIR_PROGRAM to the name
- of the program which will create a directory named on the command
- line. */
-#define HAVE_MKDIR 1
-#define MKDIR_PROGRAM unused
-
-/* That's the end of the list of the functions. Now there are a few
- last miscellaneous items. */
-
-/* On some systems times is declared in <sys/times.h> as returning
- int, so the code cannot safely declare it as returning long. On
- the other hand, on some systems times will not work unless it is
- declared as returning long. Set TIMES_DECLARATION_OK to 1 if times
- can be safely declared as returning long. If you will not be using
- times, it doesn't matter what you set this to. */
-#define TIMES_DECLARATION_OK 0
-
-/* Set HAVE_BSD_PGRP to 1 if your getpgrp call takes 1 argument and
- your setpgrp calls takes 2 argument (on System V they generally
- take no arguments). You can safely set this to 1 on System V,
- provided the call will compile without any errors. */
-#define HAVE_BSD_PGRP 0
-
-/* Set HAVE_UNION_WAIT to 1 if union wait is defined in the header
- file <sys/wait.h>. */
-#define HAVE_UNION_WAIT 1
-
-/* Define UTIME_NULL_MISSING if utime with a NULL second argument does not
- set the file times to the current time. */
-#define UTIME_NULL_MISSING
-
-/* Set HAVE_LONG_NAMES to 1 if the system supports file names longer
- than 14 characters. */
-#define HAVE_LONG_NAMES 1
-
-/* If slow system calls are restarted after interrupts, set
- HAVE_RESTARTABLE_SYSCALLS to 1. This is ignored if HAVE_SIGACTION
- is 1 or if HAVE_SIGVEC is 1 and SV_INTERRUPT is defined in
- <signal.h>. In both of these cases system calls can be prevented
- from restarting. */
-#define HAVE_RESTARTABLE_SYSCALLS 1
diff --git a/gnu/libexec/uucp/conf.h-dist b/gnu/libexec/uucp/conf.h-dist
deleted file mode 100644
index 48c1a30b484..00000000000
--- a/gnu/libexec/uucp/conf.h-dist
+++ /dev/null
@@ -1,311 +0,0 @@
-/* conf.h */
-/* Configuration header file for Taylor UUCP.
- Generated on Tue Apr 7 01:07:06 EDT 1992. */
-
-/* Set MAIL_PROGRAM to a program which takes a mail address as an argument
- and accepts a mail message to send to that address on stdin. */
-#define MAIL_PROGRAM "/usr/ucb/mail"
-
-/* Set ECHO_PROGRAM to a program which echoes its arguments; if echo
- is a shell builtin you can just use "echo". */
-#define ECHO_PROGRAM "/bin/echo"
-
-/* The following macros indicate what header files you have. Set the
- macro to 1 if you have the corresponding header file, or 0 if you
- do not. */
-#define HAVE_STRING_H 1 /* <string.h> */
-#define HAVE_STRINGS_H 1 /* <strings.h> */
-#define HAVE_UNISTD_H 1 /* <unistd.h> */
-#define HAVE_STDLIB_H 1 /* <stdlib.h> */
-#define HAVE_LIMITS_H 1 /* <limits.h> */
-#define HAVE_TIME_H 1 /* <time.h> */
-#define HAVE_SYS_WAIT_H 1 /* <sys/wait.h> */
-#define HAVE_SYS_IOCTL_H 1 /* <sys/ioctl.h> */
-#define HAVE_DIRENT_H 1 /* <dirent.h> */
-#define HAVE_MEMORY_H 1 /* <memory.h> */
-#define HAVE_SYS_PARAM_H 1 /* <sys/param.h> */
-#define HAVE_UTIME_H 1 /* <utime.h> */
-#define HAVE_FCNTL_H 1 /* <fcntl.h> */
-#define HAVE_SYS_FILE_H 1 /* <sys/file.h> */
-#define HAVE_LIBC_H 0 /* <libc.h> */
-#define HAVE_SYSEXITS_H 1 /* <sysexits.h> */
-#define HAVE_POLL_H 0 /* <poll.h> */
-#define HAVE_STROPTS_H 0 /* <stropts.h> */
-
-/* Set SIGtype to the return type of a signal handler. On newer systems
- this will be void; some older systems use int. */
-#define SIGtype void
-
-/* Set HAVE_TIME_T to 1 if time_t is defined in <time.h>, as required by
- the ANSI C standard. */
-#define HAVE_TIME_T 1
-
-/* Set HAVE_SYS_TIME_T to 1 if time_t is defined in <sys/types.h>; this
- is only checked if HAVE_TIME_T is 0. */
-#define HAVE_SYS_TIME_T 1
-
-/* Set HAVE_SYS_TIME_AND_TIME_H to 1 if <time.h> and <sys/time.h> can both
- be included in a single source file; if you don't have either or both of
- them, it doesn't matter what you set this to. */
-#define HAVE_SYS_TIME_AND_TIME_H 1
-
-/* Set HAVE_TERMIOS_AND_SYS_IOCTL_H to 1 if <termios.h> and <sys/ioctl.h>
- can both be included in a single source file; if you don't have either
- or both of them, it doesn't matter what you set this to. */
-#define HAVE_TERMIOS_AND_SYS_IOCTL_H 1
-
-/* If you are configuring by hand, you should set one of the terminal
- driver options in policy.h. If you are autoconfiguring, the script
- will check whether your system defines CBREAK, which is a terminal
- setting; if your system supports CBREAK, and you don't set a terminal
- driver in policy.h, the code will assume that you have a BSD style
- terminal driver. */
-#define HAVE_CBREAK 1
-
-/* The package needs several standard types. If you are using the
- configure script, it will look in standard places for these types,
- and give default definitions for them here if it doesn't find them.
- The default definitions should work on most systems, but you may
- want to check them. If you are configuring by hand, you will have
- to figure out whether the types are defined on your system, and
- what they should be defined to.
-
- Each of the types should be defined using #define. For example,
- #define pid_t int
- */
-
-/* The type pid_t is used to hold a process ID number. It is normally
- defined in <sys/types.h>. This is the type returned by the
- functions fork or getpid. Usually int will work fine. */
-/* A definition of pid_t was found on your system. */
-
-/* The type uid_t is used to hold a user ID number. It is normally
- defined in <sys/types.h>. This is the type returned by the getuid
- function. Usually int will work fine. */
-/* A definition of uid_t was found on your system. */
-
-/* The type gid_t is used to hold a group ID number. It is sometimes
- defined in <sys/types.h>. This is the type returned by the getgid
- function. Usually int will work fine. */
-/* A definition of gid_t was found on your system. */
-
-/* The type off_t is used to hold an offset in a file. It is sometimes
- defined in <sys/types.h>. This is the type of the second argument to
- the lseek function. Usually long will work fine. */
-/* A definition of off_t was found on your system. */
-
-/* Set HAVE_SIG_ATOMIC_T_IN_SIGNAL_H if the type sig_atomic_t is defined
- in <signal.h> as required by ANSI C. */
-#define HAVE_SIG_ATOMIC_T_IN_SIGNAL_H 1
-
-/* Set HAVE_SIG_ATOMIC_T_IN_TYPES_H if the type sig_atomic_t is defined
- in <sys/types.h>. This is ignored if HAVE_SIG_ATOMIC_T_IN_SIGNAL_H is
- set to 1. */
-#define HAVE_SIG_ATOMIC_T_IN_TYPES_H 0
-
-/* The type sig_atomic_t is used to hold a value which may be
- referenced in a single atomic operation. If it is not defined in
- either <signal.h> or <sys/types.h>, you may want to give it a
- definition here (if you don't, the code will use char). If your
- compiler does not support sig_atomic_t, there is no type which is
- really correct; fortunately, for this package it does not really
- matter very much. */
-
-/* When Taylor UUCP is talking to another instance of itself, it will
- tell the other side the size of a file before it is transferred.
- If the package can determine how much disk space is available, it
- will use this information to avoid filling up the disk. Define one
- of the following macros to tell the code how to determine the
- amount of available disk space. It is possible that none of these
- are appropriate; it will do no harm to use none of them, but, of
- course, nothing will then prevent the package from filling up the
- disk. Note that this space check is only useful when talking to
- another instance of Taylor UUCP.
-
- FS_STATVFS the statvfs function
- FS_USG_STATFS the four argument statfs function
- FS_MNTENT the two argument statfs function with the f_bsize field
- FS_STATFS the two argument statfs function with the f_fsize field
- FS_GETMNT the two argument statfs function with the fd_req field
- FS_USTAT the ustat function with 512 byte blocks. */
-#define FS_GETMNT
-
-/* Set HAVE_VOID to 1 if the compiler supports declaring functions with
- a return type of void and casting values to void. */
-#define HAVE_VOID 1
-
-/* Set HAVE_UNSIGNED_CHAR to 1 if the compiler supports the type unsigned
- char. */
-#define HAVE_UNSIGNED_CHAR 1
-
-/* Set HAVE_ERRNO_DECLARATION to 1 if errno is declared in <errno.h>. */
-#define HAVE_ERRNO_DECLARATION 1
-
-/* Set COMBINED_UNBLOCK to 1 if the flags O_NONBLOCK and O_NDELAY can
- both be specified at once on a file descriptor. If your system
- does not support both flags, it doesn't matter what you set this
- to. */
-#define COMBINED_UNBLOCK 1
-
-/* There are now a number of functions to check for. For each of these,
- the macro HAVE_FUNC should be set to 1 if your system has FUNC. For
- example, HAVE_STRERROR should be set to 1 if your system has strerror,
- 0 otherwise. */
-
-/* Taylor UUCP provides its own versions of the following functions,
- or knows how to work around their absence. */
-#define HAVE_MEMSET 1
-#define HAVE_MEMCMP 1
-#define HAVE_MEMCHR 1
-#define HAVE_MEMCPY 1
-#define HAVE_BCOPY 1
-#define HAVE_BCMP 1
-#define HAVE_BZERO 1
-#define HAVE_MEMMOVE 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_INDEX 1
-#define HAVE_RINDEX 1
-#define HAVE_STRERROR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRSTR 1
-#define HAVE_STRDUP 0
-#define HAVE_STRCASECMP 1
-#define HAVE_STRICMP 0
-#define HAVE_STRLWR 0
-#define HAVE_BSEARCH 1
-#define HAVE_VFPRINTF 1
-#define HAVE_REMOVE 1
-#define HAVE_FTRUNCATE 1
-#define HAVE_LTRUNC 0
-#define HAVE_RENAME 1
-#define HAVE_OPENDIR 1
-#define HAVE_DUP2 1
-#define HAVE_WAITPID 1
-#define HAVE_WAIT4 0
-
-/* If you have either sigsetjmp or setret, it will be used instead of
- setjmp. These functions will only be used if your system restarts
- system calls after interrupts (see HAVE_RESTARTABLE_SYSCALLS,
- below). */
-#define HAVE_SIGSETJMP 1
-#define HAVE_SETRET 0
-
-/* The code needs to know what function to use to set a signal
- handler. If will try to use each of the following functions in
- turn. If none are available, it will use signal, which is assumed
- to always exist. */
-#define HAVE_SIGACTION 1
-#define HAVE_SIGVEC 1
-#define HAVE_SIGSET 0
-
-/* The code will try to use each of the following functions in turn
- when blocking signals from delivery. If none are available, a
- relatively unimportant race condition will exist. */
-#define HAVE_SIGPROCMASK 1
-#define HAVE_SIGBLOCK 1
-#define HAVE_SIGHOLD 0
-
-/* If you have either of the following functions, it will be used to
- determine the number of file descriptors which may be open.
- Otherwise, the code will use OPEN_MAX if defined, then NOFILE if
- defined, then 20. */
-#define HAVE_GETDTABLESIZE 1
-#define HAVE_SYSCONF 1
-
-/* The code will use one of the following functions when detaching
- from a terminal. One of these must exist. */
-#define HAVE_SETPGRP 1
-#define HAVE_SETSID 1
-
-/* If you do not specify the local node name in the main configuration
- file, Taylor UUCP will try to use each of the following functions
- in turn. If neither is available, you must specify the local node
- name in the configuration file. */
-#define HAVE_GETHOSTNAME 1
-#define HAVE_UNAME 1
-
-/* The code will try to use each of the following functions in turn to
- determine the current time. If none are available, it will use
- time, which is assume to always exist. */
-#define HAVE_GETTIMEOFDAY 1
-#define HAVE_FTIME 1
-
-/* If neither gettimeofday nor ftime is available, the code will use
- times (if available) to measure a span of time. See also the
- discussion of TIMES_TICK in policy.h. */
-#define HAVE_TIMES 1
-
-/* When a chat script requests a pause of less than a second with \p,
- Taylor UUCP will try to use each of the following functions in
- turn. If none are available, it will sleep for a full second.
- Also, the (non-portable) tstuu program requires either select or
- poll. */
-#define HAVE_NAPMS 0
-#define HAVE_NAP 0
-#define HAVE_USLEEP 0
-#define HAVE_POLL 0
-#define HAVE_SELECT 1
-
-/* If the getgrent function is available, it will be used to determine
- all the groups a user belongs to when checking file access
- permissions. */
-#define HAVE_GETGRENT 1
-
-/* If the socket function is available, TCP support code will be
- compiled in. */
-#define HAVE_SOCKET 1
-
-/* The code needs to know to how to get the name of the current
- directory. If getcwd is available it will be used, otherwise if
- getwd is available it will be used. Otherwise, set PWD_PROGRAM to
- the name of the program which will print the name of the current
- working directory. */
-#define HAVE_GETCWD 1
-#define HAVE_GETWD 1
-#define PWD_PROGRAM unused
-
-/* The code needs to know how to create directories. If you have the
- mkdir function, set HAVE_MKDIR to 1 and replace @UUDIR@ in
- Makefile.in with '# ' (the configure script will set @UUDIR@
- according to the variable UUDIR). Otherwise, set HAVE_MKDIR to 0,
- remove @UUDIR@ from Makefile.in, and set MKDIR_PROGRAM to the name
- of the program which will create a directory named on the command
- line. */
-#define HAVE_MKDIR 1
-#define MKDIR_PROGRAM unused
-
-/* That's the end of the list of the functions. Now there are a few
- last miscellaneous items. */
-
-/* On some systems times is declared in <sys/times.h> as returning
- int, so the code cannot safely declare it as returning long. On
- the other hand, on some systems times will not work unless it is
- declared as returning long. Set TIMES_DECLARATION_OK to 1 if times
- can be safely declared as returning long. If you will not be using
- times, it doesn't matter what you set this to. */
-#define TIMES_DECLARATION_OK 0
-
-/* Set HAVE_BSD_PGRP to 1 if your getpgrp call takes 1 argument and
- your setpgrp calls takes 2 argument (on System V they generally
- take no arguments). You can safely set this to 1 on System V,
- provided the call will compile without any errors. */
-#define HAVE_BSD_PGRP 1
-
-/* Set HAVE_UNION_WAIT to 1 if union wait is defined in the header
- file <sys/wait.h>. */
-#define HAVE_UNION_WAIT 1
-
-/* Define UTIME_NULL_MISSING if utime with a NULL second argument does not
- set the file times to the current time. */
-
-/* Set HAVE_LONG_NAMES to 1 if the system supports file names longer
- than 14 characters. */
-#define HAVE_LONG_NAMES 1
-
-/* If slow system calls are restarted after interrupts, set
- HAVE_RESTARTABLE_SYSCALLS to 1. This is ignored if HAVE_SIGACTION
- is 1 or if HAVE_SIGVEC is 1 and SV_INTERRUPT is defined in
- <signal.h>. In both of these cases system calls can be prevented
- from restarting. */
-#define HAVE_RESTARTABLE_SYSCALLS 1