summaryrefslogtreecommitdiffstats
path: root/gnu/libexec
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-19 21:30:30 +0000
committerache <ache@FreeBSD.org>1995-08-19 21:30:30 +0000
commitb06a057b826e638a06edc1f92d5eed32662e0077 (patch)
treee1ea6a3b65e0f2e9f5d6e0f0f3956a82ada4b85b /gnu/libexec
parenta80ddb7b20df1716802b47c395201f120b369ee6 (diff)
downloadFreeBSD-src-b06a057b826e638a06edc1f92d5eed32662e0077.zip
FreeBSD-src-b06a057b826e638a06edc1f92d5eed32662e0077.tar.gz
Commit delta: current -> 1.06 + FreeBSD configuration
Diffstat (limited to 'gnu/libexec')
-rw-r--r--gnu/libexec/uucp/ChangeLog653
-rw-r--r--gnu/libexec/uucp/Makefile.inc2
-rw-r--r--gnu/libexec/uucp/NEWS35
-rw-r--r--gnu/libexec/uucp/README53
-rw-r--r--gnu/libexec/uucp/TODO45
-rw-r--r--gnu/libexec/uucp/VERSION2
-rw-r--r--gnu/libexec/uucp/common_sources/chat.c16
-rw-r--r--gnu/libexec/uucp/common_sources/config.h15
-rw-r--r--gnu/libexec/uucp/common_sources/conn.c8
-rw-r--r--gnu/libexec/uucp/common_sources/conn.h4
-rw-r--r--gnu/libexec/uucp/common_sources/copy.c54
-rw-r--r--gnu/libexec/uucp/common_sources/cu.h4
-rw-r--r--gnu/libexec/uucp/common_sources/getopt.h21
-rw-r--r--gnu/libexec/uucp/common_sources/log.c40
-rw-r--r--gnu/libexec/uucp/common_sources/policy.h27
-rw-r--r--gnu/libexec/uucp/common_sources/prot.c6
-rw-r--r--gnu/libexec/uucp/common_sources/prot.h23
-rw-r--r--gnu/libexec/uucp/common_sources/sysdep.h17
-rw-r--r--gnu/libexec/uucp/common_sources/system.h41
-rw-r--r--gnu/libexec/uucp/common_sources/trans.h4
-rw-r--r--gnu/libexec/uucp/common_sources/util.c6
-rw-r--r--gnu/libexec/uucp/common_sources/uuconf.h21
-rw-r--r--gnu/libexec/uucp/common_sources/uucp.h42
-rw-r--r--gnu/libexec/uucp/common_sources/uudefs.h17
-rw-r--r--gnu/libexec/uucp/contrib/amiga.c8
-rw-r--r--gnu/libexec/uucp/contrib/dialHDB.c12
-rw-r--r--gnu/libexec/uucp/contrib/uuclean2
-rw-r--r--gnu/libexec/uucp/contrib/uurate.c82
-rw-r--r--gnu/libexec/uucp/contrib/uusnap.c32
-rw-r--r--gnu/libexec/uucp/contrib/uutraf2
-rw-r--r--gnu/libexec/uucp/contrib/uutry6
-rw-r--r--gnu/libexec/uucp/contrib/xchat.c300
-rw-r--r--gnu/libexec/uucp/cu/Makefile4
-rw-r--r--gnu/libexec/uucp/cu/cu.117
-rw-r--r--gnu/libexec/uucp/cu/cu.c94
-rw-r--r--gnu/libexec/uucp/doc/uucp.texi5580
-rw-r--r--gnu/libexec/uucp/libunix/MANIFEST5
-rw-r--r--gnu/libexec/uucp/libunix/Makefile18
-rw-r--r--gnu/libexec/uucp/libunix/bytfre.c8
-rw-r--r--gnu/libexec/uucp/libunix/cohtty.c6
-rw-r--r--gnu/libexec/uucp/libunix/cusub.c31
-rw-r--r--gnu/libexec/uucp/libunix/cwd.c2
-rw-r--r--gnu/libexec/uucp/libunix/detach.c32
-rw-r--r--gnu/libexec/uucp/libunix/dirent.c4
-rw-r--r--gnu/libexec/uucp/libunix/dup2.c6
-rw-r--r--gnu/libexec/uucp/libunix/epopen.c6
-rw-r--r--gnu/libexec/uucp/libunix/failed.c26
-rw-r--r--gnu/libexec/uucp/libunix/filnam.c258
-rw-r--r--gnu/libexec/uucp/libunix/fsusg.c120
-rw-r--r--gnu/libexec/uucp/libunix/fsusg.h2
-rw-r--r--gnu/libexec/uucp/libunix/ftw.c6
-rw-r--r--gnu/libexec/uucp/libunix/getcwd.c2
-rw-r--r--gnu/libexec/uucp/libunix/indir.c4
-rw-r--r--gnu/libexec/uucp/libunix/init.c4
-rw-r--r--gnu/libexec/uucp/libunix/isfork.c2
-rw-r--r--gnu/libexec/uucp/libunix/iswait.c6
-rw-r--r--gnu/libexec/uucp/libunix/jobid.c90
-rw-r--r--gnu/libexec/uucp/libunix/lcksys.c50
-rw-r--r--gnu/libexec/uucp/libunix/locfil.c6
-rw-r--r--gnu/libexec/uucp/libunix/lock.c58
-rw-r--r--gnu/libexec/uucp/libunix/mail.c4
-rw-r--r--gnu/libexec/uucp/libunix/mkdirs.c14
-rw-r--r--gnu/libexec/uucp/libunix/move.c6
-rw-r--r--gnu/libexec/uucp/libunix/opensr.c8
-rw-r--r--gnu/libexec/uucp/libunix/pause.c21
-rw-r--r--gnu/libexec/uucp/libunix/picksb.c8
-rw-r--r--gnu/libexec/uucp/libunix/pipe.c6
-rw-r--r--gnu/libexec/uucp/libunix/proctm.c4
-rw-r--r--gnu/libexec/uucp/libunix/recep.c8
-rw-r--r--gnu/libexec/uucp/libunix/run.c4
-rw-r--r--gnu/libexec/uucp/libunix/seq.c6
-rw-r--r--gnu/libexec/uucp/libunix/serial.c259
-rw-r--r--gnu/libexec/uucp/libunix/signal.c4
-rw-r--r--gnu/libexec/uucp/libunix/spawn.c32
-rw-r--r--gnu/libexec/uucp/libunix/splcmd.c46
-rw-r--r--gnu/libexec/uucp/libunix/spool.c24
-rw-r--r--gnu/libexec/uucp/libunix/srmdir.c6
-rw-r--r--gnu/libexec/uucp/libunix/statsb.c6
-rw-r--r--gnu/libexec/uucp/libunix/status.c48
-rw-r--r--gnu/libexec/uucp/libunix/sync.c42
-rw-r--r--gnu/libexec/uucp/libunix/tcp.c444
-rw-r--r--gnu/libexec/uucp/libunix/tli.c628
-rw-r--r--gnu/libexec/uucp/libunix/tmpfil.c4
-rw-r--r--gnu/libexec/uucp/libunix/uacces.c4
-rw-r--r--gnu/libexec/uucp/libunix/ufopen.c89
-rw-r--r--gnu/libexec/uucp/libunix/uid.c109
-rw-r--r--gnu/libexec/uucp/libunix/wldcrd.c6
-rw-r--r--gnu/libexec/uucp/libunix/work.c46
-rw-r--r--gnu/libexec/uucp/libunix/xqtfil.c58
-rw-r--r--gnu/libexec/uucp/libunix/xqtsub.c23
-rw-r--r--gnu/libexec/uucp/libuuconf/MANIFEST1
-rw-r--r--gnu/libexec/uucp/libuuconf/Makefile11
-rw-r--r--gnu/libexec/uucp/libuuconf/README4
-rw-r--r--gnu/libexec/uucp/libuuconf/addblk.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/addstr.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/allblk.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/alloc.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/alloc.h4
-rw-r--r--gnu/libexec/uucp/libuuconf/base.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/bool.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/callin.c39
-rw-r--r--gnu/libexec/uucp/libuuconf/calout.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/chatc.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/cmdarg.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/cmdfil.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/cmdlin.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/debfil.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/deblev.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/diacod.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/dial.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/diasub.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/dnams.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/errno.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/errstr.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/filnam.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/freblk.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/fredia.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/free.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/freprt.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/fresys.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/grdcmp.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/hdial.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/hdnams.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/hinit.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/hlocnm.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/hport.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/hrmunk.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/hsinfo.c17
-rw-r--r--gnu/libexec/uucp/libuuconf/hsnams.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/hsys.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/hunk.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/iniglb.c10
-rw-r--r--gnu/libexec/uucp/libuuconf/init.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/int.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/lckdir.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/lineno.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/llocnm.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/local.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/locnm.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/logfil.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/maxuxq.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/mrgblk.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/paramc.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/port.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/prtsub.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/pubdir.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/rdlocs.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/rdperm.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/reliab.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/remunk.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/runuxq.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/sinfo.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/snams.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/split.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/spool.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/stafil.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/strip.c50
-rw-r--r--gnu/libexec/uucp/libuuconf/syshdr.h4
-rw-r--r--gnu/libexec/uucp/libuuconf/syssub.c11
-rw-r--r--gnu/libexec/uucp/libuuconf/tcalou.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/tdial.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/tdialc.c10
-rw-r--r--gnu/libexec/uucp/libuuconf/tdnams.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/tgcmp.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/thread.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/time.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/tinit.c12
-rw-r--r--gnu/libexec/uucp/libuuconf/tlocnm.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/tport.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/tportc.c8
-rw-r--r--gnu/libexec/uucp/libuuconf/tsinfo.c24
-rw-r--r--gnu/libexec/uucp/libuuconf/tsnams.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/tsys.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/tval.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/ugtlin.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/unk.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/uucnfi.h12
-rw-r--r--gnu/libexec/uucp/libuuconf/val.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/vinit.c6
-rw-r--r--gnu/libexec/uucp/libuuconf/vport.c10
-rw-r--r--gnu/libexec/uucp/libuuconf/vsinfo.c53
-rw-r--r--gnu/libexec/uucp/libuuconf/vsnams.c10
-rw-r--r--gnu/libexec/uucp/libuuconf/vsys.c6
-rw-r--r--gnu/libexec/uucp/libuucp/MANIFEST89
-rw-r--r--gnu/libexec/uucp/libuucp/bsrch.c4
-rw-r--r--gnu/libexec/uucp/libuucp/buffer.c4
-rw-r--r--gnu/libexec/uucp/libuucp/crc.c12
-rw-r--r--gnu/libexec/uucp/libuucp/debug.c10
-rw-r--r--gnu/libexec/uucp/libuucp/escape.c2
-rw-r--r--gnu/libexec/uucp/libuucp/getlin.c4
-rw-r--r--gnu/libexec/uucp/libuucp/getop1.c8
-rw-r--r--gnu/libexec/uucp/libuucp/getopt.c8
-rw-r--r--gnu/libexec/uucp/libuucp/memchr.c12
-rw-r--r--gnu/libexec/uucp/libuucp/parse.c12
-rw-r--r--gnu/libexec/uucp/libuucp/strstr.c4
-rw-r--r--gnu/libexec/uucp/libuucp/strtol.c4
-rw-r--r--gnu/libexec/uucp/libuucp/strtou.c4
-rw-r--r--gnu/libexec/uucp/tstuu.c30
-rw-r--r--gnu/libexec/uucp/uuchk/uuchk.c228
-rw-r--r--gnu/libexec/uucp/uucico/Makefile6
-rw-r--r--gnu/libexec/uucp/uucico/prote.c20
-rw-r--r--gnu/libexec/uucp/uucico/protf.c10
-rw-r--r--gnu/libexec/uucp/uucico/protg.c24
-rw-r--r--gnu/libexec/uucp/uucico/proti.c65
-rw-r--r--gnu/libexec/uucp/uucico/protj.c6
-rw-r--r--gnu/libexec/uucp/uucico/prott.c10
-rw-r--r--gnu/libexec/uucp/uucico/proty.c660
-rw-r--r--gnu/libexec/uucp/uucico/protz.c20
-rw-r--r--gnu/libexec/uucp/uucico/rec.c114
-rw-r--r--gnu/libexec/uucp/uucico/send.c116
-rw-r--r--gnu/libexec/uucp/uucico/time.c6
-rw-r--r--gnu/libexec/uucp/uucico/trans.c289
-rw-r--r--gnu/libexec/uucp/uucico/uucico.814
-rw-r--r--gnu/libexec/uucp/uucico/uucico.c112
-rw-r--r--gnu/libexec/uucp/uucico/xcmd.c14
-rw-r--r--gnu/libexec/uucp/uuconv/uuconv.c44
-rw-r--r--gnu/libexec/uucp/uucp/uucp.128
-rw-r--r--gnu/libexec/uucp/uucp/uucp.c20
-rw-r--r--gnu/libexec/uucp/uulog/uulog.c16
-rw-r--r--gnu/libexec/uucp/uuname/uuname.c12
-rw-r--r--gnu/libexec/uucp/uupick/uupick.c21
-rw-r--r--gnu/libexec/uucp/uustat/uustat.119
-rw-r--r--gnu/libexec/uucp/uustat/uustat.c159
-rw-r--r--gnu/libexec/uucp/uux/uux.18
-rw-r--r--gnu/libexec/uucp/uux/uux.c272
-rw-r--r--gnu/libexec/uucp/uuxqt/uuxqt.88
-rw-r--r--gnu/libexec/uucp/uuxqt/uuxqt.c175
227 files changed, 10961 insertions, 2518 deletions
diff --git a/gnu/libexec/uucp/ChangeLog b/gnu/libexec/uucp/ChangeLog
index 82353ff..8ce87f0 100644
--- a/gnu/libexec/uucp/ChangeLog
+++ b/gnu/libexec/uucp/ChangeLog
@@ -1,3 +1,656 @@
+Thu Aug 10 22:42:53 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Released version 1.06.
+
+ * uuconf/tsinfo.c (_uuconf_itaylor_system_internal): Don't set
+ uuconf_fcall merely because uuconf_qtimegrade is not set. Check
+ values against _uuconf_unset, not NULL.
+
+ * trans.c (fgot_data): Only log when data comes in if fsendfile is
+ FALSE.
+
+Wed Aug 9 20:52:29 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Makefile.in (VERSION): Change to 1.06.
+
+Tue Aug 1 20:13:36 1995 Ian Lance Taylor <ian@airs.com>
+
+ * uuconf/tsinfo.c (_uuconf_itaylor_system_internal): Set the fcall
+ field for the first alternate if it has some way of selecting a
+ port.
+
+ * Ard van Breemen: unix/serial.c (fsserial_hardflow): Add support
+ for NCR Tower using IRTS.
+
+ * policy.h (FSYNC_ON_CLOSE): Define.
+ * system.h (fsysdep_sync): Declare.
+ * uucp.h (fstdiosync): Define, twice.
+ * unix/sync.c: New file.
+ * copy.c (fcopy_open_file): Call fsysdep_sync.
+ * cu.c (icutake): Likewise.
+ * rec.c (frec_file_end): Likewise.
+ (frec_file_end): Call fstdiosync.
+ * uucp.c (uccopy): Likewise.
+ * uux.c (main): Likewise.
+ (uxadd_send_file): Likewise.
+ * unix/splcmd.c (zsysdep_spool_commands): Likewise.
+ * unix/Makefile.in (OBJS): Add sync.o.
+ (sync.o): New target.
+
+ * Peter Wemm: unix/filnam.c (fscmd_seq): Increase the delay each
+ time an attempt to lock LCK..SEQ fails.
+
+ * Peter Wemm: uustat.c (fsnotify): Escape a leading "From " when
+ including standard input in a mail message.
+
+Mon Jul 31 22:45:23 1995 Ian Lance Taylor <ian@airs.com>
+
+ * unix/serial.c (fsserial_lockfile): In the HAVE_SVR4_LOCKFILES
+ case, increase the space allocated to print the major and minor
+ numbers.
+
+Sun Jul 30 22:30:51 1995 Ian Lance Taylor <ian@airs.com>
+
+ * trans.c (fgot_data): Log a message as soon as anything comes in,
+ not just for file data.
+
+ * prote.c (feprocess_data): Handle a zero length file.
+
+Wed Jul 19 00:14:46 1995 Ian Lance Taylor <ian@airs.com>
+
+ * unix/xqtfil.c (fSone_dir): New static variable.
+ (fsysdep_get_xqt_init): Add zsystem argument.
+ (zsysdep_get_xqt): Likewise.
+ (usysdep_get_xqt_free): Likewise.
+ * system.h (fsysdep_get_xqt_init): Update declaration.
+ (zsysdep_get_xqt): Likewise.
+ (usysdep_get_xqt_free): Likewise.
+ * uuxqt.c (main): Pass zdosys for system to get_xqt routines.
+ * uustat.c (fsexecutions): Pass NULL for system to get_xqt
+ routines.
+ (fsquery): Likewise.
+
+ * uux.c (main): If we are not starting uucico, and we queued a
+ local execution, start uuxqt.
+
+Tue Jul 18 22:33:08 1995 Ian Lance Taylor <ian@airs.com>
+
+ * uuxqt.c (REMOVE_QINPUT): Define.
+ (uqdo_xqt_file): Set REMOVE_QINPUT if zQinput is in the spool
+ directory.
+ (isave_files): If REMOVE_QINPUT is set, save the input file.
+ (uqcleanup): If REMOVE_QINPUT and REMOVE_NEEDED are set, remove
+ the input file.
+
+Mon Jul 17 20:59:20 1995 Ian Lance Taylor <ian@airs.com>
+
+ * uuchk.c (ukshow): Add missing \n.
+
+Sun Jul 16 12:02:03 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Makefile.in (TEXI2HTML): Define.
+ (doc-dist): Depend upon uucp.html; put HTML files in documentation
+ distribution.
+ (html, uucp.html): New targets.
+
+Mon Jul 10 20:24:48 1995 Ian Lance Taylor <ian@airs.com>
+
+ * unix/lcksys.c: Rewrite to not truncate the system name in the
+ lock file name, unless HAVE_LONG_FILE_NAMES is 0.
+
+Sat Jul 8 13:41:26 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Andrey A. Chernov: cu.c (ucuhelp): Mention -E.
+ (fcudo_cmd): Use BUCHAR rather than casting to unsigned int.
+ (icuunrecogvar): Likewise.
+ (uculist_vars): Likewise.
+ (icuunrecogfn): Likewise.
+ * lib/getopt.c (_getopt_internal): Likewise.
+
+ * Andrey A. Chernov: Makefile.in (infodir): Changed commented out
+ setting from share/doc to share/info.
+
+ * Godfrey van der Linden: unix/serial.c (fsysdep_conn_io): Base
+ select or alarm timeout on connection speed.
+
+ * configure.in: Move AC_PREFIX_PROGRAM before AC_PROG_CC.
+ * configure: Rebuild.
+
+ * policy.h (HAVE_BROKEN_SETLKW): Add new define.
+ * unix/filnam.c (USE_POSIX_LOCKS): Don't set if HAVE_BROKEN_SETLKW
+ is set.
+ (fscmd_seq): If the F_SETLKW call returns EINVAL, revert to using
+ lock files.
+
+ * unix/spawn.c (ixsspawn): If setreuid is available, use it,
+ rather than setuid, to set the real user ID to the effective user
+ ID.
+
+ * Thomas Mechtersheimer: uuchk.c (main): Correct typo (iret for
+ iint).
+
+ * Bob Thrush: unix/serial.c (fsserial_hardflow): Correct typo
+ (c_cflags for c_cflag).
+
+ * configure.in: Check for sys/statvfs.h. Check for memset,
+ memcmp, and memcpy with the correct argument types (apparently
+ some systems require this).
+ * config.h.in (HAVE_SYS_STATVFS_H): Define.
+ * configure: Rebuild.
+
+Mon Jul 3 00:26:50 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Released version beta 1.06.
+
+Sun Jul 2 10:39:40 1995 Ian Lance Taylor <ian@airs.com>
+
+ * configure.in: Add AC_OUTPUT code to touch stamp-h when
+ rebuilding config.h.
+ * Makefile.in (stamp-h): Remove ``echo > stamp-h''.
+
+ * Makefile.in (dist): Fix for srcdir != objdir.
+ * unix/Makefile.in (dist): Likewise.
+ * uuconf/Makefile.in (dist): Likewise.
+ * lib/Makefile.in (dist): Likewise.
+
+Sat Jul 1 13:42:35 1995 Ian Lance Taylor <ian@airs.com>
+
+ * configure.in: Check for termios.h.
+ * config.h.in (HAVE_TERMIOS_H): Mention.
+ * policy.h: Set HAVE_POSIX_TERMIOS if HAVE_TERMIOS_H.
+
+Fri Jun 30 09:24:13 1995 Ian Lance Taylor <ian@airs.com>
+
+ * uux.c (zXxqt_name): Remove.
+ (fXxqtlocal): New static variable; replaces local fxqtlocal.
+ (sXxqtsys): New static variable; replaces local sxqtsys.
+ (zXxqtloc): New static variable; replaces local zxqtloc.
+ (bXgrade): New static variable; replaces local bgrade.
+ (abXxqt_tname): New static variable; replaces local abxqt_tname.
+ (abXxqt_xname): New static variable; replaces local abxqt_xname.
+ (main): Use new static variables instead of locals. Don't set
+ zXxqt_name.
+ (uxadd_xqt_line): Get file name here before opening file.
+ (uxadd_send_file): Remove parameters qxqtsys, zxqtloc, and bgrade.
+ Change all callers.
+
+ * unix/filnam.c (usput62): New static function.
+ (zscmd_file): When SPOOLDIR_TAYLOR, use a different algorithm
+ which does not read the sequence file.
+ * unix/splcmd.c (zsysdep_spool_commands): Return value of
+ zscmd_file might already exist; handle that case.
+ * unix/jobid.c (zsfile_to_jobid): Change jobid format when
+ SPOOLDIR_TAYLOR, since sequence number is now much longer.
+ (zsjobid_to_file): Corresponding change.
+ * unix/work.c (fswork_file): When SPOOLDIR_TAYLOR, don't require
+ the the file name to be 7 characters long.
+ (bsgrade): Change algorithm used when SPOOLDIR_TAYLOR.
+
+ * uustat.c (fsworkfile_show): Correct kill prompt to put program
+ name at start of line. Add trailing space after question mark.
+ (fsexecutions): Likewise.
+
+ * unix/work.c (fsysdep_get_work): Don't call fsysdep_get_work_init
+ if no more jobs are found.
+
+Thu Jun 29 15:27:31 1995 Ian Lance Taylor <ian@airs.com>
+
+ * fsusg.c: Update with changes from fileutils 3.12.
+ * configure.in: Update filesystem space tests to fileutils 3.12.
+ * config.h.in: Corresponding changes.
+
+ * unix/filnam.c (fscmd_seq): If F_SETLKW fails with ENOMEM,
+ ENOSPC, or ENOLCK, sleep and try again.
+
+ * Makefile.in (MORECFLAGS): Remove unused SBINDIR definition.
+ * unix/Makefile.in (run.o): Add dependency on Makefile and
+ ../Makefile, so that it is rebuilt if sbindir changes.
+ * uuconf/Makefile.in (callin.o): Add dependency on Makefile and
+ ../Makefile, so that it is rebuilt if NEWCONFIGLIB or OLDCONFIGLIB
+ change.
+ (hinit.o, hrmunk.o, maxuxq.o, rdperm.o, tinit.o): Likewise.
+ (vinit.o): Likewise.
+
+ * cu.c (main, ucuhelp): Update copyright.
+ * tstuu.c (main): Likewise.
+ * uuchk.c (main, ukhelp): Likewise.
+ * uucico.c (main, uhelp): Likewise.
+ * uuconv.c (main, uvhelp): Likewise.
+ * uucp.c (main, uchelp): Likewise.
+ * uulog.c (main, ulhelp): Likewise.
+ * uuname.c (main, unhelp): Likewise.
+ * uupick.c (main, uphelp): Likewise.
+ * uustat.c (main, ushelp): Likewise.
+ * uux.c (main, uxhelp): Likewise.
+ * uuxqt.c (main, uqhelp): Likewise.
+
+ * Makefile.in (VERSION): Update to beta1.06.
+
+Wed Jun 28 10:36:35 1995 Ian Lance Taylor <ian@airs.com>
+
+ * trans.c (struct scharge, sTsend, sTreceive): Remove.
+ (qTtiming_rec, iTrecsecs, iTrecmicros): New static variables.
+ (fqueue_receive): If adding something to an empty receive queue,
+ update iTrecsecs and iTrecmicros.
+ (utransfree): Remove references to sTsend and sTreceive. If
+ freeing qTtiming_rec, clear it.
+ (ftcharge): Remove. Remove all calls to it.
+ (fttime): New static function.
+ (uclear_queue): Clear qTtiming_rec.
+ (floop): Add timing code to replace ftcharge.
+ (fgot_data): Likewise.
+ (ftadd_cmd): Set s.bcmd to 'H' for a hangup request, for better
+ debugging information.
+ (ufailed): Remove setting of iTchecktime and calls to ftcharge.
+
+ * uuconf.h (UUCONF_STRIP_LOGIN): Define.
+ (UUCONF_STRIP_PROTO): Define.
+ (uuconf_strip): Declare.
+ * uuconf/strip.c: New file, definining uuconf_strip.
+ * uuconf/Makefile.in (OBJS): Add strip.o.
+ * uuconf/uucnfi.h (struct sprocess): Add new fields fstrip_login
+ and fstrip_proto.
+ * uuconf/iniglb.c (_uuconf_iinit_global): Initialize new fields.
+ * uuconf/tinit.c (asCmds): Add "strip-login" and "strip-proto".
+ * uucico.c (fdo_call): Check whether protocol commands should be
+ stripped, and pass information to zget_uucp_cmd.
+ (faccept_call): Likewise.
+ (flogin_prompt): Check whether login commands should be stripped,
+ and pass information to zget_typed_line.
+ (zget_uucp_cmd): Add fstrip argument, and use it to control
+ whether incoming characters are stripped.
+ (zget_typed_line): Likewise.
+ * uuchk.c (main): Report uuconf_strip information.
+
+Mon Jun 26 17:57:14 1995 Ian Lance Taylor <ian@airs.com>
+
+ * uuchk.c (main): Report global configuration information.
+
+ * uux.c (main): If an attempt is made to execute an empty command,
+ just create a poll file instead.
+
+ * uupick.c (main): Mention 'd' as a possible command.
+
+Wed Jun 21 16:16:13 1995 Ian Lance Taylor <ian@airs.com>
+
+ * unix/filnam.c (fscmd_seq): If available, use POSIX style locking
+ for the sequence file. Use IPRIVATE_FILE_MODE when creating the
+ sequene file.
+
+ * copy.c (fcopy_file): Add fsignals argument, and pass it to
+ fcopy_open_file. Update all callers.
+ (fcopy_open_file): Add fsignals argument; if TRUE, check for
+ signals while copying the file. Update all callers.
+ * uudefs.h (fcopy_file, fcopy_open_file): Update prototypes.
+
+Thu Jun 15 20:34:00 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Rob Janssen: getopt.h: Don't fail if P is not defined because
+ this file got included by something other than uucp.h.
+
+Tue Jun 6 13:17:14 1995 Ian Lance Taylor <ian@airs.com>
+
+ * log.c (ulog): Always open the log file even if zmsg is NULL.
+ * unix/detach.c (usysdep_detach): Call ulog with NULL before
+ closing stderr.
+
+ * log.c (ulog): Print file name correctly under HDB_LOGGING if an
+ error occurs.
+
+ * Andrey A. Chernov: uucp.h: Use off_t rather than long when
+ casting arguments to lseek.
+
+ * proti.c (IMAXPACKSIZE): Subtract one.
+ (fijstart): Correct iIforced_remote_packsize check.
+
+ * unix/filnam.c (zsfile_name): Only use remote system name in
+ local filename for SPOOLDIR_SVR4, not for SPOOLDIR_HDB.
+
+ * Peter da Silva: cu.c (asCulongopts): Add "escape".
+ (main): Handle -E/--escape.
+ * cu.1: Document -E/--escape.
+ * unix/cusub.c (fsysdep_cu): Don't treat \0 as an escape
+ character.
+
+ * Takatoshi Ikeda: log.c (ustats): Base 'M' vs. 'S' in HDB_LOGGING
+ on fcaller, not on fmaster.
+ (zldate_and_time): In HDB_LOGGING, don't zero fill the hour.
+ * uudefs.h (ustats): Change argument name in prototype.
+ * send.c (fsend_await_confirm): Pass fcaller rather than fmaster
+ to ustats.
+ * rec.c (frec_file_end): Likewise.
+ * trans.c (ufailed): Likewise.
+
+ * unix/tcp.c: Include <arpa/inet.h>.
+ (ftcp_dial): If gethostbyname fails, try inet_addr.
+
+ * Jim Brownfield: unix/detach.c (usysdep_detach): Call TIOCNOTTY
+ on /dev/tty, not on file descriptor 0.
+
+ * uuchk.c (ukshow): If the system will never be called, say so
+ explicitly.
+
+ * unix/pause.c (usysdep_pause): When using poll, clear the sdummy
+ structure before passing it down.
+
+ * unix/bytfre.c (csysdep_bytes_free): Check for overflow.
+
+ * C.A. Lademann: cu.c (asCulongopts): Add "nostop".
+ (main): Handle --nostop.
+ (ucuhelp): Mention --nostop.
+ * cu.1: Document --nostop.
+
+ * Dean Edmonds: cu.c (fcuset_var): Copy string before calling
+ uuconf_cmd_args, and handle UUCONF_CMDTABRET_KEEP correctly.
+
+ * Jorge Cwik: Add support for 'y' protocol.
+ * proty.c: New file, written by Jorge Cwik.
+ * prot.h: Declare 'y' protocol functions.
+ * uucico.c (asProtocols): Add entry for 'y' protocol.
+ * Makefile.in (UUOBJS): Add proty.o.
+ (ALLOBJS): Add proty.o.
+ (proty.o): New target.
+
+Mon Jun 5 12:05:22 1995 Ian Lance Taylor <ian@airs.com>
+
+ * cu.c (main): Don't clobber user specified ibaud when a specific
+ system is being called.
+
+ * unix/serial.c (fsysdep_stdin_init): chmod /dev/tty to 0600 to
+ prevent other users from writing to it.
+
+ * uux.c (main): If the argument is quoted by parentheses, don't
+ break it at shell separator characters.
+
+ * protg.c (fgprocess_data): Don't treat a duplicate RR as an RJ if
+ we are retransmitting packets. Corrects change of May 15, 1993.
+
+ * unix/lock.c (fsdo_lock): Log an error message if the LOCKFILES
+ define appears to not match the contents of the lock file.
+
+Sun Jun 4 14:25:43 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Makefile.in (uucp.info): Use explicit $(srcdir) rather than $<.
+ (uucp.dvi): Likewise.
+ (uucp.ps): Use uucp.dvi rather than $<.
+
+ * Scott Guthridge: cu.c (icutake): Skip \r characters unless
+ fCuvar_binary is set.
+
+ * unix/status.c (fsysdep_get_status): Ignore double quotes around
+ description string in status file.
+ (fsysdep_set_status): If SPOOLDIR_SVR4, put double quotes around
+ description string.
+
+ * uustat.c (fsxqt_file_read): Change second argument from file
+ name to open file.
+ (fsworkfile_show): Make sure execution file can be opened before
+ displaying information in execution file format.
+ (fsexecutions): Open file before passing it to fsxqt_file_read.
+
+ * uucp.h (ffileioerror): Rename from ffilereaderror.
+ * cu.c (icuput): Corresponding change.
+ * trans.c (floop): Likewise.
+ (fgot_data): Use ffileioerror to decide whether to print message
+ using errno.
+
+ * uuconv.c (uvwrite_taylor_port): Fix handling of dialer-sequence
+ for a modem port to actually print ``dialer-sequence''.
+
+ * uuconf/hsinfo.c (_uuconf_ihdb_system_internal): Treat a syntax
+ error in the time field as equivalent to ``never''.
+ * uuconf/vsinfo.c (_uuconf_iv2_system_internal): Likewise.
+
+ * uuchk.c (ukshow): Print max-retries information.
+
+ * Don Phillips: Add support for new called-timegrade command.
+ * uuconf.h (struct uuconf_system): Add uuconf_qcalledtimegrade
+ field.
+ * uuconf/tsinfo.c (asIcmds): Add "called-timegrade".
+ * uuconf/syssub.c (SYSTEM_TIMESPANS): Add uuconf_qcalledtimegrade.
+ * trans.c (fqueue): Check uuconf_qcalledtimegrade.
+ * uuchk.c (ukshow): Print called-timegrade and success-wait
+ information.
+ * uuconv.c (uvwrite_taylor_system): Handled called-timegrade.
+
+ * unix/xqtsub.c (fsysdep_lock_uuxqt_dir): Accept EISDIR.
+
+ * Damon: unix/mkdirs.c (fsysdep_make_dirs): Accept EROFS.
+
+Sat May 27 09:55:38 1995 Ian Lance Taylor <ian@airs.com>
+
+ * unix/detach.c (usysdep_detach): Mention routine name in
+ debugging message.
+
+ * tstuu.c (main): Exit with an error message if not compiled with
+ HAVE_TAYLOR_CONFIG.
+
+ * Jim Avera: Makefile.in (install-info): Get the info files from
+ the source directory if they aren't in the object directory.
+
+ * uuchk.c (main): Accept -s to only print information for a
+ specific system.
+ (asKlongopts): Add --system as a synonym for -s.
+ (ukusage): Mention -s.
+ (ukhelp): Likewise.
+
+ * Makefile.in (uuconf/libuuconf.a): Depend upon config.h.
+ (unix/libunix.a, lib/libuucp.a): Likewise.
+
+ * Matthias Urlichs and Olaf Kirch: If an execution fails, save the
+ files.
+ * sysh.unx (FAILEDDIR): Define.
+ * system.h (zsysdep_save_failed_file): Declare.
+ * uuxqt.c (uqdo_xqt_file): Call isave_files if an execution fails.
+ Move the execution files out of the execution directory on any
+ failure, not just a temporary one.
+ (isave_files): New function; pass all the execution files to
+ zsysdep_save_failed_file, and send mail to OWNER.
+ * unix/failed.c: New file.
+ * unix/Makefile.in (OBJS): Add failed.o.
+ (failed.o): New target.
+
+ * Johannes Stille: Remove various race conditions, as follows:
+ * rec.c (flocal_rec_send_request): Don't free qtrans if pfsendcmd
+ fails.
+ (fremote_send_reply): Likewise.
+ (fremote_send_fail_send): Move pfsendcmd call to the end of the
+ routine, after everything else has been done.
+ (frec_file_send_confirm): Likewise.
+ * send.c (struct ssendinfo): Add new fields fnever and zconfirm.
+ (flocal_send_fail): Remove first argument; change all callers.
+ (usfree_send): Free new zconfirm field.
+ (flocal_send_file_init): Initialize new zconfirm field.
+ (fremote_rec_file_init): Likewise.
+ (flocal_send_request): Free qtrans explicitly, rather than
+ expecting flocal_send_fail to do it.
+ (flocal_send_request): Don't free qtrans if pfsendcmd fails.
+ (flocal_send_await_reply): Use new fnever field rather than
+ overloading fsent.
+ (flocal_send_cancelled): Likewise.
+ (flocal_send_await_reply): Set fcmd field to TRUE.
+ (fremote_rec_reply): Set fcmd field to TRUE. Set qtrans->zlog
+ before calling pfsendcmd. Don't free qtrans if pfsendcmd fails.
+ (fremote_rec_fail_send): Move pfsendcmd call to the end of the
+ routine, after everything else has been done.
+ (fsend_file_end): If zconfirm is set, call fsend_await_confirm.
+ Don't bother to set fcmd here.
+ (fsend_await_confirm): If fsent is not set, just save command in
+ zconfirm and return.
+ (fsend_exec_file_init): Free and clear new zconfirm field.
+ * xcmd.c (flocal_xcmd_request): Don't free qtrans if pfsendcmd
+ fails.
+
+ * unix/pause.c: Prefer any of the other choices to nap, since the
+ meaning of nap argument varies from system to system, and the user
+ may not set HAVE_HUNDREDTHS_NAP correctly.
+
+ * unix/cusub.c (fsysdep_shell): When starting up an interactive
+ shell, use the environment variable SHELL rather than /bin/sh.
+
+Fri May 26 00:03:46 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Chip Salzenberg: uulog.c (main): Set cluser, not clsys, when
+ using HAVE_HDB_LOGGING.
+
+ * Robert Joop: uuconf/callin.c (uuconf_callin): Improve handling
+ of Unix style passwd files.
+
+ * uupick.c (main): Don't fail if we can't get system information,
+ since uupick is not setuid.
+
+ * Stephen Harris: uudefs.h (struct sstatus): Add new field
+ zstring.
+ * unix/status.c (fsysdep_get_status): Set zstring field.
+ * uustat.c (fsquery_show): Print and free zstring field, if set,
+ rather than indexing off type.
+ (fsmachines): Likewise.
+ * uucico.c (fcall): Free sstat.zstring.
+
+ * proti.c (cIwindow_timeout): New static variable.
+ (fijstart): Initialize cIwindow_timeout based on the window size
+ and connection speed. Increment both timeouts in callee.
+ (fishutdown): Initialize cIwindow_timeout.
+ (fiwindow_wait): Use cIwindow_timeout rather than cItimeout.
+
+ * unix/serial.c (fsysdep_conn_io): Try using select before doing a
+ blocking write, and use an alarm if we fall back to the blocking
+ write, to try to avoid deadlock when both systems fill the pipe.
+
+ * Trever Miller: unix/lock.c (fsdo_lock): Fix use of inid where
+ inme was intended, in HAVE_QNX_LOCKFILES code.
+
+ * unix/lock.c (fsdo_lock): Treat an empty lock file as stale.
+
+Thu May 25 11:46:32 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Kenji Rikitake: unix/serial.c (fsserial_hardflow): Handle
+ CRTS_IFLOW as used on BSDI.
+
+ * Gerriet M. Denkmann: uuconf/vsnams.c (uuconf_v2_system_names):
+ Accept continuation lines in L.sys.
+ * uuconf/vsinfo.c (_uuconf_iv2_system_internal): Skip comment
+ lines in L.cmds. Ignore everything after comma in L.cmds lines.
+
+ * Gerriet M. Denkmann: unix/ftw.c (ftw_dir): Initialize newlev to
+ avoid warning.
+
+ * Paul Pryor: unix/tli.c (ftli_open): Swap real and effective user
+ ID's when running as a server, so that root can bind privileged
+ ports.
+
+ * unix/tcp.c (ftcp_open): Call fsuser_perms and fsuucp_perms
+ rather than having the same code inline.
+
+ * sysh.unx (fsuser_perms, fsuucp_perms): Declare.
+ * unix/ufopen.c (fsuser_perms, fsuucp_perms): Move into uid.c.
+ * unix/uid.c: New file.
+ * unix/Makefile.in (OBJS): Add uid.o.
+ (uid.o): New target.
+
+ * unix/tcp.c: Move tcp.c into unix subdirectory.
+ * unix/tli.c: Likewise for tli.c.
+ * Makefile.in (UUOBJS, CUOBJS, ALLOBJS): Remove tcp.o and tli.o.
+ (tcp.o, tli.o): Remove.
+ * unix/Makefile.in (OBJS): Add tcp.o and tli.o.
+ (tcp.o, tli.o): New targets.
+
+ * Paul Pryor: configure.in: Check for -lnsl_s before -lnsl.
+
+ * Makefile.in (prefix): Use @prefix@, not /usr/local.
+ (exec_prefix): New variable, set to @exec_prefix@.
+ (sbindir, bindir): Use $(exec_prefix) rather than $(prefix).
+ (CPPFLAGS): New variable, set to @CPPFLAGS@.
+ (@SET_MAKE@): New macro used by autoconf 2.
+ (MORECFLAGS): Put -I. before -I$(srcdir).
+ (MDEFINES): Pass down CPPFLAGS.
+ (.c.o): Use CPPFLAGS.
+ (uuconv.o): Likewise.
+ (distclean): Remove stamp-h, config.log and config.cache.
+ (maintainer-clean): New synonym for realclean.
+ (configure, config.h, stamp-h, Makefile, config.status): Rewrite
+ as suggested by autoconf 2.3.
+ (.PHONY): Add maintainer-clean.
+ * lib/Makefile.in (CPPFLAGS): New variable, set to @CPPFLAGS@.
+ (MORECFLAGS): Put `-I..' before `-I$(srcdir)/..'.
+ (maintainer-clean): New synonym for realclean.
+ (.c.o): Use CPPFLAGS.
+ (Makefile): Just rebuild this Makefile, not the others.
+ (.PHONY): Add maintainer-clean.
+ * unix/Makefile.in (CPPFLAGS): New variable, set to @CPPFLAGS@.
+ (prefix): Removed.
+ (sbindir): Use @exec_prefix@ rather than $(prefix).
+ (MORECFLAGS): Put `-I..' before `-I$(srcdir)/..'.
+ (maintainer-clean): New synonym for realclean.
+ (.c.o): Use CPPFLAGS.
+ (Makefile): Just rebuild this Makefile, not the others.
+ (.PHONY): Add maintainer-clean.
+ * uuconf/Makefile.in (prefix): Set to @prefix@, not /usr/local.
+ (CPPFLAGS): New variable, set to @CPPFLAGS@.
+ (MORECFLAGS): Put `-I.' before `-I$(srcdir)' and `-I..' before
+ `-I$(srcdir)/..'.
+ (maintainer-clean): New synonym for realclean.
+ (.c.o): Use CPPFLAGS.
+ (Makefile): Just rebuild this Makefile, not the others.
+ (.PHONY): Add maintainer-clean.
+
+ * configure.in: Extensive changes for autoconf 2.3.
+ * configure: Regenerate using autoconf 2.3.
+ * install-sh: New file.
+
+Mon May 22 22:18:59 1995 Ian Lance Taylor <ian@airs.com>
+
+ * Mister Flash: chat.c (fcsend): Don't get forget to add 10 in \x.
+
+Tue Jan 17 22:49:05 1995 Ian Lance Taylor <ian@airs.com>
+
+ * unix/mkdirs.c (fsysdep_make_dirs): Don't get confused by a
+ double slash.
+
+Wed Aug 10 09:25:10 1994 Ian Lance Taylor (ian@airs.com)
+
+ * uuconf/hport.c (uuconf_hdb_find_port): Set iret to
+ UUCONF_SUCCESS when a port is found.
+
+Tue Aug 2 08:57:05 1994 Ian Lance Taylor (ian@airs.com)
+
+ * trans.c (ftadd_cmd): Report a 'P' (poll) command as garbled.
+
+Wed Jul 20 21:53:03 1994 Ian Lance Taylor (ian@airs.com)
+
+ * rec.c (flocal_rec_file_init): Set name of local system after
+ calling uuconf_system_local.
+ * uustat.c (fsexecutions): Likewise.
+
+Sat Jul 16 16:54:12 1994 Ian Lance Taylor (ian@airs.com)
+
+ * log.c (ulog): Use strerror in message about being unable to open
+ the log file.
+
+Wed Jul 13 00:44:33 1994 Ian Lance Taylor (ian@airs.com)
+
+ * rec.c (fremote_send_reply): Set qinfo->freplied before sending
+ the command.
+
+Sun Jul 10 23:25:23 1994 Ian Lance Taylor (ian@airs.com)
+
+ * Tin Le: lib/debug.c (udebug_buffer): Only compile if DEBUG > 1.
+
+Mon Jun 27 21:06:29 1994 Ian Lance Taylor (ian@airs.com)
+
+ * uuconf.h (UUCONF_CMDTABFLAG_NOCOMMENTS): Define.
+ * uuconf/cmdlin.c (uuconf_cmd_line): Handle NOCOMMENTS.
+ * uuxqt.c (uqdo_xqt_file): Pass NOCOMMENTS to uuconf_cmd_file.
+
+Thu May 19 22:50:37 1994 Ian Lance Taylor (ian@airs.com)
+
+ * Ollivier Robert: unix/mkdirs.c: Permit EISDIR.
+
+Wed May 18 23:15:36 1994 Ian Lance Taylor (ian@airs.com)
+
+ * uucico.c (fcall): Reset sDaemon fields each time through the
+ loop, not just once.
+
Thu May 5 23:15:11 1994 Ian Lance Taylor (ian@airs.com)
* Released version 1.05.
diff --git a/gnu/libexec/uucp/Makefile.inc b/gnu/libexec/uucp/Makefile.inc
index dfdd71e..e804c12 100644
--- a/gnu/libexec/uucp/Makefile.inc
+++ b/gnu/libexec/uucp/Makefile.inc
@@ -16,7 +16,7 @@ LIBUUCP= $(.CURDIR)/../libuucp/obj/libuucp.a
LIBUUCP= $(.CURDIR)/../libuucp/libuucp.a
.endif
-VERSION= 1.05
+VERSION= 1.06
owner= uucp
group= uucp
bindir= /usr/bin
diff --git a/gnu/libexec/uucp/NEWS b/gnu/libexec/uucp/NEWS
index 65360d5..738068e 100644
--- a/gnu/libexec/uucp/NEWS
+++ b/gnu/libexec/uucp/NEWS
@@ -1,3 +1,38 @@
+Changes in version 1.06:
+
+ As usual, many bugs were fixed.
+
+ Support was added for the 'y' protocol, contributed by Jorge Cwik,
+ the designer of the protocol.
+
+ The name of command files was changed when using SPOOLDIR_TAYLOR;
+ they now use a much longer sequence number. This affects the
+ jobid strings reported by uustat. The change makes uux and uucp
+ more efficient.
+
+ Added ``called-timegrade'' command to sys file.
+
+ Added --nostop and -E/--escape options to cu.
+
+ Added -s option to uuchk.
+
+ Added ``strip-login'' and ``strip-proto'' commands to config file.
+
+ uux will now create a poll file if invoked as ``uux SYSTEM!''.
+
+ If an execution fails, the data file is saved, if there is enough
+ free disk space.
+
+ uux now uses POSIX file locking, if available, when locking the
+ sequence file.
+
+ The man pages were incorporated into the Texinfo manual.
+
+ The UUCP Internals FAQ was incorporated into the Texinfo manual.
+
+ The spool directory layout is now documented in the Texinfo
+ manual.
+
Changes in version 1.05:
As usual, many bugs were fixed.
diff --git a/gnu/libexec/uucp/README b/gnu/libexec/uucp/README
index 8d69444..3297da3 100644
--- a/gnu/libexec/uucp/README
+++ b/gnu/libexec/uucp/README
@@ -1,25 +1,27 @@
-This is the README file for version 1.05 of the Taylor UUCP package.
+This is the README file for version 1.06 of the Taylor UUCP package.
It was written by Ian Lance Taylor. I can be reached at ian@airs.com,
or, equivalently, uunet!cygint!airs!ian, or c/o Cygnus Support,
-Building 200, 1 Kendall Square, Cambridge MA, 02139, USA.
+48 Grove Street, Somerville, MA 02144, USA.
-There is a mailing list for discussion of the package. To join (or
-get off) the list, send mail to taylor-uucp-request@gnu.ai.mit.edu.
-Mail to this address is answered by a person, not a program. When
-joining the list, make sure you include the address at which you want
-to receive mail in the body of your message. To send a message to the
-list, send it to taylor-uucp@gnu.ai.mit.edu.
-
-Jeff Ross has volunteered to maintain patches for UUCP releases. They
-may be obtained via anonymous FTP from ftp.fdu.edu, in the directory
-pub/taylor-uucp.
+There is a mailing list for discussion of the package. The list is
+hosted by Eric Schnoebelen at cirr.com. To join (or get off) the
+list, send mail to taylor-uucp-request@cirr.com. Mail to this address
+is answered by the majordomo program. To join the list, send the
+message ``subscribe ADDRESS'' where ADDRESS is your e-mail address.
+To send a message to the list, send it to taylor-uucp@cirr.com. The
+old list address, taylor-uucp@gnu.ai.mit.edu, will also work. There
+is an archive of all messages sent to the mailing list at ftp.cirr.com.
This package is covered by the Gnu Public License. See the file
COPYING for details. If you would like to do something with this
package that you feel is reasonable but you feel is prohibited by the
license, contact me to see if we can work it out.
+The most recent version may be obtained from any Gnu archive site.
+The canonical site is prep.ai.mit.edu. There are many mirror sites,
+including ftp.uu.net and wuarchive.wustl.edu.
+
WHAT IT IS
This is the complete source code for a Unix UUCP package. It provides
@@ -32,11 +34,11 @@ file to another) and tstuu (a test harness for the package).
This is the standard UUCP package of the Free Software Foundation.
The package currently supports the 'f', 'g' (in all window and packet
-sizes), 'G', 't' and 'e' protocols, as well a Zmodem protocol and two
-new bidirectional protocols. If you have a Berkeley sockets library,
-it can make TCP connections. If you have TLI libraries, it can make
-TLI connections. It supports a new configuration file mechanism which
-I like (but other people dislike).
+sizes), 'G', 't' and 'e' protocols, as well a Zmodem protocol, the FX
+UUCICO 'y' protocol, and two new bidirectional protocols. If you have
+a Berkeley sockets library, it can make TCP connections. If you have
+TLI libraries, it can make TLI connections. It supports a new
+configuration file mechanism which I like (but other people dislike).
The package has a few advantages over regular UUCP:
@@ -86,7 +88,7 @@ The documentation is in the file uucp.texi, which is a Texinfo file.
Texinfo is a format used by the Free Software Foundation. You can
print the documentation using TeX in combination with the file
texinfo.tex. DVI, PostScript and info versions of the documentation
-are available in a separate package, uucp-doc-1.05.tar.gz.
+are available in a separate package, uucp-doc-1.06.tar.gz.
See the TODO file for things which should be done. Please feel free
to do them, although you may want to check with me first. Send me
@@ -105,7 +107,6 @@ The compilation instructions are in uucp.texi. Here is a summary.
LDFLAGS: Flags to pass to $CC when only linking; default none
LIBS: Library arguments to pass to $CC; default none
INSTALL: Install program; default install -c or cp
- INSTALLDATA: Install data; default install -c -m 0644 or cp
The configure script will compile a number of test programs to see
what is available on your system, so if your system is at all
unusual you will need to pass in $CC and $LIBS correctly.
@@ -135,7 +136,8 @@ The compilation instructions are in uucp.texi. Here is a summary.
the default value for CFLAGS to be set incorrectly. If ``echo
${CFLAGS--g}'' echoes ``g'' rather than ``-g'', then you must set
CFLAGS in the environment before running configure. There is a
- patch available from BSDI for this bug. (From David Vrona).
+ patch available from BSDI for this bug. (Reported by David
+ Vrona).
On AIX 3.2.5, and possibly other versions, cc -E does not work,
reporting ``Option NOROCONST is not valid.'' Test this before
@@ -145,7 +147,7 @@ The compilation instructions are in uucp.texi. Here is a summary.
This may give a warning about the file being empty, but it should
not give the ``Option NOROCONST'' warning. The workaround is to
remove the ",noroconst" entry from the "options" clause in the
- "cc" stanza in /etc/xlc.cfg. (From Chris Lewis).
+ "cc" stanza in /etc/xlc.cfg. (Reported by Chris Lewis).
Examine config.h and Makefile to make sure they're right.
@@ -160,3 +162,12 @@ The compilation instructions are in uucp.texi. Here is a summary.
programs are compiled with debugging information, and they are not
stripped when they are installed. Read the man page for strip for
more information.
+
+ On older System V based systems which do not have the setreuid
+ system call, problems may arise if ordinary users can start an
+ execution of uuxqt, perhaps indirectly via uucp or uux. UUCP jobs
+ may wind up executing with a real user ID of the user who invoked
+ uuxqt, which can cause problems if the UUCP job checks the real
+ user ID for security purposes. On such systems, it is safest to
+ put ``run-uuxqt never'' in the `config' file, so that uucico never
+ starts uuxqt, and invoke uuxqt directly from cron.
diff --git a/gnu/libexec/uucp/TODO b/gnu/libexec/uucp/TODO
index a0e96bf..f1bed5f 100644
--- a/gnu/libexec/uucp/TODO
+++ b/gnu/libexec/uucp/TODO
@@ -387,11 +387,6 @@ fancy.
Nickolay Saukh: use a default port for cu, you can just do ``cu
number''.
-178.
-
-Don Phillips: should there be some way to restrict of grade of
-transfers even when the other system places the call?
-
180.
Nickolay Saukh: if we have received a partial file, request the remote
@@ -740,3 +735,43 @@ parameters, but it would be nice if this were dealt with somehow.
Andrew A. Chernov: Perhaps uuxqt should log when it terminates.
237.
+
+dialer-sequence doesn't really do the right thing. There is no way to
+specify both the TCP address and a phone number.
+
+238.
+
+cu -t doesn't work at all. It does nothing.
+
+239.
+
+Paul Pryor: Perhaps a service command should be added to the sys and
+port files. This command would be used as ``service cu'' to indicate
+that the system or port was only available to cu, not to UUCP.
+
+240.
+
+Tim Iverson: The 'g' and 'i' protocol code tends to parse data packet
+headers twice. It processes them once to find out how large the
+packet is, waits for that data to arrive, and then processes the
+header again the second time around. It would be possible to avoid
+this by changing the code to be a simple state machine which
+remembered where it was in the process of parsing the packet.
+
+241.
+
+Klaus Dahlenburg: Log a more precise reason for failure in the .Status
+file: e.g., all ports in use, no matching ports, etc.
+
+242.
+
+Steven S. Dick: It would be helpful if there was a way to get uuchk to
+dump the data from ports/dialers/etc that was NOT picked up from the
+sys file. In other words, add some option to scan the port file and
+the dial file, presumably using uuconf_find_port for the former and
+uuconf_dialer_names for the latter.
+
+243.
+
+Kai Michael Kretschmann: Add a configure option to drop the connection
+if jobs are coming in too slowly, indicating a bad connection.
diff --git a/gnu/libexec/uucp/VERSION b/gnu/libexec/uucp/VERSION
index f940c9b..0e41fb5 100644
--- a/gnu/libexec/uucp/VERSION
+++ b/gnu/libexec/uucp/VERSION
@@ -1,4 +1,4 @@
-Version 1.05
+Version 1.06
a complete, unmodified version of this program is available from
prep.ai.mit.edu.
diff --git a/gnu/libexec/uucp/common_sources/chat.c b/gnu/libexec/uucp/common_sources/chat.c
index f35e2e0..4692fe7 100644
--- a/gnu/libexec/uucp/common_sources/chat.c
+++ b/gnu/libexec/uucp/common_sources/chat.c
@@ -1,7 +1,7 @@
/* chat.c
Chat routine for the UUCP package.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char chat_rcsid[] = "$Id: chat.c,v 1.2 1994/05/07 18:08:33 ache Exp $";
+const char chat_rcsid[] = "$Id: chat.c,v 1.46 1995/06/21 19:14:29 ian Rel $";
#endif
#include <ctype.h>
@@ -728,9 +728,9 @@ fcsend (qconn, puuconf, z, qsys, qdial, zphone, ftranslate, fstrip)
if (isdigit (BUCHAR (z[1])))
bsend = (char) (16 * bsend + *++z - '0');
else if (isupper (BUCHAR (z[1])))
- bsend = (char) (16 * bsend + *++z - 'A');
+ bsend = (char) (16 * bsend + *++z - 'A' + 10);
else
- bsend = (char) (16 * bsend + *++z - 'a');
+ bsend = (char) (16 * bsend + *++z - 'a' + 10);
}
break;
case 'L':
@@ -926,7 +926,7 @@ fcsend (qconn, puuconf, z, qsys, qdial, zphone, ftranslate, fstrip)
break;
#endif
}
-
+
if (fsend)
{
fquote = fcsend_debug (fquote, (size_t) 1, &bsend);
@@ -1190,7 +1190,7 @@ fcprogram (qconn, puuconf, pzprogram, qsys, qdial, zphone, zport, ibaud)
*pzarg = zbufcpy (*pz);
continue;
}
-
+
*pzarg = NULL;
zto = NULL;
calc = 0;
diff --git a/gnu/libexec/uucp/common_sources/config.h b/gnu/libexec/uucp/common_sources/config.h
index c9fe336..f17b97c 100644
--- a/gnu/libexec/uucp/common_sources/config.h
+++ b/gnu/libexec/uucp/common_sources/config.h
@@ -28,6 +28,7 @@
#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_TERMIOS_H 1 /* <termios.h> */
#define HAVE_SYS_PARAM_H 1 /* <sys/param.h> */
#define HAVE_UTIME_H 1 /* <utime.h> */
#define HAVE_FCNTL_H 1 /* <fcntl.h> */
@@ -45,6 +46,14 @@
#define HAVE_GLOB_H 1 /* <glob.h> */
#define HAVE_SYS_SELECT_H 0 /* <sys/select.h> */
#define HAVE_SYS_TYPES_TCP_H 0 /* <sys/types.tcp.h> */
+#define HAVE_SYS_MOUNT_H 1 /* <sys/mount.h> */
+#define HAVE_SYS_VFS_H 0 /* <sys/vfs.h> */
+#define HAVE_SYS_FILSYS_H 0 /* <sys/filsys.h> */
+#define HAVE_SYS_STATFS_H 0 /* <sys/statfs.h> */
+#define HAVE_SYS_DUSTAT_H 0 /* <sys/dustat.h> */
+#define HAVE_SYS_FS_TYPES_H 0 /* <sys/fs_types.h> */
+#define HAVE_USTAT_H 0 /* <ustat.h> */
+#define HAVE_SYS_STATVFS_H 0 /* <sys/statvfs.h> */
/* If major and minor are not defined in <sys/types.h>, but are in
<sys/mkdev.h>, set MAJOR_IN_MKDEV to 1. If they are in
@@ -177,19 +186,19 @@
another instance of Taylor UUCP.
STAT_STATVFS statvfs function
+ STAT_STATFS3_OSF1 three argument statfs function (OSF/1)
STAT_STATFS2_BSIZE two argument statfs function with f_bsize field
STAT_STATFS2_FSIZE two argument statfs function with f_fsize field
STAT_STATFS2_FS_DATA two argument statfs function with fd_req field
STAT_STATFS4 four argument statfs function
- STAT_DUSTAT dustat function (AIX PS/2)
STAT_DISK_SPACE disk_space function (QNX)
STAT_USTAT the ustat function with 512 byte blocks. */
#define STAT_STATVFS 0
+#define STAT_STATFS3_OSF1 0
#define STAT_STATFS2_BSIZE 1
#define STAT_STATFS2_FSIZE 0
#define STAT_STATFS2_FS_DATA 0
#define STAT_STATFS4 0
-#define STAT_DUSTAT 0
#define STAT_DISK_SPACE 0
#define STAT_USTAT 0
@@ -358,7 +367,7 @@
Otherwise, the code will use OPEN_MAX if defined, then NOFILE if
defined, then 20. */
#define HAVE_GETDTABLESIZE 1
-#define HAVE_SYSCONF 0
+#define HAVE_SYSCONF 1
/* The code will use one of the following functions when detaching
from a terminal. One of these must exist. */
diff --git a/gnu/libexec/uucp/common_sources/conn.c b/gnu/libexec/uucp/common_sources/conn.c
index f3ae8e4..de91b11 100644
--- a/gnu/libexec/uucp/common_sources/conn.c
+++ b/gnu/libexec/uucp/common_sources/conn.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char conn_rcsid[] = "$Id: conn.c,v 1.2 1994/05/07 18:08:38 ache Exp $";
+const char conn_rcsid[] = "$Id: conn.c,v 1.15 1995/06/21 19:14:35 ian Rel $";
#endif
#include <ctype.h>
@@ -234,7 +234,7 @@ fconn_dial (qconn, puuconf, qsys, zphone, qdialer, ptdialerfound)
qdialer = &sdialer;
if (ptdialerfound == NULL)
ptdialerfound = &tfound;
-
+
qdialer->uuconf_zname = NULL;
*ptdialerfound = DIALERFOUND_FALSE;
diff --git a/gnu/libexec/uucp/common_sources/conn.h b/gnu/libexec/uucp/common_sources/conn.h
index 368f7e6..09235ea 100644
--- a/gnu/libexec/uucp/common_sources/conn.h
+++ b/gnu/libexec/uucp/common_sources/conn.h
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#ifndef CONN_H
diff --git a/gnu/libexec/uucp/common_sources/copy.c b/gnu/libexec/uucp/common_sources/copy.c
index e1b974d..b1787f9 100644
--- a/gnu/libexec/uucp/common_sources/copy.c
+++ b/gnu/libexec/uucp/common_sources/copy.c
@@ -1,7 +1,7 @@
/* copy.c
Copy one file to another for the UUCP package.
- Copyright (C) 1991, 1992 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char copy_rcsid[] = "$Id: copy.c,v 1.13 1994/01/30 21:01:46 ian Rel $";
+const char copy_rcsid[] = "$Id: copy.c,v 1.18 1995/08/02 01:17:31 ian Rel $";
#endif
#include "uudefs.h"
@@ -41,11 +41,12 @@ const char copy_rcsid[] = "$Id: copy.c,v 1.13 1994/01/30 21:01:46 ian Rel $";
#if USE_STDIO
boolean
-fcopy_file (zfrom, zto, fpublic, fmkdirs)
+fcopy_file (zfrom, zto, fpublic, fmkdirs, fsignals)
const char *zfrom;
const char *zto;
boolean fpublic;
boolean fmkdirs;
+ boolean fsignals;
{
FILE *efrom;
boolean fret;
@@ -57,17 +58,18 @@ fcopy_file (zfrom, zto, fpublic, fmkdirs)
return FALSE;
}
- fret = fcopy_open_file (efrom, zto, fpublic, fmkdirs);
+ fret = fcopy_open_file (efrom, zto, fpublic, fmkdirs, fsignals);
(void) fclose (efrom);
return fret;
}
boolean
-fcopy_open_file (efrom, zto, fpublic, fmkdirs)
+fcopy_open_file (efrom, zto, fpublic, fmkdirs, fsignals)
FILE *efrom;
const char *zto;
boolean fpublic;
boolean fmkdirs;
+ boolean fsignals;
{
FILE *eto;
char ab[8192];
@@ -86,6 +88,21 @@ fcopy_open_file (efrom, zto, fpublic, fmkdirs)
(void) remove (zto);
return FALSE;
}
+ if (fsignals && FGOT_SIGNAL ())
+ {
+ /* Log the signal. */
+ ulog (LOG_ERROR, (const char *) NULL);
+ (void) fclose (eto);
+ (void) remove (zto);
+ return FALSE;
+ }
+ }
+
+ if (! fsysdep_sync (eto, zto))
+ {
+ (void) fclose (eto);
+ (void) remove (zto);
+ return FALSE;
}
if (fclose (eto) != 0)
@@ -119,11 +136,12 @@ fcopy_open_file (efrom, zto, fpublic, fmkdirs)
#endif
boolean
-fcopy_file (zfrom, zto, fpublic, fmkdirs)
+fcopy_file (zfrom, zto, fpublic, fmkdirs, fsignals)
const char *zfrom;
const char *zto;
boolean fpublic;
boolean fmkdirs;
+ boolean fsignals;
{
int ofrom;
boolean fret;
@@ -135,17 +153,18 @@ fcopy_file (zfrom, zto, fpublic, fmkdirs)
return FALSE;
}
- fret = fcopy_open_file (ofrom, zto, fpublic, fmkdirs);
+ fret = fcopy_open_file (ofrom, zto, fpublic, fmkdirs, fsignals);
(void) close (ofrom);
return fret;
}
boolean
-fcopy_open_file (ofrom, zto, fpublic, fmkdirs)
+fcopy_open_file (ofrom, zto, fpublic, fmkdirs, fsignals)
int ofrom;
const char *zto;
boolean fpublic;
boolean fmkdirs;
+ boolean fsignals;
{
int oto;
char ab[8192];
@@ -180,6 +199,21 @@ fcopy_open_file (ofrom, zto, fpublic, fmkdirs)
(void) remove (zto);
return FALSE;
}
+ if (fsignals && FGOT_SIGNAL ())
+ {
+ /* Log the signal. */
+ ulog (LOG_ERROR, (const char *) NULL);
+ (void) fclose (eto);
+ (void) remove (zto);
+ return FALSE;
+ }
+ }
+
+ if (! fsysdep_sync (oto, zto))
+ {
+ (void) close (oto);
+ (void) remove (zto);
+ return FALSE;
}
if (close (oto) < 0)
diff --git a/gnu/libexec/uucp/common_sources/cu.h b/gnu/libexec/uucp/common_sources/cu.h
index 748e2d3..8c22670 100644
--- a/gnu/libexec/uucp/common_sources/cu.h
+++ b/gnu/libexec/uucp/common_sources/cu.h
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
/* The user settable variables supported by cu. */
diff --git a/gnu/libexec/uucp/common_sources/getopt.h b/gnu/libexec/uucp/common_sources/getopt.h
index d9f87a5..61e2954 100644
--- a/gnu/libexec/uucp/common_sources/getopt.h
+++ b/gnu/libexec/uucp/common_sources/getopt.h
@@ -5,18 +5,18 @@
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This file was modified slightly by Ian Lance Taylor, November 1992,
- for Taylor UUCP. */
+ for Taylor UUCP, and again in June, 1995. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
@@ -100,6 +100,14 @@ enum _argtype
optional_argument
};
+#ifndef P
+/* On some systems, <stdio.h> includes getopt.h before P is defined by
+ uucp.h, and the -I arguments cause this version of getopt.h to be
+ included. Work around that here. */
+#define P(x) ()
+#define UNDEFINE_P
+#endif
+
extern int getopt P((int argc, char *const *argv, const char *shortopts));
extern int getopt_long P((int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind));
@@ -113,6 +121,11 @@ extern int _getopt_internal P((int argc, char *const *argv,
const struct option *longopts, int *longind,
int long_only));
+#ifdef UNDEFINE_P
+#undef P
+#undef UNDEFINE_P
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/gnu/libexec/uucp/common_sources/log.c b/gnu/libexec/uucp/common_sources/log.c
index 261163a..1c35b87 100644
--- a/gnu/libexec/uucp/common_sources/log.c
+++ b/gnu/libexec/uucp/common_sources/log.c
@@ -1,7 +1,7 @@
/* log.c
Routines to add entries to the log files.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char log_rcsid[] = "$Id: log.c,v 1.2 1994/05/07 18:08:47 ache Exp $";
+const char log_rcsid[] = "$Id: log.c,v 1.61 1995/06/21 19:14:58 ian Rel $";
#endif
#include <ctype.h>
@@ -199,7 +199,7 @@ ulog_system (zsystem)
{
ubuffree (zLsystem);
zLsystem = zbufcpy (zsystem);
-#if HAVE_HDB_LOGGING
+#if HAVE_HDB_LOGGING
/* Under HDB logging we now must write to a different log file. */
ulog_close ();
#endif /* HAVE_HDB_LOGGING */
@@ -287,9 +287,6 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j)
}
}
- if (zmsg == NULL)
- return;
-
#if DEBUG > 1
/* If we've had a debugging file open in the past, then we want to
write all log file entries to the debugging file even if it's
@@ -321,9 +318,12 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j)
{
if (eLlog == NULL && ! fLlog_tried)
{
+ const char *zprint = NULL;
+
fLlog_tried = TRUE;
#if ! HAVE_HDB_LOGGING
eLlog = esysdep_fopen (zLogfile, TRUE, TRUE, TRUE);
+ zprint = zLogfile;
#else /* HAVE_HDB_LOGGING */
{
const char *zsys;
@@ -331,7 +331,7 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j)
char *zlower;
char *zfile;
- /* We want to write to .Log/program/system, e.g.
+ /* We want to write to .Log/program/system, e.g.
.Log/uucico/uunet. The system name may not be set. */
if (zLsystem == NULL)
zsys = "ANY";
@@ -356,7 +356,10 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j)
sprintf (zfile, zLogfile, zbase, zsys);
ubuffree (zbase);
eLlog = esysdep_fopen (zfile, TRUE, TRUE, TRUE);
- ubuffree (zfile);
+ if (eLlog != NULL)
+ ubuffree (zfile);
+ else
+ zprint = zfile;
}
#endif /* HAVE_HDB_LOGGING */
@@ -367,8 +370,8 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j)
running on an inbound call stderr is actually
connected to a remote system, but is better than
doing nothing. */
- fprintf (stderr, "%s: %s: can not open log file\n",
- zProgram, zLogfile);
+ fprintf (stderr, "%s: %s: can not open log file: %s\n",
+ zProgram, zprint, strerror (errno));
if (pfLfatal != NULL)
(*pfLfatal) ();
usysdep_exit (FALSE);
@@ -383,6 +386,9 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j)
return;
}
+ if (zmsg == NULL)
+ return;
+
if (pfLstart != NULL)
(*pfLstart) ();
@@ -610,7 +616,7 @@ ulog_close ()
/*ARGSUSED*/
void
-ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fmaster)
+ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fcaller)
boolean fsucceeded;
const char *zuser;
const char *zsystem;
@@ -618,7 +624,7 @@ ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fmaster)
long cbytes;
long csecs;
long cmicros;
- boolean fmaster;
+ boolean fcaller;
{
long cbps;
@@ -633,7 +639,7 @@ ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fmaster)
{
csecs += cmicros / 10000000L;
cmicros = cmicros % 1000000L;
- }
+ }
/* On a system which can determine microseconds we might very well
have both csecs == 0 and cmicros == 0. */
@@ -701,7 +707,7 @@ ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fmaster)
++iseq;
fprintf (eLstats,
"%s!%s %c (%s) (C,%d,%d) [%s] %s %ld / %ld.%03ld secs, %ld%s%s\n",
- zsystem, zuser, fmaster ? 'M' : 'S', zldate_and_time (),
+ zsystem, zuser, fcaller ? 'M' : 'S', zldate_and_time (),
iLid, iseq, zLdevice == NULL ? "unknown" : zLdevice,
fsent ? "->" : "<-",
cbytes, csecs, cmicros / 1000, cbps,
@@ -761,7 +767,7 @@ zldate_and_time ()
s.tm_hour, s.tm_min);
#endif
#if HAVE_HDB_LOGGING
- sprintf (ab, "%d/%d-%02d:%02d:%02d", s.tm_mon + 1, s.tm_mday,
+ sprintf (ab, "%d/%d-%d:%02d:%02d", s.tm_mon + 1, s.tm_mday,
s.tm_hour, s.tm_min, s.tm_sec);
#endif
diff --git a/gnu/libexec/uucp/common_sources/policy.h b/gnu/libexec/uucp/common_sources/policy.h
index 75b8d21..171197e 100644
--- a/gnu/libexec/uucp/common_sources/policy.h
+++ b/gnu/libexec/uucp/common_sources/policy.h
@@ -1,7 +1,7 @@
/* policy.h
Configuration file for policy decisions. To be edited on site.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
/* This header file contains macro definitions which must be set by
@@ -72,10 +72,10 @@
figure out what's happening if something goes wrong. */
#if HAVE_BSD_TTY + HAVE_SYSV_TERMIO + HAVE_POSIX_TERMIOS == 0
-#ifdef __QNX__
+#if HAVE_TERMIOS_H
#undef HAVE_POSIX_TERMIOS
#define HAVE_POSIX_TERMIOS 1
-#else /* ! defined (__QNX__) */
+#else /* ! HAVE_TERMIOS_H */
#if HAVE_CBREAK
#undef HAVE_BSD_TTY
#define HAVE_BSD_TTY 1
@@ -83,7 +83,7 @@
#undef HAVE_SYSV_TERMIO
#define HAVE_SYSV_TERMIO 1
#endif /* ! HAVE_CBREAK */
-#endif /* ! defined (__QNX__) */
+#endif /* ! HAVE_TERMIOS_H */
#endif /* HAVE_BSD_TTY + HAVE_SYSV_TERMIO + HAVE_POSIX_TERMIOS == 0 */
/* On some systems a write to a serial port will block even if the
@@ -215,6 +215,12 @@
broken pretty much always have saved setuid. */
#define HAVE_BROKEN_SETREUID 0
+/* On a few systems, such as NextStep 3.3, the POSIX macro F_SETLKW is
+ defined, but does not work. On such systems, you must set
+ HAVE_BROKEN_SETLKW to 1. If you do not, uux will hang, or log
+ peculiar error messages, every time it is run. */
+#define HAVE_BROKEN_SETLKW 0
+
/* On the 3B2, and possibly other systems, nap takes an argument in
hundredths of a second rather than milliseconds. I don't know of
any way to test for this. Set HAVE_HUNDREDTHS_NAP to 1 if this is
@@ -623,6 +629,15 @@
permitted. */
#define ALLOW_FILENAME_ARGUMENTS 1
+/* If you set FSYNC_ON_CLOSE to 1, all output files will be forced out
+ to disk using the fsync system call when they are closed. This can
+ be useful if you can not afford to lose people's mail if the system
+ crashes. However, not all systems have the fsync call, and it is
+ always less efficient to use it. Note that some versions of SCO
+ Unix, and possibly other systems, make fsync a synonym for sync,
+ which is extremely inefficient. */
+#define FSYNC_ON_CLOSE 0
+
#if HAVE_TAYLOR_LOGGING
/* The default log file when using HAVE_TAYLOR_LOGGING. When using
diff --git a/gnu/libexec/uucp/common_sources/prot.c b/gnu/libexec/uucp/common_sources/prot.c
index 0a6cbc8..54156a4 100644
--- a/gnu/libexec/uucp/common_sources/prot.c
+++ b/gnu/libexec/uucp/common_sources/prot.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char prot_rcsid[] = "$Id: prot.c,v 1.30 1994/04/14 03:07:56 ian Rel $";
+const char prot_rcsid[] = "$Id: prot.c,v 1.32 1995/06/21 19:15:07 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/common_sources/prot.h b/gnu/libexec/uucp/common_sources/prot.h
index 07dc620..11c3941 100644
--- a/gnu/libexec/uucp/common_sources/prot.h
+++ b/gnu/libexec/uucp/common_sources/prot.h
@@ -1,7 +1,7 @@
/* prot.h
Protocol header file.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
/* We need the definition of uuconf_cmdtab to declare the protocol
@@ -234,11 +234,13 @@ extern boolean fiwait P((struct sdaemon *qdaemon));
/* Prototypes for 'j' protocol functions. The 'j' protocol mostly
uses the 'i' protocol functions, but it has a couple of functions
of its own. */
+
extern boolean fjstart P((struct sdaemon *qdaemon, char **pzlog));
extern boolean fjshutdown P((struct sdaemon *qdaemon));
/* Prototypes for 'a' protocol functions (these use 'z' as the second
character because 'a' is a modified Zmodem protocol). */
+
extern struct uuconf_cmdtab asZproto_params[];
extern boolean fzstart P((struct sdaemon *qdaemon, char **pzlog));
extern boolean fzshutdown P((struct sdaemon *qdaemon));
@@ -251,3 +253,18 @@ extern boolean fzwait P((struct sdaemon *qdaemon));
extern boolean fzfile P((struct sdaemon *qdaemon, struct stransfer *qtrans,
boolean fstart, boolean fsend, long cbytes,
boolean *pfhandled));
+
+/* Prototypes for 'y' protocol functions. */
+
+extern struct uuconf_cmdtab asYproto_params[];
+extern boolean fystart P((struct sdaemon *qdaemon, char **pzlog));
+extern boolean fyshutdown P((struct sdaemon *qdaemon));
+extern boolean fysendcmd P((struct sdaemon *qdaemon, const char *z,
+ int ilocal, int iremote));
+extern char *zygetspace P((struct sdaemon *qdaemon, size_t *pcdata));
+extern boolean fysenddata P((struct sdaemon *qdaemon, char *z, size_t c,
+ int ilocal, int iremote, long ipos));
+extern boolean fywait P((struct sdaemon *qdaemon));
+extern boolean fyfile P((struct sdaemon *qdaemon, struct stransfer *qtrans,
+ boolean fstart, boolean fsend, long cbytes,
+ boolean *pfhandled));
diff --git a/gnu/libexec/uucp/common_sources/sysdep.h b/gnu/libexec/uucp/common_sources/sysdep.h
index 41dcecd..8b7e279 100644
--- a/gnu/libexec/uucp/common_sources/sysdep.h
+++ b/gnu/libexec/uucp/common_sources/sysdep.h
@@ -1,7 +1,7 @@
/* sysh.unx -*- C -*-
The header file for the UNIX system dependent routines.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#ifndef SYSH_UNX_H
@@ -228,6 +228,9 @@ typedef struct termios sterminal;
/* The name of the directory to which we move corrupt files. */
#define CORRUPTDIR ".Corrupt"
+/* The name of the directory to which we move failed execution files. */
+#define FAILEDDIR ".Failed"
+
/* The length of the sequence number used in a file name. */
#define CSEQLEN (4)
@@ -471,6 +474,14 @@ extern boolean fsdo_unlock P((const char *, boolean fspooldir));
extern boolean fsuser_access P((const struct stat *, int imode,
const char *zuser));
+/* Switch to the permissions of the invoking user. This sets the
+ argument to a value to pass to fsuucp_perms. */
+extern boolean fsuser_perms P((uid_t *));
+
+/* Switch back to the permissions of the UUCP user ID. This should be
+ passed the value returned by fsuser_perms in its argument. */
+extern boolean fsuucp_perms P((long));
+
/* Stick two directories and a file name together. */
extern char *zsappend3 P((const char *zdir1, const char *zdir2,
const char *zfile));
diff --git a/gnu/libexec/uucp/common_sources/system.h b/gnu/libexec/uucp/common_sources/system.h
index 9765edf..5fcc525 100644
--- a/gnu/libexec/uucp/common_sources/system.h
+++ b/gnu/libexec/uucp/common_sources/system.h
@@ -2,7 +2,7 @@
Header file for system dependent stuff in the Taylor UUCP package.
This file is not itself system dependent.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -18,10 +18,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#ifndef SYSTEM_H
@@ -343,6 +343,12 @@ extern const char *zsysdep_save_temp_file P((pointer pseq));
the move failed (in which the original file should remain). */
extern char *zsysdep_save_corrupt_file P((const char *zfile));
+/* Save a file in a location used to hold failed execution files.
+ This is called if a uuxqt execution fails. This should return the
+ new name of the file (allocated by zbufalc), or NULL if the move
+ failed (in which case the original file should remain). */
+extern char *zsysdep_save_failed_file P((const char *zfile));
+
/* Cleanup anything left over by fsysdep_get_work_init and
fsysdep_get_work. This may be called even though
fsysdep_get_work_init has not been. */
@@ -461,6 +467,11 @@ extern boolean fsysdep_change_mode P((const char *zfile,
closing the original file, removing it and reopening it. This
should return FALSE on error. */
extern openfile_t esysdep_truncate P((openfile_t e, const char *zname));
+
+/* Sync a file to disk. If this fails it should log an error using
+ the zmsg parameter, and return FALSE. This is controlled by the
+ FSYNC_ON_CLOSE macro in policy.h. */
+extern boolean fsysdep_sync P((openfile_t e, const char *zmsg));
/* It is possible for the acknowledgement of a received file to be
lost. The sending system will then now know that the file was
@@ -557,19 +568,25 @@ extern char *zsysdep_xqt_file_name P((void));
/* Beginning getting execute files. To get a list of execute files,
first fsysdep_get_xqt_init is called, then zsysdep_get_xqt is
called several times until it returns NULL, then finally
- usysdep_get_xqt_free is called. */
-extern boolean fsysdep_get_xqt_init P((void));
+ usysdep_get_xqt_free is called. If the zsystem argument is not
+ NULL, it is the name of a system for which execution files are
+ desired. */
+extern boolean fsysdep_get_xqt_init P((const char *zsystem));
/* Get the next execute file. This should return NULL when finished
- (with *pferr set to FALSE). On an error this should return NULL
- with *pferr set to TRUE. This should set *pzsystem to the name of
- the system for which the execute file was created. Both the return
- value and *pzsystem should be freed using ubuffree. */
-extern char *zsysdep_get_xqt P((char **pzsystem,
+ (with *pferr set to FALSE). The zsystem argument should be the
+ same string as that passed to fsysdep_get_xqt_init. On an error
+ this should return NULL with *pferr set to TRUE. This should set
+ *pzsystem to the name of the system for which the execute file was
+ created; this is not guaranteed to match the zsystem argument--that
+ must be double checked by the caller. Both the return value and
+ *pzsystem should be freed using ubuffree. */
+extern char *zsysdep_get_xqt P((const char *zsystem, char **pzsystem,
boolean *pferr));
-/* Clean up after getting execute files. */
-extern void usysdep_get_xqt_free P((void));
+/* Clean up after getting execute files. The zsystem argument should
+ be the same string as that passed to fsysdep_get_xqt_init. */
+extern void usysdep_get_xqt_free P((const char *zsystem));
/* Get the absolute pathname of a command to execute. This is given
the legal list of commands (which may be the special case "ALL")
diff --git a/gnu/libexec/uucp/common_sources/trans.h b/gnu/libexec/uucp/common_sources/trans.h
index 93aee2e..d057ab2 100644
--- a/gnu/libexec/uucp/common_sources/trans.h
+++ b/gnu/libexec/uucp/common_sources/trans.h
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
/* The maximum possible number of channels. */
diff --git a/gnu/libexec/uucp/common_sources/util.c b/gnu/libexec/uucp/common_sources/util.c
index 78a9455..21dbebc 100644
--- a/gnu/libexec/uucp/common_sources/util.c
+++ b/gnu/libexec/uucp/common_sources/util.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char util_rcsid[] = "$Id: util.c,v 1.6 1994/01/30 20:59:40 ian Rel $";
+const char util_rcsid[] = "$Id: util.c,v 1.8 1995/06/21 19:16:18 ian Rel $";
#endif
#include <ctype.h>
diff --git a/gnu/libexec/uucp/common_sources/uuconf.h b/gnu/libexec/uucp/common_sources/uuconf.h
index cb6dbb6..48cf9cd 100644
--- a/gnu/libexec/uucp/common_sources/uuconf.h
+++ b/gnu/libexec/uucp/common_sources/uuconf.h
@@ -1,7 +1,7 @@
/* uuconf.h
Header file for UUCP configuration routines.
- Copyright (C) 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,7 +17,7 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The use of an object file which uses material from this header
file, and from no other portion of the uuconf library, is
@@ -26,7 +26,7 @@
informative, and does not modify the License in any way).
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#ifndef UUCONF_H
@@ -206,6 +206,12 @@ struct uuconf_system
other system should transfer at that time. May be NULL, in which
case there are no grade restrictions. */
struct uuconf_timespan *uuconf_qcalltimegrade;
+ /* The times at which to allow a particular grade of work to be
+ transferred to the system, when it calls in. The ival field of
+ each uuconf_timespan structure is the lowest grade which should
+ be transferred at that time. May be NULL, in which case there
+ are no grade restrictions. */
+ struct uuconf_timespan *uuconf_qcalledtimegrade;
/* The maximum number of times to retry calling this system. If
this is 0, there is no limit. */
int uuconf_cmax_retries;
@@ -565,6 +571,10 @@ struct uuconf_dialer
be b1 - b2. */
#define UUCONF_GRADE_CMP(b1, b2) (uuconf_grade_cmp ((b1), (b2)))
+/* Definitions for bits returned by uuconf_strip. */
+#define UUCONF_STRIP_LOGIN (01)
+#define UUCONF_STRIP_PROTO (02)
+
/* uuconf_runuuxqt returns either a positive number (the number of
execution files to receive between uuxqt invocations) or one of
these constant values. */
@@ -871,6 +881,11 @@ extern int uuconf_debugfile (void *uuconf_pglobal,
extern int uuconf_debuglevel (void *uuconf_pglobal,
const char **uuconf_pzdebug);
+/* Get a combination of UUCONF_STRIP bits indicating what types of
+ global information should be stripped on input. */
+extern int uuconf_strip (void *uuconf_pglobal,
+ int *uuconf_pistrip);
+
/* Get the maximum number of simultaneous uuxqt executions. This will
set *pcmaxuuxqt to the number. Zero indicates no maximum. */
extern int uuconf_maxuuxqts (void *uuconf_pglobal,
diff --git a/gnu/libexec/uucp/common_sources/uucp.h b/gnu/libexec/uucp/common_sources/uucp.h
index 5faa63c..4636910 100644
--- a/gnu/libexec/uucp/common_sources/uucp.h
+++ b/gnu/libexec/uucp/common_sources/uucp.h
@@ -1,7 +1,7 @@
/* uucp.h
Header file for the UUCP package.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
/* Get the system configuration parameters. */
@@ -78,10 +78,7 @@
typedef SIG_ATOMIC_T sig_atomic_t;
#endif /* ! HAVE_SIG_ATOMIC_T_IN_SIGNAL_H && ! HAVE_SIG_ATOMIC_T_IN_TYPES_H */
-/* Make sure we have size_t. We use int as the default because the
- main use of this type is to provide an argument to malloc and
- realloc. On a system which does not define size_t, int is
- certainly the correct type to use. */
+/* Make sure we have size_t. */
#if ! HAVE_SIZE_T_IN_STDDEF_H && ! HAVE_SIZE_T_IN_TYPES_H
#ifndef SIZE_T
#define SIZE_T unsigned
@@ -220,8 +217,8 @@ typedef FILE *openfile_t;
#define ffileisopen(e) ((e) != NULL)
#define ffileeof(e) feof (e)
#define cfileread(e, z, c) fread ((z), 1, (c), (e))
-#define ffilereaderror(e, c) ferror (e)
#define cfilewrite(e, z, c) fwrite ((z), 1, (c), (e))
+#define ffileioerror(e, c) ferror (e)
#ifdef SEEK_SET
#define ffileseek(e, i) (fseek ((e), (long) (i), SEEK_SET) == 0)
#define ffilerewind(e) (fseek ((e), (long) 0, SEEK_SET) == 0)
@@ -236,33 +233,48 @@ typedef FILE *openfile_t;
#endif
#define ffileclose(e) (fclose (e) == 0)
+#define fstdiosync(e, z) (fsysdep_sync (e, z))
+
#else /* ! USE_STDIO */
+#if ! USE_TYPES_H
+#undef USE_TYPES_H
+#define USE_TYPES_H 1
+#include <sys/types.h>
+#endif
+
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef OFF_T
+typedef OFF_T off_t;
+#undef OFF_T
+#endif
+
typedef int openfile_t;
#define EFILECLOSED (-1)
#define ffileisopen(e) ((e) >= 0)
#define ffileeof(e) (FALSE)
#define cfileread(e, z, c) read ((e), (z), (c))
-#define ffilereaderror(e, c) ((c) < 0)
#define cfilewrite(e, z, c) write ((e), (z), (c))
+#define ffileioerror(e, c) ((c) < 0)
#ifdef SEEK_SET
-#define ffileseek(e, i) (lseek ((e), (long) i, SEEK_SET) >= 0)
-#define ffilerewind(e) (lseek ((e), (long) 0, SEEK_SET) >= 0)
+#define ffileseek(e, i) (lseek ((e), (off_t) i, SEEK_SET) >= 0)
+#define ffilerewind(e) (lseek ((e), (off_t) 0, SEEK_SET) >= 0)
#else
-#define ffileseek(e, i) (lseek ((e), (long) i, 0) >= 0)
-#define ffilerewind(e) (lseek ((e), (long) 0, 0) >= 0)
+#define ffileseek(e, i) (lseek ((e), (off_t) i, 0) >= 0)
+#define ffilerewind(e) (lseek ((e), (off_t) 0, 0) >= 0)
#endif
#ifdef SEEK_END
-#define ffileseekend(e) (lseek ((e), (long) 0, SEEK_END) >= 0)
+#define ffileseekend(e) (lseek ((e), (off_t) 0, SEEK_END) >= 0)
#else
-#define ffileseekend(e) (lseek ((e), (long) 0, 2) >= 0)
+#define ffileseekend(e) (lseek ((e), (off_t) 0, 2) >= 0)
#endif
#define ffileclose(e) (close (e) >= 0)
+#define fstdiosync(e, z) (fsysdep_sync (fileno (e), z))
+
#endif /* ! USE_STDIO */
/* A prototype for main to avoid warnings from gcc 2.0
diff --git a/gnu/libexec/uucp/common_sources/uudefs.h b/gnu/libexec/uucp/common_sources/uudefs.h
index f957ee6..2b45502 100644
--- a/gnu/libexec/uucp/common_sources/uudefs.h
+++ b/gnu/libexec/uucp/common_sources/uudefs.h
@@ -1,7 +1,7 @@
/* uudefs.h
Miscellaneous definitions for the UUCP package.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#if ANSI_C
@@ -93,6 +93,9 @@ struct sstatus
long ilast;
/* Number of seconds until a retry is permitted. */
int cwait;
+ /* String in status file. Only used when reading status file, not
+ when writing. May be NULL. Should be freed with ubuffree. */
+ char *zstring;
};
/* How long we have to wait for the next call, given the number of retries
@@ -323,7 +326,7 @@ extern void ulog_close P((void));
extern void ustats P((boolean fsucceeded, const char *zuser,
const char *zsystem, boolean fsent,
long cbytes, long csecs, long cmicros,
- boolean fmaster));
+ boolean fcaller));
/* Close the statistics file. */
extern void ustats_close P((void));
@@ -349,11 +352,13 @@ extern int idebug_parse P((const char *));
/* Copy one file to another. */
extern boolean fcopy_file P((const char *zfrom, const char *zto,
- boolean fpublic, boolean fmkdirs));
+ boolean fpublic, boolean fmkdirs,
+ boolean fsignals));
/* Copy an open file to another. */
extern boolean fcopy_open_file P((openfile_t efrom, const char *zto,
- boolean fpublic, boolean fmkdirs));
+ boolean fpublic, boolean fmkdirs,
+ boolean fsignals));
/* Translate escape sequences in a buffer, leaving the result in the
same buffer and returning the length. */
diff --git a/gnu/libexec/uucp/contrib/amiga.c b/gnu/libexec/uucp/contrib/amiga.c
index ef2a5cb..d982364 100644
--- a/gnu/libexec/uucp/contrib/amiga.c
+++ b/gnu/libexec/uucp/contrib/amiga.c
@@ -1,10 +1,10 @@
/* Wrapper code for Taylor UUCP on Amiga Unix (SVR4) for cron invoked UUCP */
/* processes. */
-/* The problem: Cron is not a "licensed" process. any process that grabs a
+/* The problem: Cron is not a "licensed" process. any process that grabs a
controlling terminal needs to be licensed. Taylor UUCP needs controlling
- terminals. Taylor UUCP does relinquish the controlling terminal before
- fork(), so the "UUCP" license is appropriate.
+ terminals. Taylor UUCP does relinquish the controlling terminal before
+ fork(), so the "UUCP" license is appropriate.
This simple program does the "right" thing, but *MUST* be SETUID ROOT */
/* Written by: Lawrence E. Rosenman <ler@lerami.lerctr.org> */
@@ -36,7 +36,7 @@ int main(int argc,char *argv[],char *envp)
exit(1);
}
setgid(pw->pw_gid); /* set gid to uucp */
- setuid(pw->pw_uid); /* set uid to uucp */
+ setuid(pw->pw_uid); /* set uid to uucp */
argv[0]=name; /* have PS not lie... */
execv("/usr/local/lib/uucp/uucico",argv); /* go to the real program */
exit(errno);
diff --git a/gnu/libexec/uucp/contrib/dialHDB.c b/gnu/libexec/uucp/contrib/dialHDB.c
index 8650ff0..cb26621 100644
--- a/gnu/libexec/uucp/contrib/dialHDB.c
+++ b/gnu/libexec/uucp/contrib/dialHDB.c
@@ -86,7 +86,7 @@ main(int argc,char *argv[])
int child; /* pid of child process */
int stat; /* exit status of child process */
char *temp; /* used to get basename of dialer */
-
+
if(argc!=5)
{
fprintf(stderr,kUsage,argv[0],argv[0]);
@@ -95,9 +95,9 @@ main(int argc,char *argv[])
dialerPath=argv[1];
dialerName= (temp=strrchr(argv[1],'/'))!=NULL ? temp+1 : argv[1];
-
+
parent=getpid();
-
+
signal(SIGUSR1,badExec); /* set up for possible failed exec */
if((child=fork())<0)
@@ -111,7 +111,7 @@ main(int argc,char *argv[])
signal(SIGHUP,SIG_IGN);
signal(SIGINT,SIG_IGN);
signal(SIGTERM,SIG_IGN);
-
+
wait(&stat); /* wait for child to exit */
exit(figureStat(stat)); /* figure out our exit code and die */
}
@@ -125,7 +125,7 @@ main(int argc,char *argv[])
kill(parent,SIGUSR1);
exit(0);
}
- }
+ }
exit(0);
}
@@ -136,7 +136,7 @@ int figureStat(int stat)
int exit;
int errFlag;
int error;
-
+
if(WIFSIGNALED(stat)) /* determine if exit was from signal or what */
{
fprintf(stderr,"Error: Dialer %s recieved signal %d.\n",dialerName,
diff --git a/gnu/libexec/uucp/contrib/uuclean b/gnu/libexec/uucp/contrib/uuclean
index e9c631c..1cfb633 100644
--- a/gnu/libexec/uucp/contrib/uuclean
+++ b/gnu/libexec/uucp/contrib/uuclean
@@ -21,3 +21,5 @@ find $(spooldir) -ctime +8 -name '[CDX].*' -print -exec rm -f \{\} \;
find $(spooldir) -atime +1 -ctime +1 -name 'TM.*' -print -exec rm -f \{\} \;
# Delete any old preserved files
find $(spooldir)/.Preserve -atime +14 -ctime +14 -print -exec rm -f \{\} \;
+# Delete any old failed execution files
+find $(spooldir)/.Failed -atime +14 -ctime +14 -print -exec rm -f \{\} \;
diff --git a/gnu/libexec/uucp/contrib/uurate.c b/gnu/libexec/uucp/contrib/uurate.c
index c625d4b..907e242 100644
--- a/gnu/libexec/uucp/contrib/uurate.c
+++ b/gnu/libexec/uucp/contrib/uurate.c
@@ -44,7 +44,7 @@
* - redesigned the printed layout (sticked to those 80 column tubes).
* - 'Retry time not ...' and ' ERROR: All matching ports ...' will now be
* counted as calls and will raise the failed-call counter.
- * - times now shown as hh:mm:ss; the fields may hold up to 999 hrs
+ * - times now shown as hh:mm:ss; the fields may hold up to 999 hrs
* (a month equals 744 hrs at max). Printing will be as follows:
*
* hrs > 0 hh:mm:ss
@@ -52,7 +52,7 @@
* sec > 0 ss
* leading zeroes are suppressed.
*
- * - the bytes xfered will be given in thousands only (we're counting
+ * - the bytes xfered will be given in thousands only (we're counting
* so 1K is 1000 bytes!). Sums up to 9,999,999.9 thousand can be shown.
* - dropped the fractions of a byte in columns: bytes/second (avg cps).
* - File statistic changed to display in/out in one row instead of 2
@@ -60,7 +60,7 @@
* - eliminated the goto in command report and tightened the code; also
* the 'goto usage' has been replaced by a call to void usage() with no
* return (exit 1).
- * - a totaling is done for all reports now; the total values are held
+ * - a totaling is done for all reports now; the total values are held
* within the structure; after finishing read there will be an alloc
* for a site named 'Total' so that the totals line will be printed
* more or less automatically.
@@ -84,9 +84,6 @@
* get knowledge of
*/
/* $Log: uurate.c,v $
- * Revision 1.2 1994/05/07 18:09:35 ache
- * Upgrade to version 1.05
- *
* Revision 1.15 1994/04/07 21:47:11 kdburg
* printed 'no data avail' while there was data; layout chnaged
* (cosmetic only)
@@ -142,12 +139,15 @@
* */
char version[] = "@(#) Taylor UUCP Log File Summary Filter, Version 1.2.2";
-static char rcsid[] = "$Id: uurate.c,v 1.2 1994/05/07 18:09:35 ache Exp $";
+static char rcsid[] = "$Id: uurate.c,v 1.15 1994/04/07 21:47:11 kdburg Rel $";
#include <ctype.h> /* Character Classification */
#include <math.h>
#include "uucp.h"
/* uucp.h includes string.h or strings.h, no include here. */
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
#define _DEBUG_ 0
@@ -291,7 +291,7 @@ int main(argc, argv)
char *argv[];
{
FILE *Log = NULL;
- int c;
+ int c;
char *p, *s, *stt, *flq = NULL;
char Hostname[MAXHOSTNAMELEN]; /* def taken from <sys/param.h> */
char Filename[15]; /* filename to be printed */
@@ -321,7 +321,7 @@ int main(argc, argv)
else
strcpy(Pgm_name,argv[0]);
def_logs[0] = Pgm_name;
-
+
/*
* I wish the compiler had the #error directive!
*/
@@ -348,7 +348,7 @@ int main(argc, argv)
Tstat = (char *)getmem(sizeof(STATFILE));
Tlog = LOGFILE;
Tstat = STATFILE;
-
+
/*
* Process the command line arguments
*/
@@ -426,8 +426,8 @@ int main(argc, argv)
/*
* If further args present, Assume rest are logfiles for us to process
* which should be given in pairs (log plus stat) otherwise the results may
- * not come out as expected! If no further args are present take input from
- * Log and Stat files provided in the compilation environment of Taylor UUCP.
+ * not come out as expected! If no further args are present take input from
+ * Log and Stat files provided in the compilation environment of Taylor UUCP.
* If -i was given, Log already points to stdin and no file args are accepted.
*/
@@ -457,7 +457,7 @@ int main(argc, argv)
else /* Read from current logs */
{
def_logs[1] = Tlog; /* prime the */
- def_logs[2] = Tstat; /* file names */
+ def_logs[2] = Tstat; /* file names */
if (! be_quiet)
printf(" Config for this run: ");
@@ -483,7 +483,7 @@ int main(argc, argv)
printf("%s\n",noConf);
}
def_logs[1] = Tlog; /* final setting of */
- def_logs[2] = Tstat; /* file names */
+ def_logs[2] = Tstat; /* file names */
argv = def_logs; /* Bash argvec to log/stat files */
argc = sizeof(def_logs) / sizeof(def_logs[0]);
}
@@ -517,7 +517,7 @@ int main(argc, argv)
strncpy(Filename,argv[1],sizeof(Filename)-1);
else
strncpy(Filename,++flq,sizeof(Filename)-1);
-
+
strcpy(in_date," n/a");
strcpy(in_time," n/a");
p_done = FALSE; /* no info printed yet */
@@ -546,7 +546,7 @@ int main(argc, argv)
if (NULL != (stt = strchr(p, '(')))
{
if (! p_done && ! use_stdin && ! be_quiet)
- {
+ {
#if HAVE_TAYLOR_LOGGING
sscanf(++stt,"%s%*c%[^.]",in_date,in_time);
@@ -589,7 +589,7 @@ int main(argc, argv)
* transfer record, determine the direction. If not then
* skip the line if it is not interesting.
*/
-
+
if ((s = strchr(++s, ')')) == NULL)
continue;
@@ -599,7 +599,7 @@ int main(argc, argv)
if ((s = strchr(++s, ')')) == NULL)
continue; /* yes but strange layout */
#endif /* HAVE_V2_LOGGING */
-#endif /* ! HAVE_TAYLOR_LOGGING */
+#endif /* ! HAVE_TAYLOR_LOGGING */
logmsg = s + 2; /* Message is 2 characters after ')' */
if ((0 != strncmp(logmsg, "Call complete", 13)) &&
@@ -654,8 +654,8 @@ int main(argc, argv)
last->next = cur;
break;
}
- } /* while (e != NULL) */
- } /* hosts == NULL */
+ } /* while (e != NULL) */
+ } /* hosts == NULL */
} /* cur == NULL */
}
@@ -771,7 +771,7 @@ int main(argc, argv)
/*
* Handle end of call. Pick up the connect time.
* position is on the closing paren of date/time info
- * i.e: ) text....
+ * i.e: ) text....
*/
if (0 == strncmp(logmsg, "Call complete", 13))
@@ -798,7 +798,7 @@ int main(argc, argv)
if (0 == strncmp(logmsg, "failed after ",13))
logmsg += 13; /* the transmission failed for any reason */
/* so advance pointer */
- if (0 == strncmp(logmsg, "sent", 4))
+ if (0 == strncmp(logmsg, "sent", 4))
sent = OUT;
else if (0 == strncmp(logmsg, "received", 8))
sent = IN;
@@ -824,7 +824,7 @@ int main(argc, argv)
} /* end of while (fgets(logline...)) */
if (stt != NULL && ! use_stdin && ! be_quiet && ! no_records)
- {
+ {
#if HAVE_TAYLOR_LOGGING
sscanf(dt_info,"%s%*c%[^.]",in_date,in_time);
@@ -851,7 +851,7 @@ int main(argc, argv)
{
if (! be_quiet && no_records)
printf(" %-14s %10s\n",Filename, " is empty ");
- }
+ }
}
fclose(Log);
@@ -898,11 +898,11 @@ int main(argc, argv)
tot->call[OUT].flow[IN].files += cur->call[OUT].flow[IN].files;
tot->call[IN].flow[OUT].files += cur->call[IN].flow[OUT].files;
tot->call[OUT].flow[OUT].files += cur->call[OUT].flow[OUT].files;
- tot->call[OUT].succs += cur->call[OUT].succs;
- tot->call[OUT].calls += cur->call[OUT].calls;
+ tot->call[OUT].succs += cur->call[OUT].succs;
+ tot->call[OUT].calls += cur->call[OUT].calls;
tot->call[OUT].connect_time += cur->call[OUT].connect_time;
- tot->call[IN].succs += cur->call[IN].succs;
- tot->call[IN].calls += cur->call[IN].calls;
+ tot->call[IN].succs += cur->call[IN].succs;
+ tot->call[IN].calls += cur->call[IN].calls;
tot->call[IN].connect_time += cur->call[IN].connect_time;
}
}
@@ -984,7 +984,7 @@ int main(argc, argv)
cur->Hostname, rf, sf,
t1, t2, t3, t4, t5,
ir, or);
- }
+ }
if (! hdr_done)
{
puts("\n(I) No data found to print Compact summary report");
@@ -1080,7 +1080,7 @@ int main(argc, argv)
prot->pr_eorder,
prot->pr_ereject);
type = NULL;
- }
+ }
}
}
}
@@ -1174,7 +1174,7 @@ int main(argc, argv)
{
char t1[32], t2[32];
double rate = 0, time = 0;
- int b = 0;
+ int b = 0;
int lineOut = 0;
hdr_done = FALSE;
@@ -1182,7 +1182,7 @@ int main(argc, argv)
{
lineOut = 0;
for (sent= IN; sent <= OUT; ++sent)
- {
+ {
b = cur->call[IN].flow[sent].bytes +
cur->call[OUT].flow[sent].bytes;
time = cur->call[IN].flow[sent].time +
@@ -1218,7 +1218,7 @@ int main(argc, argv)
t1, t2, rate);
lineOut = 1;
}
- } /* end: for (sent ... ) */
+ } /* end: for (sent ... ) */
if (lineOut)
printf("\n");
} /* end: for (cur= ... ) */
@@ -1266,7 +1266,7 @@ int main(argc, argv)
hdr_done = TRUE;
}
- flow = cur->call[IN].flow[IN].time +
+ flow = cur->call[IN].flow[IN].time +
cur->call[IN].flow[OUT].time +
cur->call[OUT].flow[IN].time +
cur->call[OUT].flow[OUT].time;
@@ -1299,12 +1299,12 @@ int main(argc, argv)
*/
if (show_commands || show_all)
- {
+ {
if (have_commands)
{
int ncmds, i, match;
- /*
+ /*
* layout the header line. The column's header is the command name
*/
@@ -1334,7 +1334,7 @@ int main(argc, argv)
fputs(" ------", stdout);
putchar('\n');
- /*
+ /*
* print out the number of executions for each host/command
*/
@@ -1356,7 +1356,7 @@ int main(argc, argv)
for(ec= cur->cmds; ec != NULL; ec= ec->next)
{
if ( 0 == strcmp(cmd->Commandname, ec->Commandname) )
- {
+ {
printf(" %7d", ec->count);
match = TRUE;
break;
@@ -1369,7 +1369,7 @@ int main(argc, argv)
}
/*
- * print the totals line
+ * print the totals line
*/
fputs(" --------", stdout);
@@ -1405,7 +1405,7 @@ int main(argc, argv)
*/
/* ------------------------------------------------------------------
- * display the help
+ * display the help
* ------------------------------------------------------------------
*/
@@ -1647,7 +1647,7 @@ int chk_config(char *T_conf,int be_quiet, int type)
fprintf(stderr,"%s (C) ended due to errors\n",
Pgm_name);
return (8);
- }
+ }
}
}
else
diff --git a/gnu/libexec/uucp/contrib/uusnap.c b/gnu/libexec/uucp/contrib/uusnap.c
index f94078b..123741c 100644
--- a/gnu/libexec/uucp/contrib/uusnap.c
+++ b/gnu/libexec/uucp/contrib/uusnap.c
@@ -12,7 +12,7 @@
compile it form the Makefile or:
cc -c -g -pipe -O -I. -I. -DNEWCONFIGLIB=\"/usr/local/lib/uucp\" uusnap.c
- cc -o uusnap uusnap.o
+ cc -o uusnap uusnap.o
For this, uusnap.[ch] must be in the same directory as uucp.h and so.
uusnap must have read access to SPOOLDIR/.Status in order to work.
@@ -25,7 +25,7 @@
#include "uucp.h"
#if USE_RCS_ID
-char uusnap_rcsid[] = "$Id: uusnap.c,v 1.2 1994/05/07 18:09:40 ache Exp $";
+char uusnap_rcsid[] = "$Id: uusnap.c,v 1.9 92/05/05 22:51:50 hwr Exp Locker: hwr $";
#endif
#include <ctype.h>
@@ -50,7 +50,7 @@ struct sysInfo {
int num_retries; /* number of retries */
};
-struct sysInfo Systems[MAXSYS];
+struct sysInfo Systems[MAXSYS];
/* I have extend the system status. If time for the specified system
@@ -77,7 +77,7 @@ main()
int i;
i=get_systems();
display_info(i);
-
+
exit(0);
}
@@ -115,7 +115,7 @@ get_systems()
get_stat_for_system(i); /* now get the system status */
get_inq_num(i,TRUE); /* number of unprocessed files */
get_outq_num(i,TRUE); /* number of files to send */
- i++;
+ i++;
}
fclose(fp);
}
@@ -126,7 +126,7 @@ get_systems()
return i;
}
-
+
display_info(int numSys)
{
@@ -144,7 +144,7 @@ display_info(int numSys)
fprintf(stderr, "Can't malloc 1024 bytes");
exit(1);
}
-
+
while(TRUE) {
display_headline();
for (sysnum=0;sysnum<numSys;sysnum++) {
@@ -170,21 +170,21 @@ int
display_status_line(int sn)
{
char *time_s;
-
+
int sys_stat,num_retries,wait;
int i;
time_t last_time;
time_t next_time;
-
+
struct sysInfo sys;
-
+
sys = Systems[sn];
printf("%10s ",sys.sysname);
get_inq_num(sn);
if (sys.in==0)
printf(" ");
- else
+ else
printf("%3d ",sys.in);
get_outq_num(sn);
if (sys.out==0)
@@ -198,13 +198,13 @@ display_status_line(int sn)
time_s = ctime(&sys.next);
time_s = time_s + 11;
*(time_s+8)='\0';
- if (sys.last == sys.next)
+ if (sys.last == sys.next)
printf(" ");
else
printf("%8s ",time_s); /* time of next poll */
- if (sys.num_retries==0)
+ if (sys.num_retries==0)
printf(" ");
- else
+ else
printf("%2d ",sys.num_retries);
if (sys_stat==6) /* system is talking */
printf("\E[7m"); /* reverse video on */
@@ -234,7 +234,7 @@ get_inq_num(int num,char firstTime)
char filename[1024];
struct stat stbuf;
DIR *dirp;
-
+
strcpy(filename,Systems[num].spooldir);
strcat(filename,"/X./.");
stat(filename,&stbuf);
@@ -263,7 +263,7 @@ get_outq_num(int sys,char firstTime)
char filename[1024];
struct stat stbuf;
DIR *dirp;
-
+
strcpy(filename,Systems[sys].spooldir);
strcat(filename,"/C./.");
stat(filename,&stbuf);
diff --git a/gnu/libexec/uucp/contrib/uutraf b/gnu/libexec/uucp/contrib/uutraf
index 9625ea5..00e4b03 100644
--- a/gnu/libexec/uucp/contrib/uutraf
+++ b/gnu/libexec/uucp/contrib/uutraf
@@ -197,7 +197,7 @@ sub print_dashes {
sub gethostname {
$ENV{"SHELL"} = "/bin/sh";
- $try = `hostname 2>/dev/null`;
+ $try = `(hostname) 2>/dev/null`;
chop $try;
return $+ if $try =~ /^[-.\w]+$/;
$try = `uname -n 2>/dev/null`;
diff --git a/gnu/libexec/uucp/contrib/uutry b/gnu/libexec/uucp/contrib/uutry
index bc0cf29..258bb30 100644
--- a/gnu/libexec/uucp/contrib/uutry
+++ b/gnu/libexec/uucp/contrib/uutry
@@ -15,10 +15,10 @@
# files rather then being hard coded here.
#
Spool=/usr/spool/uucp
-Lib=/usr/lib/uucp
+Lib=/usr/local/lib/uucp
Status=$Spool/.Status
Debug=$Spool/Debug
-Uucico=$lib/uucico
+Uucico=$Lib/uucico
#
# Default option values
#
@@ -32,7 +32,7 @@ for i in $* ; do
esac
done
-if [ $s != "" ]; then
+if [ x$s != x ]; then
rm -f $Status/$s
$Uucico -r1 $x -s$s &
>$Debug
diff --git a/gnu/libexec/uucp/contrib/xchat.c b/gnu/libexec/uucp/contrib/xchat.c
index 9e87f7c..b44549e 100644
--- a/gnu/libexec/uucp/contrib/xchat.c
+++ b/gnu/libexec/uucp/contrib/xchat.c
@@ -21,7 +21,7 @@
* for timed reads. Use Taylor UUCP "conf.h" file to set
* configuration for this program. Add defaulting of script
* and log file paths.
- *
+ *
* Daniel Hagerty - Mon Nov 22 18:17:38 1993
* V1.2 - Added a new opcode to xchat. "expectstr" is a cross between
* sendstr and expect, looking for a parameter supplied string.
@@ -43,7 +43,7 @@
#include "xc-conf.h"
-/*
+/*
* Pick a timing routine to use, as done in Taylor UUCP.
*/
#if HAVE_USLEEP || HAVE_NAP || HAVE_NAPMS || HAVE_POLL
@@ -279,7 +279,7 @@ extern void *malloc();
* arguments in argc/argv, and stdin/stdout mapped to the
* tty device, and stderr mapped to the Taylor logfile, where
* anything written to stdout will be logged as an error.
- *
+ *
*/
int main(argc, argv)
int argc;
@@ -312,7 +312,7 @@ char *argv[];
/*
* If the script file argument begins with '/', then we assume
- * it is an absolute pathname, otherwise, we prepend the
+ * it is an absolute pathname, otherwise, we prepend the
* SCRIPT_DIR path.
*/
*sfname = '\0'; /* Empty name string */
@@ -375,7 +375,7 @@ char *argv[];
exit(stat);
}
-/*
+/*
* deal_script - deallocate a script and all strings it points to
*/
int deal_script(loc)
@@ -386,34 +386,34 @@ struct script *loc;
*/
if (loc == (struct script *)NULL)
return SUCCESS;
-
+
/*
* Deallocate the rest of the script
*/
deal_script(loc->next);
-
+
/*
* Deallocate the string parameter, if any
*/
if (loc->strprm != (char *)NULL)
free(loc->strprm);
-
+
/*
* Deallocate the new state name parameter, if any
*/
if (loc->newstate != (char *)NULL)
free(loc->newstate);
-
+
/*
* Deallocate this entry
*/
free(loc);
-
+
return SUCCESS;
}
-/*
+/*
* read_script
*
* Read & compile a script, return pointer to first entry, or null if bad
@@ -428,10 +428,10 @@ struct script *read_script(fd)
char inpline[MAX_SCLINE];
char inpcopy[MAX_SCLINE];
char *c, *cln, *opc, *cp;
-
+
/*
* MAIN COMPILATION LOOP
- */
+ */
while ((c = fgets(inpline, (sizeof inpline - 1), fd)) != (char *)NULL)
{
/*
@@ -439,13 +439,13 @@ struct script *read_script(fd)
*/
if (*c == '#' || *c == '\n')
continue;
-
- /*
+
+ /*
* Get rid of the trailing newline, and copy the string
*/
inpline[strlen(inpline)-1] = '\0';
strcpy(inpcopy, inpline);
-
+
/*
* Look for text starting in the first col (a label)
*/
@@ -467,7 +467,7 @@ struct script *read_script(fd)
this->newstate = (char *)NULL;
c = cln + 1;
}
-
+
/*
* Now handle the opcode. Fold it to lower case.
*/
@@ -477,14 +477,14 @@ struct script *read_script(fd)
cp = opc;
while(*cp)
tolower(*cp++);
-
- /*
+
+ /*
* If we have an opcode but we haven't seen anything
* else (like a label) yet, i.e., this is the first
- * entry, and there was no label. We need to
+ * entry, and there was no label. We need to
* cobble up a label so that read_script is happy
*/
- if (first == (struct script *)NULL)
+ if (first == (struct script *)NULL)
{
this = (struct script *)malloc (sizeof (struct script));
prev = this;
@@ -496,12 +496,12 @@ struct script *read_script(fd)
this->intprm = 0;
this->newstate = (char *)NULL;
}
-
- /*
+
+ /*
* Find opcode - ndex through the opcode definition table
*/
for (i=1; sc_opdef[i].opcode != SC_END; i++)
- if (strcmp(opc, sc_opdef[i].opname) == SAME)
+ if (strcmp(opc, sc_opdef[i].opname) == SAME)
break;
if ((sc_opdef[i].opcode) == SC_END)
{
@@ -509,7 +509,7 @@ struct script *read_script(fd)
deal_script(first);
return (struct script *)NULL;
}
-
+
/*
* Found opcode. Allocate a new command node and initialize
*/
@@ -521,8 +521,8 @@ struct script *read_script(fd)
this->strprm = (char *)NULL;
this->intprm = 0;
this->newstate = (char *)NULL;
-
- /*
+
+ /*
* Pick up new state parameter, if any
*/
if (sc_opdef[i].newstate == SC_NWST)
@@ -540,7 +540,7 @@ struct script *read_script(fd)
strcpy(this->newstate, c);
}
}
-
+
/*
* Pick up the string or integer parameter. Handle missing
* parameter gracefully.
@@ -572,8 +572,8 @@ struct script *read_script(fd)
/*
* STR/XSTR strings.
*/
- case SC_STR:
- case SC_XSTR:
+ case SC_STR:
+ case SC_XSTR:
c = strtok((char *)NULL, CTL_DELIM);
if (c == (char *)NULL)
{
@@ -597,9 +597,9 @@ struct script *read_script(fd)
/*
* For XSTR, Translate the string and store its
- * length. Note that, after escape sequences are
- * compressed, the resulting string may well be a
- * few bytes shorter than the input string (whose
+ * length. Note that, after escape sequences are
+ * compressed, the resulting string may well be a
+ * few bytes shorter than the input string (whose
* length was the basis for the malloc above),
* but it will never be longer.
*/
@@ -611,10 +611,10 @@ struct script *read_script(fd)
else
strcpy(this->strprm, c);
break;
-
+
}
}
-
+
/*
* EOF
*/
@@ -630,23 +630,23 @@ struct script *read_script(fd)
* Called by read_script(), above.
*
* Returns the actual length of the resulting string. Note that imbedded
- * nulls (specified by \000 in the input) ARE allowed in the result.
+ * nulls (specified by \000 in the input) ARE allowed in the result.
*/
xlat_str(out, in)
char *out, *in;
{
register int i = 0, j = 0;
int byte, k;
-
- while (in[i])
+
+ while (in[i])
{
- if (in[i] != '\\')
+ if (in[i] != '\\')
{
out[j++] = in[i++];
}
- else
+ else
{
- switch (in[++i])
+ switch (in[++i])
{
case 'd': /* EOT */
out[j++] = 0x04;
@@ -682,11 +682,11 @@ xlat_str(out, in)
case '7':
byte = in[i] - '0';
k = 0;
-
- while (3 > ++k)
+
+ while (3 > ++k)
if ((in[i+1] < '0') || (in[i+1] > '7'))
break;
- else
+ else
{
byte = (byte<<3) + in[i+1] - '0';
++i;
@@ -698,7 +698,7 @@ xlat_str(out, in)
}
++i;
}
- }
+ }
return j;
}
@@ -711,9 +711,9 @@ struct script *begin;
char *newstate;
{
struct script *here;
-
+
for (here=begin; here != (struct script *)NULL; here=here->next) {
- if (here->opcode == SC_LABEL &&
+ if (here->opcode == SC_LABEL &&
strcmp(here->strprm, newstate) == SAME)
return here;
}
@@ -721,8 +721,8 @@ char *newstate;
}
-/*
- * do_script() - execute a script
+/*
+ * do_script() - execute a script
*/
int do_script(begin)
struct script *begin;
@@ -734,7 +734,7 @@ int do_script(begin)
char *c, chr;
int prmlen;
int dbfd;
-
+
time_t sc_carrtime = 45000; /* time to wf carr after dial */
time_t sc_chrdly = 100; /* delay time for ttoslow */
time_t sc_ptime = 2000; /* time to allow for pause char */
@@ -746,118 +746,118 @@ int do_script(begin)
char sc_wchar = 'W'; /* modem wait-for-dialtone character */
time_t sc_begwait; /* time at beg of wait */
time_t sc_secs; /* timeout period */
-
+
int expcnt;
int expin;
static char expbuf[MAX_EXPCT];
-
+
dbgsave = Debug;
curstate = begin;
-
- if (curstate == (struct script *)NULL)
+
+ if (curstate == (struct script *)NULL)
return SUCCESS;
-
+
_newstate:
- /*
+ /*
* do all of curstate's actions. Enter with curstate pointing
* to a label entry
*/
expin = 0;
-
+
for (curscr = curstate->next; /* point to 1st scr after label */
(curscr != (struct script *)NULL) && /* do until end of scr */
(curscr->opcode != SC_LABEL); /* or next label */
- curscr = curscr->next)
+ curscr = curscr->next)
{
expcnt = 0;
- switch (curscr->opcode)
+ switch (curscr->opcode)
{
case SC_LABEL:
logit("Script proc err", curstate->strprm);
return FAIL;
-
+
case SC_FLSH:
DEBUG(DB_LGII, "Flushing typeahead buffer\n", 0);
ttflui();
break;
-
+
case SC_CDLY:
sc_chrdly = curscr->intprm;
DEBUG(DB_LGII, "Set chrdly to %d\n", sc_chrdly);
break;
-
+
case SC_PCHR:
sc_pchar = *(curscr->strprm);
DEBUG(DB_LGII, "Set pause char to %c\n", sc_pchar);
break;
-
+
case SC_PTIM:
sc_ptime = curscr->intprm;
DEBUG(DB_LGII, "Set pause time to %d\n", sc_ptime);
break;
-
+
case SC_WCHR:
sc_wchar = *(curscr->strprm);
DEBUG(DB_LGII, "Set wait char to %c\n", sc_wchar);
break;
-
+
case SC_WTIM:
sc_wtime = curscr->intprm;
DEBUG(DB_LGII, "Set wait time to %d\n", sc_wtime);
break;
-
+
case SC_ZERO:
sc_counter = 0;
DEBUG(DB_LGII, "Set counter to %d\n", sc_counter);
break;
-
+
case SC_INCR:
sc_counter++;
DEBUG(DB_LGII, "Incr counter to %d\n", sc_counter);
break;
-
+
case SC_WAIT:
DEBUG(DB_LGII, "Sleeping %d tenth-secs\n", curscr->intprm);
msleep(curscr->intprm);
break;
-
+
case SC_DTIM:
sc_dtime = curscr->intprm;
DEBUG(DB_LGII, "Digit time is %d\n", sc_dtime);
break;
-
+
case SC_CTIM:
sc_carrtime = curscr->intprm;
DEBUG(DB_LGII, "Carrier time is %d\n", sc_carrtime);
break;
-
+
case SC_EXIT:
Debug = dbgsave;
DEBUG(DB_LGI, "Script ended successfully\n", 0);
return SUCCESS;
-
+
case SC_FAIL:
Debug = dbgsave;
if (DEBUG_LEVEL(DB_LGI) && dbf != NULL)
fprintf(dbf, "Script failed\n");
else if (expin)
- charlog(expbuf, expin, DB_LOG,
+ charlog(expbuf, expin, DB_LOG,
"Script failed. Last received data");
return FAIL;
-
+
case SC_LOG:
logit(curscr->strprm, "");
break;
-
+
case SC_LOGE:
logit("ERROR: ", curscr->strprm);
break;
-
+
case SC_DBOF:
/*
* If the debug file name does not begin with "/", then
* we prepend the LOG_DIR to the string. Then CREATE the
- * file. This WIPES OUT previous logs.
+ * file. This WIPES OUT previous logs.
*/
*dfname = '\0'; /* Zero name string */
if(curscr->strprm[0] != '/')
@@ -877,102 +877,102 @@ int do_script(begin)
return FAIL;
}
break;
-
+
case SC_DBG:
DEBUG(DB_LGI, "<%s>\n", curscr->strprm);
break;
-
+
case SC_DBGE:
DEBUG(DB_LGIE, "ERROR: <%s>\n", curscr->strprm);
break;
-
+
case SC_DBST:
Debug |= curscr->intprm;
DEBUG(DB_LGII, "Debug mask set to %04o (octal)\n", Debug);
break;
-
+
case SC_DBCL:
Debug &= ~(curscr->intprm);
DEBUG(DB_LGII, "Debug mask set to %04o (octal)\n", Debug);
break;
-
+
case SC_BRK:
DEBUG(DB_LGI, "Sending break\n", 0);
ttbreak();
break;
-
+
case SC_HANG:
DEBUG(DB_LGI, "Dropping DTR\n", 0);
tthang();
break;
-
+
case SC_7BIT:
DEBUG(DB_LGI, "Enabling 7-bit stripping\n", 0);
tt7bit(TRUE);
break;
-
+
case SC_8BIT:
DEBUG(DB_LGI, "Disabling 7-bit stripping\n", 0);
tt7bit(FALSE);
break;
-
+
case SC_PNON:
DEBUG(DB_LGI, "Setting 8-bit, no parity\n", 0);
ttpar(NONE);
break;
-
+
case SC_PEVN:
DEBUG(DB_LGI, "Setting 7-bit, even parity\n", 0);
ttpar(EVEN);
break;
-
+
case SC_PODD:
DEBUG(DB_LGI, "Setting 7-bit, odd parity\n", 0);
ttpar(ODD);
break;
-
+
case SC_IFBL:
- if (ttblind())
+ if (ttblind())
{
DEBUG(DB_LGI, "Blind mux,\n", 0);
goto _chgstate;
}
break;
-
+
case SC_IFBG:
- if (ttblind() && sc_counter > curscr->intprm)
+ if (ttblind() && sc_counter > curscr->intprm)
{
- DEBUG(DB_LGI, "Blind mux & ctr > %d\n",
+ DEBUG(DB_LGI, "Blind mux & ctr > %d\n",
curscr->intprm);
goto _chgstate;
}
break;
-
+
case SC_IFGT:
- if (sc_counter > curscr->intprm)
+ if (sc_counter > curscr->intprm)
{
DEBUG(DB_LGI, "Counter > %d\n", curscr->intprm);
goto _chgstate;
}
break;
-
+
case SC_GOTO:
_chgstate:
DEBUG(DB_LGI, "Changing to state %s\n",
curscr->newstate);
curstate = find_state(begin, curscr->newstate);
- if (curstate == NULL)
+ if (curstate == NULL)
{
logit("New state not found",
curscr->newstate);
return FAIL;
}
goto _newstate;
-
+
case SC_SEND:
ttoslow(curscr->strprm, curscr->intprm, sc_chrdly);
break;
-
+
case SC_TELN:
if (curscr->intprm > paramc - 1)
{
@@ -983,7 +983,7 @@ int do_script(begin)
strcpy(telno, paramv[curscr->intprm]);
DEBUG(DB_LGII, "telno set to %s\n", telno);
break;
-
+
case SC_SNDP:
if (curscr->intprm > paramc - 1)
{
@@ -994,17 +994,17 @@ int do_script(begin)
prmlen = xlat_str(tempstr, paramv[curscr->intprm]);
ttoslow(tempstr, prmlen, sc_chrdly);
break;
-
+
case SC_IF1P:
if (curscr->intprm < paramc)
goto _chgstate;
break;
-
+
case SC_IF0P:
if (curscr->intprm >= paramc)
goto _chgstate;
break;
-
+
case SC_DIAL:
if(telno[0] == '\0')
{
@@ -1017,17 +1017,17 @@ int do_script(begin)
* changed by the script. See the man page xchat(8) for
* details.
*/
- sc_dtmo = (sc_dtime+sc_chrdly)*strlen(telno)
+ sc_dtmo = (sc_dtime+sc_chrdly)*strlen(telno)
+ sc_carrtime;
c=strcpy(tempstr, telno);
- for (; *c!='\0'; c++)
+ for (; *c!='\0'; c++)
{
- if (*c == 'W')
+ if (*c == 'W')
{
*c = sc_wchar;
sc_dtmo += sc_wtime;
}
- else if (*c == 'P')
+ else if (*c == 'P')
{
*c = sc_pchar;
sc_dtmo += sc_ptime;
@@ -1036,7 +1036,7 @@ int do_script(begin)
DEBUG(DB_LGI, "Dialing, default timeout is %d millisecs\n", sc_dtmo);
ttoslow(tempstr, 0, sc_chrdly);
break;
-
+
case SC_TIMO: /* these are "expects", don't bother */
case SC_XPCT: /* with them yet, other than noting that */
case SC_CARR: /* they exist */
@@ -1044,107 +1044,107 @@ int do_script(begin)
expcnt++;
break;
}
-
+
}
-
+
/* we've done the current state's actions, now do its expects, if any */
-
- if (expcnt == 0)
+
+ if (expcnt == 0)
{
- if (curscr != (struct script *)NULL &&
- (curscr->opcode == SC_LABEL))
+ if (curscr != (struct script *)NULL &&
+ (curscr->opcode == SC_LABEL))
{
curstate = curscr;
DEBUG(DB_LGI, "Fell through to state %s\n",
curstate->strprm);
goto _newstate;
}
- else
+ else
{
logit("No way out of state", curstate->strprm);
return FAIL;
}
}
-
+
time(&sc_begwait); /* log time at beg of expect */
DEBUG(DB_LGI, "Doing expects for state %s\n", curstate->strprm);
charlog((char *)NULL, 0, DB_LGI, "Received");
-
- while (1)
+
+ while (1)
{
chr = xgetc(1); /* Returns upon char input or 1 sec. tmo */
-
+
charlog(&chr, 1, DB_LGI, (char *)NULL);
-
- if (chr != EOF)
+
+ if (chr != EOF)
{
- if (expin < MAX_EXPCT)
+ if (expin < MAX_EXPCT)
{
expbuf[expin++] = chr & 0x7f;
}
- else
+ else
{
strncpy(expbuf, &expbuf[1], MAX_EXPCT-1);
expbuf[MAX_EXPCT-1] = chr & 0x7f;
}
}
-
+
/* for each entry in the current state... */
-
- for (curscr = curstate->next;
+
+ for (curscr = curstate->next;
(curscr != (struct script *)NULL) &&
(curscr->opcode != SC_LABEL);
- curscr = curscr->next)
+ curscr = curscr->next)
{
-
- switch (curscr->opcode)
+
+ switch (curscr->opcode)
{
case SC_TIMO:
sc_secs = curscr->intprm;
if (sc_secs == 0)
sc_secs = sc_dtmo;
sc_secs /= 1000;
- if (time(NULL)-sc_begwait > sc_secs)
+ if (time(NULL)-sc_begwait > sc_secs)
{
DEBUG(DB_LGI,
"\nTimed out (%d secs)\n", sc_secs);
goto _chgstate;
}
break;
-
+
case SC_CARR:
- if (ttcd())
+ if (ttcd())
{
DEBUG(DB_LGI, "\nGot carrier\n", 0);
goto _chgstate;
}
break;
-
+
case SC_HUPS:
- if (fShangup)
+ if (fShangup)
{
DEBUG(DB_LGI, "\nGot data set hangup\n", 0);
goto _chgstate;
}
break;
-
+
case SC_XPCT:
if ((expin >= curscr->intprm) &&
- (strncmp(curscr->strprm,
+ (strncmp(curscr->strprm,
&expbuf[expin - curscr->intprm],
- curscr->intprm) == SAME))
+ curscr->intprm) == SAME))
{
charlog(curscr->strprm, curscr->intprm,
DB_LGI, "Matched");
goto _chgstate;
}
break;
-
+
}
}
}
}
- /* New opcode added by hag@eddie.mit.edu for expecting a
+ /* New opcode added by hag@eddie.mit.edu for expecting a
parameter supplied string */
case SC_XPST:
if(curscr->intprm >paramc-1)
@@ -1194,8 +1194,8 @@ static int uhup(isig)
/*
* xgetc - get a character with timeout
*
- * Assumes that stdin is opened on a terminal or TCP socket
- * with O_NONBLOCK.
+ * Assumes that stdin is opened on a terminal or TCP socket
+ * with O_NONBLOCK.
*/
static char xgetc(tmo)
int tmo; /* Timeout, seconds */
@@ -1218,7 +1218,7 @@ int tmo; /* Timeout, seconds */
return(c);
}
-/*
+/*
* Pause for an interval in milliseconds
*/
void msleep(msec)
@@ -1248,7 +1248,7 @@ long msec;
if(msec == 0)
return;
- /*
+ /*
* We need to pass an unused pollfd structure because poll checks
* the address before checking the number of elements.
*/
@@ -1289,7 +1289,7 @@ char *msg1, *msg2;
*
* SPECIAL CASE: msg=NULL, len=1 and msg[0]='\377' gets logged
* when read does its 1 sec. timeout. Log "<1 sec.>"
- * so user can see elapsed time
+ * so user can see elapsed time
*/
static void charlog(buf, len, mask, msg)
char *buf;
@@ -1344,21 +1344,21 @@ int sig;
return;
}
-/*
+/*
* ttoslow() - Send characters with pacing delays
*/
static void ttoslow(s, len, delay)
- char *s;
+ char *s;
int len;
- time_t delay;
+ time_t delay;
{
int i;
-
+
if (len == 0)
len = strlen(s);
-
+
charlog (s, len, DB_LGI, "Sending slowly");
-
+
for (i = 0; i < len; i++, s++)
{
write(1, s, 1);
diff --git a/gnu/libexec/uucp/cu/Makefile b/gnu/libexec/uucp/cu/Makefile
index 53343ce..85d47ab 100644
--- a/gnu/libexec/uucp/cu/Makefile
+++ b/gnu/libexec/uucp/cu/Makefile
@@ -1,12 +1,12 @@
# Makefile for cu
-# $Id: Makefile,v 1.2 1994/05/31 05:23:39 ache Exp $
+# $Id: Makefile,v 1.3 1994/05/31 07:47:39 ache Exp $
BINDIR= $(bindir)
BINOWN= $(owner)
BINMODE= 4555
PROG= cu
-SRCS= cu.c prot.c log.c chat.c conn.c tcp.c tli.c copy.c
+SRCS= cu.c prot.c log.c chat.c conn.c copy.c
LDADD+= $(LIBUNIX) $(LIBUUCONF) $(LIBUUCP)
DPADD+= $(LIBUNIX) $(LIBUUCONF) $(LIBUUCP)
CFLAGS+= -I$(.CURDIR)/../common_sources\
diff --git a/gnu/libexec/uucp/cu/cu.1 b/gnu/libexec/uucp/cu/cu.1
index 333d0ee..f756d4c 100644
--- a/gnu/libexec/uucp/cu/cu.1
+++ b/gnu/libexec/uucp/cu/cu.1
@@ -1,5 +1,5 @@
-''' $Id: cu.1,v 1.2 1994/05/07 18:09:51 ache Exp $
-.TH cu 1 "Taylor UUCP 1.05"
+''' $Id: cu.1,v 1.9 1995/08/02 00:16:58 ian Rel $
+.TH cu 1 "Taylor UUCP 1.06"
.SH NAME
cu \- Call up another system
.SH SYNOPSIS
@@ -169,7 +169,7 @@ returns. The default is false.
A string used before sending a binary character in a file transfer, if
the
.B binary
-variable is true. The default is ^Z.
+variable is true. The default is ^V.
.TP 5
.B echo-check
Whether to check file transfers by examining what the remote system
@@ -228,6 +228,15 @@ are given.
.B \-h, \-\-halfduplex
Echo characters locally (half-duplex mode).
.TP 5
+.B \-\-nostop
+Turn off XON/XOFF handling (it is on by default).
+.TP 5
+.B \-E char, \-\-escape char
+Set the escape character. Initially
+.B ~
+(tilde). To eliminate the escape character, use
+.B -E ''.
+.TP 5
.B \-z system, \-\-system system
The system to call.
.TP 5
@@ -258,7 +267,7 @@ Prompt for the phone number to use.
.TP 5
.B \-d
Enter debugging mode. Equivalent to
-.B \-debug all.
+.B \-\-debug all.
.TP 5
.B \-x type, \-\-debug type
Turn on particular debugging types. The following types are
diff --git a/gnu/libexec/uucp/cu/cu.c b/gnu/libexec/uucp/cu/cu.c
index bc318c6..b82f1802 100644
--- a/gnu/libexec/uucp/cu/cu.c
+++ b/gnu/libexec/uucp/cu/cu.c
@@ -1,7 +1,7 @@
/* cu.c
Call up a remote system.
- Copyright (C) 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char cu_rcsid[] = "$Id: cu.c,v 1.3 1994/10/02 23:10:39 ache Exp $";
+const char cu_rcsid[] = "$Id: cu.c,v 1.42 1995/08/02 01:19:50 ian Rel $";
#endif
#include "cu.h"
@@ -213,6 +213,7 @@ static boolean fcusend_buf P((struct sconnection *qconn, const char *zbuf,
static const struct option asCulongopts[] =
{
{ "phone", required_argument, NULL, 'c' },
+ { "escape", required_argument, NULL, 'E' },
{ "parity", required_argument, NULL, 2 },
{ "halfduplex", no_argument, NULL, 'h' },
{ "prompt", no_argument, NULL, 'n' },
@@ -221,6 +222,7 @@ static const struct option asCulongopts[] =
{ "speed", required_argument, NULL, 's' },
{ "baud", required_argument, NULL, 's' },
{ "mapcr", no_argument, NULL, 't' },
+ { "nostop", no_argument, NULL, 3 },
{ "system", required_argument, NULL, 'z' },
{ "config", required_argument, NULL, 'I' },
{ "debug", required_argument, NULL, 'x' },
@@ -252,6 +254,8 @@ main (argc, argv)
boolean fmapcr = FALSE;
/* -z: system. */
const char *zsystem = NULL;
+ /* --nostop: turn off XON/XOFF. */
+ enum txonxoffsetting txonxoff = XONXOFF_ON;
/* -I: configuration file name. */
const char *zconfig = NULL;
int iopt;
@@ -291,7 +295,7 @@ main (argc, argv)
}
}
- while ((iopt = getopt_long (argc, argv, "a:c:dehnI:l:op:s:tvx:z:",
+ while ((iopt = getopt_long (argc, argv, "a:c:deE:hnI:l:op:s:tvx:z:",
asCulongopts, (int *) NULL)) != EOF)
{
switch (iopt)
@@ -313,6 +317,11 @@ main (argc, argv)
feven = TRUE;
break;
+ case 'E':
+ /* Escape character. */
+ zCuvar_escape = optarg;
+ break;
+
case 'h':
/* Local echo. */
fCulocalecho = TRUE;
@@ -371,7 +380,7 @@ main (argc, argv)
/* Print version and exit. */
fprintf
(stderr,
- "%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ "%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -395,6 +404,11 @@ main (argc, argv)
}
break;
+ case 3:
+ /* --nostop. */
+ txonxoff = XONXOFF_OFF;
+ break;
+
case 1:
/* --help. */
ucuhelp ();
@@ -531,6 +545,7 @@ main (argc, argv)
{
enum tparitysetting tparity;
enum tstripsetting tstrip;
+ long iusebaud;
/* The uuconf_find_port function only selects directly on a port
name and a speed. To select based on the line name, we use a
@@ -599,6 +614,7 @@ main (argc, argv)
if (! fsysdep_port_access (&sport))
ulog (LOG_FATAL, "%s: Permission denied", zline);
}
+ iusebaud = ibaud;
ihighbaud = 0L;
}
else
@@ -660,12 +676,12 @@ main (argc, argv)
ulog (LOG_FATAL, "%s: No %smatching ports", zsystem, zrem);
}
- ibaud = qsys->uuconf_ibaud;
+ iusebaud = qsys->uuconf_ibaud;
ihighbaud = qsys->uuconf_ihighbaud;
}
/* Here we have locked a connection to use. */
- if (! fconn_open (&sconn, ibaud, ihighbaud, FALSE))
+ if (! fconn_open (&sconn, iusebaud, ihighbaud, FALSE))
ucuabort ();
fCuclose_conn = TRUE;
@@ -695,7 +711,7 @@ main (argc, argv)
tstrip = STRIPSETTING_DEFAULT;
}
- if (! fconn_set (&sconn, tparity, tstrip, XONXOFF_ON))
+ if (! fconn_set (&sconn, tparity, tstrip, txonxoff))
ucuabort ();
if (qsys != NULL)
@@ -815,7 +831,7 @@ static void
ucuhelp ()
{
fprintf (stderr,
- "Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ "Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
fprintf (stderr,
"Usage: %s [options] [system or phone-number]\n", zProgram);
@@ -836,8 +852,12 @@ ucuhelp ()
fprintf (stderr,
" --parity={odd,even}: Set parity\n");
fprintf (stderr,
+ " -E,--escape char: Set escape character\n");
+ fprintf (stderr,
" -h,--halfduplex: Echo locally\n");
fprintf (stderr,
+ " --nostop: Turn off XON/XOFF handling\n");
+ fprintf (stderr,
" -t,--mapcr: Map carriage return to carriage return/linefeed\n");
fprintf (stderr,
" -n,--prompt: Prompt for phone number\n");
@@ -1012,7 +1032,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
{
default:
if (! isprint (*zCuvar_escape))
- sprintf (abescape, "\\%03o", (unsigned int) *zCuvar_escape);
+ sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
abescape[0] = *zCuvar_escape;
@@ -1047,7 +1067,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
case '|': t = SHELL_STDIN_FROM_PORT; break;
case '+': t = SHELL_STDIO_ON_PORT; break;
}
-
+
(void) fsysdep_shell (qconn, zline, t);
}
if (! fsysdep_cu_copy (TRUE)
@@ -1098,7 +1118,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
ucuabort ();
fCurestore_terminal = TRUE;
return TRUE;
-
+
case 's':
fret = fcuset_var (puuconf, zline);
ubuffree (zline);
@@ -1110,7 +1130,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
case '?':
if (! isprint (*zCuvar_escape))
- sprintf (abescape, "\\%03o", (unsigned int) *zCuvar_escape);
+ sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
abescape[0] = *zCuvar_escape;
@@ -1192,7 +1212,6 @@ fcuset_var (puuconf, zline)
{
char *zvar, *zval;
char *azargs[2];
- char azbool[2];
int iuuconf;
zvar = strtok (zline, "= \t");
@@ -1208,25 +1227,27 @@ fcuset_var (puuconf, zline)
{
azargs[0] = zvar;
if (azargs[0][0] != '!')
- azbool[0] = 't';
+ azargs[1] = zbufcpy ("t");
else
{
++azargs[0];
- azbool[0] = 'f';
+ azargs[1] = zbufcpy ("f");
}
- azbool[1] = '\0';
- azargs[1] = azbool;
}
else
{
azargs[0] = zvar;
- azargs[1] = zval;
+ azargs[1] = zbufcpy (zval);
}
iuuconf = uuconf_cmd_args (puuconf, 2, azargs, asCuvars,
(pointer) NULL, icuunrecogvar, 0,
(pointer) NULL);
- if (iuuconf != UUCONF_SUCCESS)
+
+ if ((iuuconf & UUCONF_CMDTABRET_KEEP) == 0)
+ ubuffree (azargs[1]);
+
+ if ((iuuconf &~ UUCONF_CMDTABRET_KEEP) != UUCONF_SUCCESS)
ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
return TRUE;
@@ -1246,7 +1267,7 @@ icuunrecogvar (puuconf, argc, argv, pvar, pinfo)
char abescape[5];
if (! isprint (*zCuvar_escape))
- sprintf (abescape, "\\%03o", (unsigned int) *zCuvar_escape);
+ sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
abescape[0] = *zCuvar_escape;
@@ -1301,7 +1322,7 @@ uculist_vars ()
if (! isprint (*z))
{
- sprintf (abchar, "\\%03o", (unsigned int) *z);
+ sprintf (abchar, "\\%03o", BUCHAR (*z));
cchar = 4;
}
else
@@ -1413,7 +1434,7 @@ icuunrecogfn (puuconf, argc, argv, pvar, pinfo)
char abescape[5];
if (! isprint (*zCuvar_escape))
- sprintf (abescape, "\\%03o", (unsigned int) *zCuvar_escape);
+ sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
abescape[0] = *zCuvar_escape;
@@ -1651,7 +1672,7 @@ icuput (puuconf, argc, argv, pvar, pinfo)
if (ffileeof (e))
break;
c = cfileread (e, abbuf, sizeof abbuf);
- if (ffilereaderror (e, c))
+ if (ffileioerror (e, c))
{
ucuputs ("[file read error]");
break;
@@ -1827,8 +1848,6 @@ icutake (puuconf, argc, argv, pvar, pinfo)
return UUCONF_CMDTABRET_CONTINUE;
}
- ubuffree (zto);
-
if (! fsysdep_cu_copy (FALSE)
|| ! fsysdep_terminal_signals (TRUE))
ucuabort ();
@@ -1860,6 +1879,7 @@ icutake (puuconf, argc, argv, pvar, pinfo)
{
ucuputs ("[timed out waiting for newline]");
ucuputs (abCuconnected);
+ ubuffree (zto);
return UUCONF_CMDTABRET_CONTINUE;
}
}
@@ -1883,7 +1903,7 @@ icutake (puuconf, argc, argv, pvar, pinfo)
the future. */
afSignal[INDEXSIG_SIGINT] = FALSE;
break;
- }
+ }
b = breceive_char (qconn, cCuvar_timeout, TRUE);
if (b == -2)
@@ -1896,7 +1916,7 @@ icutake (puuconf, argc, argv, pvar, pinfo)
break;
}
- if (b == '\r')
+ if (b == '\r' && ! fCuvar_binary)
continue;
if (ceoflen == 0)
@@ -1941,8 +1961,16 @@ icutake (puuconf, argc, argv, pvar, pinfo)
ubuffree (zlook);
- if (! ffileclose (e))
- ferr = TRUE;
+ if (! fsysdep_sync (e, zto))
+ {
+ (void) ffileclose (e);
+ ferr = TRUE;
+ }
+ else
+ {
+ if (! ffileclose (e))
+ ferr = TRUE;
+ }
if (ferr)
ucuputs ("[file write error]");
@@ -1952,6 +1980,8 @@ icutake (puuconf, argc, argv, pvar, pinfo)
ucuputs (abCuconnected);
+ ubuffree (zto);
+
return UUCONF_CMDTABRET_CONTINUE;
}
@@ -2055,7 +2085,7 @@ fcusend_buf (qconn, zbufarg, cbufarg)
*zput++ = *zget;
}
}
-
+
zbuf += csend;
cbuf -= csend;
diff --git a/gnu/libexec/uucp/doc/uucp.texi b/gnu/libexec/uucp/doc/uucp.texi
index 5ab7411..28d6e53 100644
--- a/gnu/libexec/uucp/doc/uucp.texi
+++ b/gnu/libexec/uucp/doc/uucp.texi
@@ -9,22 +9,16 @@
@finalout
@end iftex
-@ignore
----------------------------------------------------------------------->
-Franc,ois Pinard says:
-
-Hi, Ian! This is the promised merging of the current documents from
-Taylor UUCP 1.01, plus the patches to documentation you sent to me, into
-a taylor.texi file. Many things remain to do, among which:
-
-- merging in the Taylor UUCP program man pages.
-----------------------------------------------------------------------<
-@end ignore
-
@ifinfo
-This file documents Taylor UUCP, version 1.05.
+@format
+START-INFO-DIR-ENTRY
+* UUCP: (uucp). Transfer mail and news across phone lines.
+END-INFO-DIR-ENTRY
+@end format
+
+This file documents Taylor UUCP, version 1.06.
-Copyright @copyright{} 1992, 1993, 1994 Ian Lance Taylor
+Copyright @copyright{} 1992, 1993, 1994, 1995 Ian Lance Taylor
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -51,12 +45,12 @@ translation approved by the author instead of in the original English.
@titlepage
@title Taylor UUCP
-@subtitle Version 1.05
+@subtitle Version 1.06
@author Ian Lance Taylor @code{<ian@@airs.com>}
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1992, 1993, 1994 Ian Lance Taylor
+Copyright @copyright{} 1992, 1993, 1994, 1995 Ian Lance Taylor
Published by Ian Lance Taylor @code{<ian@@airs.com>}.
@@ -77,100 +71,202 @@ translation approved by the author instead of in the original English.
@end titlepage
@node Top, Copying, (dir), (dir)
-@top Taylor UUCP 1.05
+@top Taylor UUCP 1.06
-This is the documentation for the Taylor UUCP package, version 1.05.
+This is the documentation for the Taylor UUCP package, version 1.06.
The programs were written by Ian Lance Taylor. The author can be
-reached at @code{<ian@@airs.com>}, or @samp{c/o Cygnus Support, Building
-200, 1 Kendall Square, Cambridge, MA, 02139, USA}.
-
-There is a mailing list for discussion of the package. To join (or get
-off) the list, send mail to
-@code{<taylor-uucp-request@@gnu.ai.mit.edu>}. Mail to this address is
-answered by a person, not a program. When joining the list, please give
-the address at which you wish to receive mail; do not rely on the
-message headers. To send a message to the list, send it to
-@code{<taylor-uucp@@gnu.ai.mit.edu>}.
-
-Jeff Ross has volunteered to maintain patches for UUCP releases. They
-may be obtained via anonymous FTP from ftp.fdu.edu, in the directory
-pub/taylor-uucp.
+reached at @code{<ian@@airs.com>}, or at
+@display
+Ian Lance Taylor
+c/o Cygnus Support
+48 Grove Street
+Somerville, MA 02144
+USA
+@end display
+
+There is a mailing list for discussion of the package. The list is
+hosted by Eric Schnoebelen at @code{cirr.com}. To join (or get off) the
+list, send mail to @code{taylor-uucp-request@@cirr.com}. Mail to this
+address is answered by the majordomo program. To join the list, send
+the message @samp{subscribe @var{address}} where @var{address} is your
+e-mail address. To send a message to the list, send it to
+@code{taylor-uucp@@cirr.com}. The old list address,
+@code{taylor-uucp@@gnu.ai.mit.edu}, will also work. There is an archive
+of all messages sent to the mailing list at @code{ftp.cirr.com}.
@menu
-* Copying:: Taylor UUCP copying conditions
+* Copying:: Taylor UUCP Copying Conditions
* Introduction:: Introduction to Taylor UUCP
-* Overall Installation:: Taylor UUCP installation
-* Configuration Files:: Taylor UUCP configuration files
-* Protocols:: UUCP protocol internals
+* Invoking the UUCP Programs:: Invoking the UUCP Programs
+* Installing Taylor UUCP:: Installing Taylor UUCP
+* Using Taylor UUCP:: Using Taylor UUCP
+* Configuration Files:: Taylor UUCP Configuration Files
+* Protocols:: UUCP Protocol Descriptions
* Hacking:: Hacking Taylor UUCP
* Acknowledgements:: Acknowledgements
-* Index (concepts):: Concept index
-* Index (configuration file):: Index to new configuration files
+* Index (concepts):: Concept Index
+* Index (configuration file):: Index to New Configuration Files
--- The Detailed Node Listing ---
-Taylor UUCP Overall Installation
+Invoking the UUCP Programs
-* Configuration:: Configuring Taylor UUCP
-* Compilation:: Compiling Taylor UUCP
-* Testing:: Testing Taylor UUCP
-* Installation:: Installing Taylor UUCP
-* TCP:: TCP together with Taylor UUCP
+* Standard Options:: Standard Options for the UUCP Programs
+* Invoking uucp:: Invoking uucp
+* Invoking uux:: Invoking uux
+* Invoking uustat:: Invoking uustat
+* Invoking uuname:: Invoking uuname
+* Invoking uulog:: Invoking uulog
+* Invoking uuto:: Invoking uuto
+* Invoking uupick:: Invoking uupick
+* Invoking cu:: Invoking cu
+* Invoking uucico:: Invoking uucico
+* Invoking uuxqt:: Invoking uuxqt
+* Invoking uuchk:: Invoking uuchk
+* Invoking uuconv:: Invoking uuconv
+* Invoking uusched:: Invoking uusched
+
+Invoking uucp
+
+* uucp Description:: Description of uucp
+* uucp Options:: Options Supported by uucp
+
+Invoking uux
+
+* uux Description:: Description of uux
+* uux Options:: Options Supported by uux
+* uux Examples:: Examples of uux Usage
+
+Invoking uustat
+
+* uustat Description:: Description of uustat
+* uustat Options:: Options Supported by uustat
+* uustat Examples:: Examples of uustat Usage
+
+Invoking cu
+
+* cu Description:: Description of cu
+* cu Commands:: Commands Supported by cu
+* cu Variables:: Variables Supported by cu
+* cu Options:: Options Supported by cu
+
+Invoking uucico
+
+* uucico Description:: Description of uucico
+* uucico Options:: Options Supported by uucico
Installing Taylor UUCP
-* Running uucico:: Running uucico
-* Using UUCP for mail and news:: Using UUCP for mail and news.
-* Trimming UUCP Log Files:: Trimming UUCP Log Files
+* Compilation:: Compiling Taylor UUCP
+* Testing the Compilation:: Testing the Compilation
+* Installing the Binaries:: Installing the Binaries
+* Configuration:: Configuring Taylor UUCP
+* Testing the Installation:: Testing the Installation
+
+Using Taylor UUCP
+
+* Calling Other Systems:: Calling Other Systems
+* Accepting Calls:: Accepting Calls
+* Mail and News:: Using UUCP for Mail and News
+* The Spool Directory Layout:: The Spool Directory Layout
+* Spool Directory Cleaning:: Cleaning the UUCP Spool Directory
-Using UUCP for mail and news.
+Using UUCP for Mail and News.
* Sending mail or news:: Sending mail or news via UUCP
* Receiving mail or news:: Receiving mail or news via UUCP
+The Spool Directory Layout
+
+* System Spool Directories:: System Spool Directories
+* Status Directory:: Status Spool Directory
+* Execution Subdirectories:: Execution Spool Subdirectories
+* Other Spool Subdirectories:: Other Spool Subdirectories
+* Spool Lock Files:: Spool Directory Lock Files
+
Taylor UUCP Configuration Files
-* Configuration File Format:: Configuration file format
-* Configuration File Overview:: Configuration File Overview
-* Configuration Examples:: Examples of configuration files
-* Time Strings:: How to write time strings
-* Chat Scripts:: How to write chat scripts
-* config File:: The main configuration file
-* sys File:: The system configuration file
-* port File:: The port configuration files
-* dial File:: The dialer configuration files
-* Security:: Security issues
+* Configuration Overview:: Configuration File Overview
+* Configuration File Format:: Configuration File Format
+* Configuration Examples:: Examples of Configuration Files
+* Time Strings:: How to Write Time Strings
+* Chat Scripts:: How to Write Chat Scripts
+* config File:: The Main Configuration File
+* sys File:: The System Configuration File
+* port File:: The Port Configuration Files
+* dial File:: The Dialer Configuration Files
+* UUCP Over TCP:: UUCP Over TCP
+* Security:: Security Issues
Examples of Configuration Files
-* config File Examples:: Examples of the main configuration file
-* Leaf Example:: Call a single remote site
-* Gateway Example:: The gateway for several local systems
+* config File Examples:: Examples of the Main Configuration File
+* Leaf Example:: Call a Single Remote Site
+* Gateway Example:: The Gateway for Several Local Systems
The Main Configuration File
-* Miscellaneous (config):: Miscellaneous config file commands
-* Configuration File Names:: Using different configuration files
-* Log File Names:: Using different log files
-* Debugging Levels:: Debugging levels
+* Miscellaneous (config):: Miscellaneous config File Commands
+* Configuration File Names:: Using Different Configuration Files
+* Log File Names:: Using Different Log Files
+* Debugging Levels:: Debugging Levels
The System Configuration File
-* Defaults and Alternates:: Using defaults and alternates
-* Naming the System:: Naming the system
-* Calling Out:: Calling out
-* Accepting a Call:: Accepting a call
-* Protocol Selection:: Protocol selection
-* File Transfer Control:: File transfer control
-* Miscellaneous (sys):: Miscellaneous sys file commands
-* Default sys File Values:: Default values
+* Defaults and Alternates:: Using Defaults and Alternates
+* Naming the System:: Naming the System
+* Calling Out:: Calling Out
+* Accepting a Call:: Accepting a Call
+* Protocol Selection:: Protocol Selection
+* File Transfer Control:: File Transfer Control
+* Miscellaneous (sys):: Miscellaneous sys File Commands
+* Default sys File Values:: Default Values
Calling Out
-* When to Call:: When to call
-* Placing the Call:: Placing the call
-* Logging In:: Logging in
+* When to Call:: When to Call
+* Placing the Call:: Placing the Call
+* Logging In:: Logging In
+
+UUCP Over TCP
+
+* TCP Client:: Connecting to Another System Over TCP
+* TCP Server:: Running a TCP Server
+
+UUCP Protocol Internals
+
+* UUCP Protocol Sources:: Sources for UUCP Protocol Information
+* UUCP Grades:: UUCP Grades
+* UUCP Lock Files:: UUCP Lock Files
+* Execution File Format:: Execution File Format
+* UUCP Protocol:: UUCP Protocol
+* g Protocol:: g protocol
+* f Protocol:: f protocol
+* t Protocol:: t protocol
+* e Protocol:: e protocol
+* Big G Protocol:: G protocol
+* i Protocol:: i protocol
+* j Protocol:: j protocol
+* x Protocol:: x protocol
+* y Protocol:: y protocol
+* d Protocol:: d protocol
+* h Protocol:: h protocol
+* v Protocol:: v protocol
+
+UUCP Protocol
+
+* The Initial Handshake:: The Initial Handshake
+* UUCP Protocol Commands:: UUCP Protocol Commands
+* The Final Handshake:: The Final Handshake
+
+UUCP Protocol Commands
+
+* The S Command:: The S Command
+* The R Command:: The R Command
+* The X Command:: The X Command
+* The E Command:: The E Command
+* The H Command:: The H Command
Hacking Taylor UUCP
@@ -187,12 +283,8 @@ This package is covered by the GNU Public License. See the file
package that you feel is reasonable, but you feel is prohibited by the
license, contact me to see if we can work it out.
-Here is some propaganda from the Free Software Foundation. If you find
-this stuff offensive or annoying, remember that you probably did not
-spend any money to get this code. I did not write this code to make
-life easier for developers of UUCP packages, I wrote it to help end
-users, and I believe that these are the most appropriate conditions for
-distribution.
+The rest of this section is some descriptive text from the Free Software
+Foundation.
All the programs, scripts and documents relating to Taylor UUCP are
@dfn{free}; this means that everyone is free to use them and free to
@@ -227,7 +319,7 @@ The precise conditions of the licenses for the programs currently being
distributed that relate to Taylor UUCP are found in the General Public
Licenses that accompany them.
-@node Introduction, Overall Installation, Copying, Top
+@node Introduction, Invoking the UUCP Programs, Copying, Top
@chapter Introduction to Taylor UUCP
General introductions to UUCP are available, and perhaps one day I will
@@ -249,7 +341,7 @@ refer to a file on a remote system by using @samp{system!} before the
file name. For example, to copy the file @file{notes.txt} to the system
@samp{airs}, you would say @samp{uucp notes.txt airs!~/notes.txt}. In
this example @samp{~} is used to name the UUCP public directory on
-@samp{airs}.
+@samp{airs}. For more details, see @ref{Invoking uucp, uucp}.
@item uux
@@ -257,10 +349,10 @@ The @code{uux} program is used to request the execution of a program on
a remote system. This is how mail and news are transferred over UUCP.
As with @code{uucp}, programs and files on remote systems may be named
by using @samp{system!}. For example, to run the @code{rnews} program
-on @samp{airs} passing it standard input, you would say @samp{uux -
+on @samp{airs}, passing it standard input, you would say @samp{uux -
airs!rnews}. The @samp{-} means to read standard input and set things
up such that when @code{rnews} runs on @samp{airs} it will receive the
-same standard input.
+same standard input. For more details, see @ref{Invoking uux, uux}.
@end table
@@ -284,20 +376,22 @@ your jobs from the queue. You can also it use it to show the status of
the UUCP system in various ways, such as showing the connection status
of all the remote systems your system knows about. The system
administrator can use @code{uustat} to automatically discard old jobs
-while sending mail to the user who requested them.
+while sending mail to the user who requested them. For more details,
+see @ref{Invoking uustat, uustat}.
@item uuname
The @code{uuname} program by default lists all the remote systems your
system knows about. You can also use it to get the name of your local
-system. It is mostly useful for shell scripts.
+system. It is mostly useful for shell scripts. For more details, see
+@ref{Invoking uuname, uuname}.
@item uulog
The @code{uulog} program can be used to display entries in the UUCP log
file. It can select the entries for a particular system or a particular
user. You can use it to see what has happened to your queued jobs in
-the past.
+the past. For more details, see @ref{Invoking uulog, uulog}.
@item uuto
@item uupick
@@ -305,13 +399,16 @@ the past.
@code{uuto} is a simple shell script interface to @code{uucp}. It will
transfer a file, or the contents of a directory, to a remote system, and
notify a particular user on the remote system when it arrives. The
-remote user can then retrieve the file(s) with @code{uupick}.
+remote user can then retrieve the file(s) with @code{uupick}. For more
+details, see @ref{Invoking uuto, uuto}, and see @ref{Invoking uupick,
+uupick}.
@item cu
The @code{cu} program can be used to call up another system and
communicate with it as though you were directly connected. It can also
do simple file transfers, though it does not provide any error checking.
+For more details, @ref{Invoking cu, cu}.
@end table
@@ -341,7 +438,8 @@ perhaps because the phone line is busy, @code{uucico} leaves the
requests in the queue and goes on to the next system to call. It is
also possible to force @code{uucico} to call a remote system even if
there is no work to be done for it, so that it can pick up any work that
-may be queued up remotely.
+may be queued up remotely. For more details, see @ref{Invoking uucico,
+uucico}.
@need 1000
@item uuxqt
@@ -349,7 +447,8 @@ may be queued up remotely.
The @code{uuxqt} daemon processes execution requests made by the
@code{uux} program on remote systems. It also processes requests made
on the local system which require files from a remote system. It is
-normally started by @code{uucico}.
+normally started by @code{uucico}. For more details, see @ref{Invoking
+uuxqt, uuxqt}.
@end table
@@ -377,11 +476,11 @@ on the work queue for @samp{airs}. @code{uux} will then start the
request and the mail message. The @code{uucico} daemon on @samp{airs}
will put the files on a local work queue. When the communication
session is over, the @code{uucico} daemon on @samp{airs} will start the
-@code{uuxqt} daemon. @code{uuxqt} will see the request to run, and will
-run @samp{rmail ian} with the mail message as standard input. The
-@code{rmail} program, which is not part of the UUCP package, is then
-responsible for either putting the message in the right mailbox on
-@samp{airs} or forwarding the message on to another system.
+@code{uuxqt} daemon. @code{uuxqt} will see the request on the work
+queue, and will run @samp{rmail ian} with the mail message as standard
+input. The @code{rmail} program, which is not part of the UUCP package,
+is then responsible for either putting the message in the right mailbox
+on @samp{airs} or forwarding the message on to another system.
Taylor UUCP comes with a few other programs that are useful when
installing and configuring UUCP.
@@ -393,21 +492,23 @@ installing and configuring UUCP.
The @code{uuchk} program reads the UUCP configuration files and displays
a rather lengthy description of what it finds. This is useful when
configuring UUCP to make certain that the UUCP package will do what you
-expect it to do.
+expect it to do. For more details, see @ref{Invoking uuchk, uuchk}.
@item uuconv
The @code{uuconv} program can be used to convert UUCP configuration
files from one format to another. This can be useful for administrators
-converting from an older UUCP. Taylor UUCP is able to read and use old
-configuration file formats, but some new features can not be selected
-using the old formats.
+converting from an older UUCP package. Taylor UUCP is able to read and
+use old configuration file formats, but some new features can not be
+selected using the old formats. For more details, see @ref{Invoking
+uuconv, uuconv}.
@item uusched
-The @code{uusched} script is just provided for compatibility with older
-UUCP releases. It starts @code{uucico} to call, one at a time, all the
-systems for which work has been queued.
+The @code{uusched} script is provided for compatibility with older UUCP
+releases. It starts @code{uucico} to call, one at a time, all the
+systems for which work has been queued. For more details, see
+@ref{Invoking uusched, uusched}.
@item tstuu
@@ -415,67 +516,1483 @@ The @code{tstuu} program is a test harness for the UUCP package; it can
help check that the package has been configured and compiled correctly.
However, it uses pseudo-terminals, which means that it is less portable
than the rest of the package. If it works, it can be useful when
-initially installing Taylor UUCP.
+initially installing Taylor UUCP. For more details, see @ref{Testing
+the Compilation, tstuu}.
@end table
-@node Overall Installation, Configuration Files, Introduction, Top
-@chapter Taylor UUCP Overall Installation
+@node Invoking the UUCP Programs, Installing Taylor UUCP, Introduction, Top
+@chapter Invoking the UUCP Programs
-These are the installation instructions for the Taylor UUCP package.
+This chapter describes how to run the UUCP programs.
@menu
-* Configuration:: Configuring Taylor UUCP
-* Compilation:: Compiling Taylor UUCP
-* Testing:: Testing Taylor UUCP
-* Installation:: Installing Taylor UUCP
-* TCP:: TCP together with Taylor UUCP
+* Standard Options:: Standard Options for the UUCP Programs
+* Invoking uucp:: Invoking uucp
+* Invoking uux:: Invoking uux
+* Invoking uustat:: Invoking uustat
+* Invoking uuname:: Invoking uuname
+* Invoking uulog:: Invoking uulog
+* Invoking uuto:: Invoking uuto
+* Invoking uupick:: Invoking uupick
+* Invoking cu:: Invoking cu
+* Invoking uucico:: Invoking uucico
+* Invoking uuxqt:: Invoking uuxqt
+* Invoking uuchk:: Invoking uuchk
+* Invoking uuconv:: Invoking uuconv
+* Invoking uusched:: Invoking uusched
@end menu
-@node Configuration, Compilation, Overall Installation, Overall Installation
-@section Configuring Taylor UUCP
+@node Standard Options, Invoking uucp, Invoking the UUCP Programs, Invoking the UUCP Programs
+@section Standard Options
-You will have to decide what types of configuration files you want to
-use. This package supports a new sort of configuration file; see
-@ref{Configuration Files}. It also supports V2 configuration files
-(@file{L.sys}, @file{L-devices}, etc.) and HDB configuration files
-(@file{Systems}, @file{Devices}, etc.). No documentation is provided
-for V2 or HDB configuration files. All types of configuration files can
-be used at once, if you are so inclined. Currently using just V2
-configuration files is not really possible, because there is no way to
-specify a dialer (there are no built in dialers, and the program does
-not know how to read @file{acucap} or @file{modemcap}); however, V2
-configuration files can be used with a new style dial file (@pxref{dial
-File}), or with a HDB @file{Dialers} file.
+All of the UUCP programs support a few standard options.
-Use of HDB configuration files has two known bugs. A blank line in the
-middle of an entry in the @file{Permissions} file will not be ignored as
-it should be. Dialer programs, as found in some versions of HDB, are
-not recognized directly. If you must use a dialer program, rather than
-an entry in @file{Devices}, you must use the @code{chat-program} command
-in a new style dial file; see @ref{dial File}. You will have to invoke
-the dialer program via a shell script or another program, since an exit
-code of 0 is required to recognize success; the @code{dialHDB} program
-in the @file{contrib} directory may be used for this purpose.
+@table @samp
+@item -x type
+@itemx --debug type
+Turn on particular debugging types. The following types are recognized:
+@samp{abnormal}, @samp{chat}, @samp{handshake}, @samp{uucp-proto},
+@samp{proto}, @samp{port}, @samp{config}, @samp{spooldir},
+@samp{execute}, @samp{incoming}, @samp{outgoing}. Not all types of
+debugging are effective for all programs. See the @code{debug}
+configuration command for details (@pxref{Debugging Levels}).
+
+Multiple types may be given, separated by commas, and the @samp{--debug}
+option may appear multiple times. A number may also be given, which
+will turn on that many types from the foregoing list; for example,
+@samp{--debug 2} is equivalent to @samp{--debug abnormal,chat}. To turn
+on all types of debugging, use @samp{-x all}.
+
+The @code{uulog} program uses @samp{-X} rather than @samp{-x} to select
+the debugging type; for @code{uulog}, @samp{-x} has a different meaning,
+for reasons of historical compatibility.
+
+@item -I file
+@itemx --config file
+Set the main configuration file to use. @xref{config File}. When this
+option is used, the programs will revoke any setuid privileges.
+
+@item -v
+@itemx --version
+Report version information and exit.
+
+@item --help
+Print a help message and exit.
+@end table
-The @code{uuconv} program can be used to convert from V2 or HDB
-configuration files to the new style (it can also do the reverse
-translation, if you are so inclined). It will not do all of the work,
-and the results should be carefully checked, but it can be quite useful.
+@need 2000
+@node Invoking uucp, Invoking uux, Standard Options, Invoking the UUCP Programs
+@section Invoking uucp
-If you are installing a new system, you will, of course, have to write
-the configuration files; see @ref{Configuration Files}.
+@menu
+* uucp Description:: Description of uucp
+* uucp Options:: Options Supported by uucp
+@end menu
-You must also decide what sort of spool directory you want to use. If
-you will be using only these programs for UUCP, I recommend
-@samp{SPOOLDIR_TAYLOR}; otherwise select the spool directory
-corresponding to your existing UUCP package. The details of the spool
-directory choices are described at somewhat tedious length in
-@file{unix/spool.c}.
+@node uucp Description, uucp Options, Invoking uucp, Invoking uucp
+@subsection uucp Description
+
+@example
+uucp [options] @file{source-file} @file{destination-file}
+uucp [options] @file{source-file}... @file{destination-directory}
+@end example
+
+The @code{uucp} command copies files between systems. Each @file{file}
+argument is either a file name on the local machine or is of the form
+@samp{system!file}. The latter is interpreted as being on a remote
+system.
+
+When @code{uucp} is used with two non-option arguments, the contents of
+the first file are copied to the second. With more than two non-option
+arguments, each source file is copied into the destination directory.
+
+A file may be transferred to or from @samp{system2} via @samp{system1}
+by using @samp{system1!system2!file}.
+
+Any file name that does not begin with @samp{/} or @samp{~} will be
+prepended with the current directory (unless the @samp{-W} or
+@samp{--noexpand} options are used). For example, if you are in the
+directory @samp{/home/ian}, then @samp{uucp foo remote!bar} is
+equivalent to @samp{uucp /home/ian/foo remote!/home/ian/bar}. Note that
+the resulting file name may not be valid on a remote system.
+
+A file name beginning with a simple @samp{~} starts at the UUCP public
+directory; a file name beginning with @samp{~name} starts at the home
+directory of the named user. The @samp{~} is interpreted on the
+appropriate system. Note that some shells will interpret an initial
+@samp{~} before @code{uucp} sees it; to avoid this the @samp{~} must be
+quoted.
+
+The shell metacharacters @samp{?} @samp{*} @samp{[} and @samp{]} are
+interpreted on the appropriate system, assuming they are quoted to
+prevent the shell from interpreting them first.
+
+The file copy does not take place immediately, but is queued up for the
+@code{uucico} daemon; the daemon is started immediately unless the
+@samp{-r} or @samp{--nouucico} option is given. The next time the
+remote system is called, the file(s) will be copied. @xref{Invoking
+uucico}.
+
+The file mode is not preserved, except for the execute bit. The
+resulting file is owned by the uucp user.
+
+@node uucp Options, , uucp Description, Invoking uucp
+@subsection uucp Options
+
+The following options may be given to @code{uucp}.
+
+@table @samp
+@item -c
+@itemx --nocopy
+Do not copy local source files to the spool directory. If they are
+removed before being processed by the @code{uucico} daemon, the copy
+will fail. The files must be readable by the @code{uucico} daemon, and
+by the invoking user.
+
+@item -C
+@itemx --copy
+Copy local source files to the spool directory. This is the default.
+
+@item -d
+@itemx --directories
+Create all necessary directories when doing the copy. This is the
+default.
+
+@item -f
+@itemx --nodirectories
+If any necessary directories do not exist for the destination file name,
+abort the copy.
+
+@item -R
+@itemx --recursive
+If any of the source file names are directories, copy their contents
+recursively to the destination (which must itself be a directory).
+
+@item -g grade
+@itemx --grade grade
+Set the grade of the file transfer command. Jobs of a higher grade are
+executed first. Grades run @kbd{0} to @kbd{9}, @kbd{A} to @kbd{Z},
+@kbd{a} to @kbd{z}, from high to low. @xref{When to Call}.
+
+@item -m
+@itemx --mail
+Report completion or failure of the file transfer by sending mail.
+
+@item -n user
+@itemx --notify user
+Report completion or failure of the file transfer by sending mail to the
+named user on the destination system.
+
+@item -r
+@itemx --nouucico
+Do not start the @code{uucico} daemon immediately; merely queue up the
+file transfer for later execution.
+
+@item -j
+@itemx --jobid
+Print the jobid on standard output. The job may be later cancelled by
+passing this jobid to the @samp{-kill} switch of @code{uustat}.
+@xref{Invoking uustat}.
+
+It is possible for some complex operations to produce more than one
+jobid, in which case each will be printed on a separate line. For
+example
+@example
+uucp sys1!~user1/file1 sys2!~user2/file2 ~user3
+@end example
+will generate two separate jobs, one for the system @samp{sys1} and one
+for the system @samp{sys2}.
+
+@item -W
+@itemx --noexpand
+Do not prepend remote relative file names with the current directory.
+
+@item -t
+@itemx --uuto
+This option is used by the @code{uuto} shell script; see @ref{Invoking
+uuto}. It causes @code{uucp} to interpret the final argument as
+@samp{system!user}. The file(s) are sent to
+@samp{~/receive/@var{user}/@var{local}} on the remote system, where
+@var{user} is from the final argument and @var{local} is the local UUCP
+system name. Also, @code{uucp} will act as though @samp{--notify user}
+were specified.
+
+@item -x type
+@itemx --debug type
+@itemx -I file
+@itemx --config file
+@itemx -v
+@itemx --version
+@itemx --help
+@xref{Standard Options}.
+@end table
+
+@node Invoking uux, Invoking uustat, Invoking uucp, Invoking the UUCP Programs
+@section Invoking uux
+
+@menu
+* uux Description:: Description of uux
+* uux Options:: Options Supported by uux
+* uux Examples:: Examples of uux Usage
+@end menu
+
+@node uux Description, uux Options, Invoking uux, Invoking uux
+@subsection uux Description
+
+@example
+uux [options] command
+@end example
+
+The @code{uux} command is used to execute a command on a remote system,
+or to execute a command on the local system using files from remote
+systems. The command is not executed immediately; the request is queued
+until the @code{uucico} daemon calls the system and transfers the
+necessary files. The daemon is started automatically unless one of the
+@samp{-r} or @samp{--nouucico} options is given.
+
+The actual command execution is done by the @code{uuxqt} daemon on the
+appropriate system.
+
+File arguments can be gathered from remote systems to the execution
+system, as can standard input. Standard output may be directed to a
+file on a remote system.
+
+The command name may be preceded by a system name followed by an
+exclamation point if it is to be executed on a remote system. An empty
+system name is taken as the local system.
+
+Each argument that contains an exclamation point is treated as naming a
+file. The system which the file is on is before the exclamation point,
+and the file name on that system follows it. An empty system name is
+taken as the local system; this form must be used to transfer a file to
+a command being executed on a remote system. If the file name is not
+absolute, the current working directory will be prepended to it; the
+result may not be meaningful on the remote system. A file name may
+begin with @samp{~/}, in which case it is relative to the UUCP public
+directory on the appropriate system. A file name may begin with
+@samp{~name/}, in which case it is relative to the home directory of the
+named user on the appropriate system.
+
+Standard input and output may be redirected as usual; the file names
+used may contain exclamation points to indicate that they are on remote
+systems. Note that the redirection characters must be quoted so that
+they are passed to @code{uux} rather than interpreted by the shell.
+Append redirection (@samp{>>}) does not work.
+
+All specified files are gathered together into a single directory
+before execution of the command begins. This means that each file
+must have a distinct name. For example,
+@example
+uux 'sys1!diff sys2!~user1/foo sys3!~user2/foo >!foo.diff'
+@end example
+will fail because both files will be copied to @samp{sys1} and stored
+under the name @file{foo}.
+
+Arguments may be quoted by parentheses to avoid interpretation of
+exclamation points. This is useful when executing the @code{uucp}
+command on a remote system.
+
+Most systems restrict the commands which may be executed using
+@samp{uux}. Many permit only the execution of @samp{rmail} and
+@samp{rnews}.
+
+A request to execute an empty command (e.g., @samp{uux sys!}) will
+create a poll file for the specified system; see @ref{Calling Other
+Systems} for an example of why this might be useful.
+
+@node uux Options, uux Examples, uux Description, Invoking uux
+@subsection uux Options
+
+The following options may be given to @code{uux}.
+
+@table @samp
+@item -
+@itemx -p
+@itemx --stdin
+Read standard input up to end of file, and use it as the standard input
+for the command to be executed.
+
+@item -c
+@itemx --nocopy
+Do not copy local files to the spool directory. This is the default.
+If they are removed before being processed by the @code{uucico} daemon,
+the copy will fail. The files must be readable by the @code{uucico}
+daemon, as well as the by the invoker of @code{uux}.
+
+@item -C
+@itemx --copy
+Copy local files to the spool directory.
+
+@item -l
+@itemx --link
+Link local files into the spool directory. If a file can not be linked
+because it is on a different device, it will be copied unless one of the
+@samp{-c} or @samp{--nocopy} options also appears (in other words, use
+of @samp{--link} switches the default from @samp{--nocopy} to
+@samp{--copy}). If the files are changed before being processed by the
+@code{uucico} daemon, the changed versions will be used. The files must
+be readable by the @code{uucico} daemon, as well as by the invoker of
+@code{uux}.
+
+@item -g grade
+@itemx --grade grade
+Set the grade of the file transfer command. Jobs of a higher grade are
+executed first. Grades run @kbd{0} to @kbd{9}, @kbd{A} to @kbd{Z},
+@kbd{a} to @kbd{z}, from high to low. @xref{When to Call}.
+
+@item -n
+@itemx --notification=no
+Do not send mail about the status of the job, even if it fails.
+
+@item -z
+@itemx --notification=error
+Send mail about the status of the job if an error occurs. For many
+@code{uuxqt} daemons, including the Taylor UUCP @code{uuxqt}, this is
+the default action; for those, @samp{--notification=error} will have no
+effect. However, some @code{uuxqt} daemons will send mail if the job
+succeeds, unless the @samp{--notification=error} option is used. Some
+other @code{uuxqt} daemons will not send mail even if the job fails,
+unless the @samp{--notification=error} option is used.
+
+@item -a address
+@itemx --requestor address
+Report job status, as controlled by the @samp{--notification} option, to
+the specified mail address.
+
+@item -r
+@itemx --nouucico
+Do not start the @code{uucico} daemon immediately; merely queue up the
+execution request for later processing.
+
+@item -j
+@itemx --jobid
+Print the jobid on standard output. A jobid will be generated for each
+file copy operation required to execute the command. These file copies
+may be later cancelled by passing the jobid to the @samp{-kill} switch
+of @code{uustat}. @xref{Invoking uustat}. Cancelling any file copies
+will make it impossible to complete execution of the job.
+
+@item -x type
+@itemx --debug type
+@itemx -v
+@itemx --version
+@itemx --help
+@xref{Standard Options}.
+@end table
+
+@node uux Examples, , uux Options, Invoking uux
+@subsection uux Examples
+
+Here are some examples of using @code{uux}.
+
+@example
+uux -z - sys1!rmail user1
+@end example
+This will execute the command @samp{rmail user1} on the system
+@samp{sys1}, giving it as standard input whatever is given to @code{uux}
+as standard input. If a failure occurs, mail will be sent to the user
+who ran the command.
+
+@example
+uux 'diff -c sys1!~user1/file1 sys2!~user2/file2 >!file.diff'
+@end example
+This will fetch the two named files from system @samp{sys1} and system
+@samp{sys2} and execute @samp{diff}, putting the result in
+@file{file.diff} in the current directory on the local system. The
+current directory must be writable by the @code{uuxqt} daemon for this
+to work.
+
+@example
+uux 'sys1!uucp ~user1/file1 (sys2!~user2/file2)'
+@end example
+Execute @code{uucp} on the system @samp{sys1} copying @file{file1} (on
+system @samp{sys1}) to @samp{sys2}. This illustrates the use of
+parentheses for quoting.
+
+@node Invoking uustat, Invoking uuname, Invoking uux, Invoking the UUCP Programs
+@section Invoking uustat
+
+@menu
+* uustat Description:: Description of uustat
+* uustat Options:: Options Supported by uustat
+* uustat Examples:: Examples of uustat Usage
+@end menu
+
+@node uustat Description, uustat Options, Invoking uustat, Invoking uustat
+@subsection uustat Description
+
+@example
+uustat -a
+uustat --all
+uustat [-eKRiMNQ] [-sS system] [-uU user] [-cC command] [-oy hours]
+ [-B lines] [--executions] [--kill-all] [--rejuvenate-all]
+ [--prompt] [--mail] [--notify] [--no-list] [--system system]
+ [--not-system system] [--user user] [--not-user user]
+ [--command command] [--not-command command] [--older-than hours]
+ [--younger-than hours] [--mail-lines lines]
+uustat [-kr jobid] [--kill jobid] [--rejuvenate jobid]
+uustat -q [-sS system] [-oy hours] [--system system]
+ [--not-system system ] [--older-than hours] [--younger-than hours]
+uustat --list [-sS system] [-oy hours] [--system system ]
+ [--not-system system] [--older-than hours] [--younger-than hours]
+uustat -m
+uustat --status
+uustat -p
+uustat --ps
+@end example
+
+The @code{uustat} command can display various types of status
+information about the UUCP system. It can also be used to cancel or
+rejuvenate requests made by @code{uucp} or @code{uux}.
+
+With no options, @code{uustat} displays all jobs queued up for the
+invoking user, as if given the @samp{--user} option with the appropriate
+argument.
+
+If any of the @samp{-a}, @samp{--all}, @samp{-e}, @samp{--executions},
+@samp{-s}, @samp{--system}, @samp{-S}, @samp{--not-system}, @samp{-u},
+@samp{--user}, @samp{-U}, @samp{--not-user}, @samp{-c},
+@samp{--command}, @samp{-C}, @samp{--not-command}, @samp{-o},
+@samp{--older-than}, @samp{-y}, or @samp{--younger-than} options are
+given, then all jobs which match the combined specifications are
+displayed.
+
+The @samp{-K} or @samp{--kill-all} option may be used to kill off a
+selected group of jobs, such as all jobs more than 7 days old.
+
+@node uustat Options, uustat Examples, uustat Description, Invoking uustat
+@subsection uustat Options
+
+The following options may be given to @code{uustat}.
+
+@table @samp
+@item -a
+@itemx --all
+List all queued file transfer requests.
+
+@item -e
+@itemx --executions
+List queued execution requests rather than queued file transfer
+requests. Queued execution requests are processed by @code{uuxqt}
+rather than @code{uucico}. Queued execution requests may be waiting for
+some file to be transferred from a remote system. They are created by
+an invocation of @code{uux}.
+
+@item -s system
+@itemx --system system
+List all jobs queued up for the named system. These options may be
+specified multiple times, in which case all jobs for all the named
+systems will be listed. If used with @samp{--list}, only the systems
+named will be listed.
+
+@item -S system
+@itemx --not-system system
+List all jobs queued for systems other than the one named. These
+options may be specified multiple times, in which case no jobs from any
+of the specified systems will be listed. If used with @samp{--list},
+only the systems not named will be listed. These options may not be
+used with @samp{-s} or @samp{--system}.
+
+@item -u user
+@itemx --user user
+List all jobs queued up for the named user. These options may be
+specified multiple times, in which case all jobs for all the named users
+will be listed.
+
+@item -U user
+@itemx --not-user user
+List all jobs queued up for users other than the one named. These
+options may be specified multiple times, in which case no jobs from any
+of the specified users will be listed. These options may not be used
+with @samp{-u} or @samp{--user}.
+
+@item -c command
+@itemx --command command
+List all jobs requesting the execution of the named command. If
+@samp{command} is @samp{ALL} this will list all jobs requesting the
+execution of some command (as opposed to simply requesting a file
+transfer). These options may be specified multiple times, in which case
+all jobs requesting any of the commands will be listed.
+
+@item -C command
+@itemx --not-command command
+List all jobs requesting execution of some command other than the named
+command, or, if @samp{command} is @samp{ALL}, list all jobs that simply
+request a file transfer (as opposed to requesting the execution of some
+command). These options may be specified multiple times, in which case
+no job requesting one of the specified commands will be listed. These
+options may not be used with @samp{-c} or @samp{--command}.
+
+@item -o hours
+@itemx --older-than hours
+List all queued jobs older than the given number of hours. If used with
+@samp{--list}, only systems whose oldest job is older than the given
+number of hours will be listed.
+
+@item -y hours
+@itemx --younger-than hours
+List all queued jobs younger than the given number of hours. If used
+with @samp{--list}, only systems whose oldest job is younger than the
+given number of hours will be listed.
+
+@item -k jobid
+@itemx --kill jobid
+Kill the named job. The job id is shown by the default output format,
+as well as by the @samp{-j} or @samp{--jobid} options to @code{uucp} or
+@code{uux}. A job may only be killed by the user who created the job,
+or by the UUCP administrator, or the superuser. The @samp{-k} or
+@samp{--kill} options may be used multiple times on the command line to
+kill several jobs.
+
+@item -r jobid
+@itemx --rejuvenate jobid
+Rejuvenate the named job. This will mark it as having been invoked at
+the current time, affecting the output of the @samp{-o},
+@samp{--older-than}, @samp{-y}, or @samp{--younger-than} options,
+possibly preserving it from any automated cleanup daemon. The job id is
+shown by the default output format, as well as by the @samp{-j} or
+@samp{--jobid} options to @code{uucp} or @code{uux}. A job may only be
+rejuvenated by the user who created the job, or by the UUCP
+administrator, or the superuser. The @samp{-r} or @samp{--rejuvenate}
+options may be used multiple times on the command line to rejuvenate
+several jobs.
+
+@item -q
+@itemx --list
+Display the status of commands, executions and conversations for all
+remote systems for which commands or executions are queued. The
+@samp{-s}, @samp{--system}, @samp{-S}, @samp{--not-system}, @samp{-o},
+@samp{--older-than}, @samp{-y}, and @samp{--younger-than} options may be
+used to restrict the systems which are listed. Systems for which no
+commands or executions are queued will never be listed.
+
+@item -m
+@itemx --status
+Display the status of conversations for all remote systems.
+
+@item -p
+@itemx --ps
+Display the status of all processes holding UUCP locks on systems or
+ports.
+
+@need 500
+@item -i
+@itemx --prompt
+For each listed job, prompt whether to kill the job or not. If the
+first character of the input line is @kbd{y} or @kbd{Y}, the job will be
+killed.
+
+@item -K
+@itemx --kill-all
+Automatically kill each listed job. This can be useful for automatic
+cleanup scripts, in conjunction with the @samp{--mail} and
+@samp{--notify} options.
+
+@item -R
+@itemx --rejuvenate-all
+Automatically rejuvenate each listed job. This may not be used with
+@samp{--kill-all}.
+
+@item -M
+@itemx --mail
+For each listed job, send mail to the UUCP administrator. If the job is
+killed (due to @samp{--kill-all}, or @samp{--prompt} with an affirmative
+response) the mail will indicate that. A comment specified by the
+@samp{--comment} option may be included. If the job is an execution,
+the initial portion of its standard input will be included in the mail
+message; the number of lines to include may be set with the
+@samp{--mail-lines} option (the default is 100). If the standard input
+contains null characters, it is assumed to be a binary file and is not
+included.
+
+@item -N
+@itemx --notify
+For each listed job, send mail to the user who requested the job. The
+mail is identical to that sent by the @samp{-M} or @samp{--mail}
+options.
+
+@item -W comment
+@itemx --comment comment
+Specify a comment to be included in mail sent with the @samp{-M},
+@samp{--mail}, @samp{-N}, or @samp{--notify} options.
+
+@item -B lines
+@itemx --mail-lines lines
+When the @samp{-M}, @samp{--mail}, @samp{-N}, or @samp{--notify} options
+are used to send mail about an execution with standard input, this
+option controls the number of lines of standard input to include in the
+message. The default is 100.
+
+@item -Q
+@itemx --no-list
+Do not actually list the job, but only take any actions indicated by the
+@samp{-i}, @samp{--prompt}, @samp{-K}, @samp{--kill-all}, @samp{-M},
+@samp{--mail}, @samp{-N} or @samp{--notify} options.
+
+@item -x type
+@itemx --debug type
+@itemx -I file
+@itemx --config file
+@itemx -v
+@itemx --version
+@itemx --help
+@xref{Standard Options}.
+@end table
+
+@node uustat Examples, , uustat Options, Invoking uustat
+@subsection uustat Examples
+
+@example
+uustat --all
+@end example
+Display status of all jobs. A sample output line is as follows:
+@smallexample
+bugsA027h bugs ian 04-01 13:50 Executing rmail ian@@airs.com (sending 12 bytes)
+@end smallexample
+The format is
+@example
+jobid system user queue-date command (size)
+@end example
+The jobid may be passed to the @samp{--kill} or @samp{--rejuvenate}
+options. The size indicates how much data is to be transferred to the
+remote system, and is absent for a file receive request. The
+@samp{--system}, @samp{--not-system}, @samp{--user}, @samp{--not-user},
+@samp{--command}, @samp{--not-command}, @samp{--older-than}, and
+@samp{--younger-than} options may be used to control which jobs are
+listed.
+
+@example
+uustat --executions
+@end example
+Display status of queued up execution requests. A sample output line
+is as follows:
+@smallexample
+bugs bugs!ian 05-20 12:51 rmail ian
+@end smallexample
+The format is
+@example
+system requestor queue-date command
+@end example
+The @samp{--system}, @samp{--not-system}, @samp{--user},
+@samp{--not-user}, @samp{--command}, @samp{--not-command},
+@samp{--older-than}, and @samp{--younger-than} options may be used to
+control which requests are listed.
+
+@example
+uustat --list
+@end example
+Display status for all systems with queued up commands. A sample
+output line is as follows:
+@smallexample
+bugs 4C (1 hour) 0X (0 secs) 04-01 14:45 Dial failed
+@end smallexample
+This indicates the system, the number of queued commands, the age of the
+oldest queued command, the number of queued local executions, the age of
+the oldest queued execution, the date of the last conversation, and the
+status of that conversation.
+
+@example
+uustat --status
+@end example
+Display conversation status for all remote systems. A sample output
+line is as follows:
+@smallexample
+bugs 04-01 15:51 Conversation complete
+@end smallexample
+This indicates the system, the date of the last conversation, and the
+status of that conversation. If the last conversation failed,
+@code{uustat} will indicate how many attempts have been made to call the
+system. If the retry period is currently preventing calls to that
+system, @code{uustat} also displays the time when the next call will be
+permitted.
+
+@example
+uustat --ps
+@end example
+Display the status of all processes holding UUCP locks. The output
+format is system dependent, as @code{uustat} simply invokes @code{ps} on
+each process holding a lock.
+
+@example
+uustat -c rmail -o 168 -K -Q -M -N -W "Queued for over 1 week"
+@end example
+This will kill all @samp{rmail} commands that have been queued up
+waiting for delivery for over 1 week (168 hours). For each such
+command, mail will be sent both to the UUCP administrator and to the
+user who requested the rmail execution. The mail message sent will
+include the string given by the @samp{-W} option. The @samp{-Q} option
+prevents any of the jobs from being listed on the terminal, so any
+output from the program will be error messages.
+
+@node Invoking uuname, Invoking uulog, Invoking uustat, Invoking the UUCP Programs
+@section Invoking uuname
+
+@example
+uuname [-a] [--aliases]
+uuname -l
+uuname --local
+@end example
+
+By default, the @code{uuname} program simply lists the names of all the
+remote systems mentioned in the UUCP configuration files.
+
+The @code{uuname} program may also be used to print the UUCP name of the
+local system.
+
+The @code{uuname} program is mainly for use by shell scripts.
+
+The following options may be given to @code{uuname}.
+
+@table @samp
+@item -a
+@itemx --aliases
+List all aliases for remote systems, as well as their canonical names.
+Aliases may be specified in the @file{sys} file (@pxref{Naming the
+System}).
+
+@item -l
+@itemx --local
+Print the UUCP name of the local system, rather than listing the names
+of all the remote systems.
+
+@item -x type
+@itemx --debug type
+@itemx -I file
+@itemx --config file
+@itemx -v
+@itemx --version
+@itemx --help
+@xref{Standard Options}.
+@end table
+
+@node Invoking uulog, Invoking uuto, Invoking uuname, Invoking the UUCP Programs
+@section Invoking uulog
+
+@example
+uulog [-#] [-n lines] [-sf system] [-u user] [-DSF] [--lines lines]
+ [--system system] [--user user] [--debuglog] [--statslog]
+ [--follow] [--follow=system]
+@end example
+
+The @code{uulog} program may be used to display the UUCP log file.
+Different options may be used to select which parts of the file to
+display.
+
+@table @samp
+@item -#
+@itemx -n lines
+@itemx --lines lines
+Here @samp{#} is a number; e.g., @samp{-10}. The specified number of
+lines is displayed from the end of the log file. The default is to
+display the entire log file, unless the @samp{-f}, @samp{-F}, or
+@samp{--follow} options are used, in which case the default is to
+display 10 lines.
+
+@item -s system
+@itemx --system system
+Display only log entries pertaining to the specified system.
+
+@item -u user
+@itemx --user user
+Display only log entries pertaining to the specified user.
+
+@item -D
+@itemx --debuglog
+Display the debugging log file.
+
+@item -S
+@itemx --statslog
+Display the statistics log file.
+
+@item -F
+@itemx --follow
+Keep displaying the log file forever, printing new lines as they are
+appended to the log file.
+
+@item -f system
+@itemx --follow=system
+Keep displaying the log file forever, displaying only log entries
+pertaining to the specified system.
+
+@item -X type
+@itemx --debug type
+@itemx -I file
+@itemx --config file
+@itemx -v
+@itemx --version
+@itemx --help
+@xref{Standard Options}. Note that @code{uulog} specifies the debugging
+type using @samp{-X} rather than the usual @samp{-x}.
+@end table
+
+The operation of @code{uulog} depends to some degree upon the type of
+log files generated by the UUCP programs. This is a compile time
+option. If the UUCP programs have been compiled to use HDB style log
+files, @code{uulog} changes in the following ways:
+
+@itemize @bullet
+@item
+The new options @samp{-x} and @samp{--uuxqtlog} may be used to list the
+@code{uuxqt} log file.
+
+@item
+It is no longer possible to omit all arguments: one of @samp{-s},
+@samp{--system}, @samp{-f}, @samp{--follow=system}, @samp{-D},
+@samp{--debuglog}, @samp{-S}, @samp{--statslog}, @samp{-x}, or
+@samp{--uuxqtlog} must be used.
+
+@item
+The option @samp{--system ANY} may be used to list log file entries
+which do not pertain to any particular system.
+@end itemize
+
+@node Invoking uuto, Invoking uupick, Invoking uulog, Invoking the UUCP Programs
+@section Invoking uuto
+
+@example
+uuto files... system!user
+@end example
+
+The @code{uuto} program may be used to conveniently send files to a
+particular user on a remote system. It will arrange for mail to be sent
+to the remote user when the files arrive on the remote system, and he or
+she may easily retrieve the files using the @code{uupick} program
+(@pxref{Invoking uupick}). Note that @code{uuto} does not provide any
+security---any user on the remote system can examine the files.
+
+The last argument specifies the system and user name to which to send
+the files. The other arguments are the files or directories to be sent.
+
+The @code{uuto} program is actually just a trivial shell script which
+invokes the @code{uucp} program with the appropriate arguments. Any
+option which may be given to @code{uucp} may also be given to
+@code{uuto}. @xref{Invoking uucp}.
+
+@need 2000
+@node Invoking uupick, Invoking cu, Invoking uuto, Invoking the UUCP Programs
+@section Invoking uupick
+
+@example
+uupick [-s system] [--system system]
+@end example
+
+The @code{uupick} program is used to conveniently retrieve files
+transferred by the @code{uuto} program.
+
+For each file transferred by @code{uuto}, @code{uupick} will display the
+source system, the file name, and whether the name refers to a regular
+file or a directory. It will then wait for the user to specify an
+action to take. One of the following commands must be entered:
+
+@table @samp
+@item q
+Quit out of @code{uupick}.
+
+@item RETURN
+Skip the file.
+
+@item m [directory]
+Move the file or directory to the specified directory. If no directory
+is specified, the file is moved to the current directory.
+
+@item a [directory]
+Move all files from this system to the specified directory. If no
+directory is specified, the files are moved to the current directory.
+
+@item p
+List the file on standard output.
-@node Compilation, Testing, Configuration, Overall Installation
+@item d
+Delete the file.
+
+@item ! [command]
+Execute @samp{command} as a shell escape.
+@end table
+
+The @samp{-s} or @samp{--system} option may be used to restrict
+@code{uupick} to only present files transferred from a particular
+system. The @code{uupick} program also supports the standard UUCP
+program options; see @ref{Standard Options}.
+
+@need 2000
+@node Invoking cu, Invoking uucico, Invoking uupick, Invoking the UUCP Programs
+@section Invoking cu
+
+@menu
+* cu Description:: Description of cu
+* cu Commands:: Commands Supported by cu
+* cu Variables:: Variables Supported by cu
+* cu Options:: Options Supported by cu
+@end menu
+
+@node cu Description, cu Commands, Invoking cu, Invoking cu
+@subsection cu Description
+
+@example
+cu [options] [system | phone | "dir"]
+@end example
+
+The @code{cu} program is used to call up another system and act as a
+dial in terminal. It can also do simple file transfers with no error
+checking.
+
+The @code{cu} program takes a single non-option argument.
+
+If the argument is the string @samp{dir} cu will make a direct
+connection to the port. This may only be used by users with write
+access to the port, as it permits reprogramming the modem.
+
+Otherwise, if the argument begins with a digit, it is taken to be a
+phone number to call.
+
+Otherwise, it is taken to be the name of a system to call.
+
+The @samp{-z} or @samp{--system} options may be used to name a system
+beginning with a digit, and the @samp{-c} or @samp{--phone} options may
+be used to name a phone number that does not begin with a digit.
+
+The @code{cu} program locates a port to use in the UUCP configuration
+files. If a simple system name is given, it will select a port
+appropriate for that system. The @samp{-p}, @samp{--port}, @samp{-l},
+@samp{--line}, @samp{-s}, and @samp{--speed} options may be used to
+control the port selection.
+
+When a connection is made to the remote system, @code{cu} forks into two
+processes. One reads from the port and writes to the terminal, while
+the other reads from the terminal and writes to the port.
+
+@node cu Commands, cu Variables, cu Description, Invoking cu
+@subsection cu Commands
+
+The @code{cu} program provides several commands that may be used during
+the conversation. The commands all begin with an escape character,
+which by default is @kbd{~} (tilde). The escape character is only
+recognized at the beginning of a line. To send an escape character to
+the remote system at the start of a line, it must be entered twice. All
+commands are either a single character or a word beginning with @kbd{%}
+(percent sign).
+
+The @code{cu} program recognizes the following commands.
+
+@table @samp
+@item ~.
+Terminate the conversation.
+
+@item ~! command
+Run command in a shell. If command is empty, starts up a shell.
+
+@item ~$ command
+Run command, sending the standard output to the remote system.
+
+@item ~| command
+Run command, taking the standard input from the remote system.
+
+@item ~+ command
+Run command, taking the standard input from the remote system and
+sending the standard output to the remote system.
+
+@item ~#, ~%break
+Send a break signal, if possible.
+
+@item ~c directory, ~%cd directory
+Change the local directory.
+
+@item ~> file
+Send a file to the remote system. This just dumps the file over the
+communication line. It is assumed that the remote system is expecting
+it.
+
+@item ~<
+Receive a file from the remote system. This prompts for the local file
+name and for the remote command to execute to begin the file transfer.
+It continues accepting data until the contents of the @samp{eofread}
+variable are seen.
+
+@item ~p from to
+@itemx ~%put from to
+Send a file to a remote Unix system. This runs the appropriate
+commands on the remote system.
+
+@item ~t from to
+@itemx ~%take from to
+Retrieve a file from a remote Unix system. This runs the appropriate
+commands on the remote system.
+
+@item ~s variable value
+Set a @code{cu} variable to the given value. If value is not given, the
+variable is set to @samp{true}.
+
+@item ~! variable
+Set a @code{cu} variable to @samp{false}.
+
+@item ~z
+Suspend the cu session. This is only supported on some systems. On
+systems for which @kbd{^Z} may be used to suspend a job, @samp{~^Z} will
+also suspend the session.
+
+@item ~%nostop
+Turn off XON/XOFF handling.
+
+@item ~%stop
+Turn on XON/XOFF handling.
+
+@item ~v
+List all the variables and their values.
+
+@item ~?
+List all commands.
+@end table
+
+@node cu Variables, cu Options, cu Commands, Invoking cu
+@subsection cu Variables
+
+The @code{cu} program also supports several variables. They may be
+listed with the @samp{~v} command, and set with the @samp{~s} or
+@samp{~!} commands.
+
+@table @samp
+@item escape
+The escape character. The default is @kbd{~} (tilde).
+
+@item delay
+If this variable is true, @code{cu} will delay for a second, after
+recognizing the escape character, before printing the name of the local
+system. The default is true.
+
+@item eol
+The list of characters which are considered to finish a line. The
+escape character is only recognized after one of these is seen. The
+default is @kbd{carriage return}, @kbd{^U}, @kbd{^C}, @kbd{^O},
+@kbd{^D}, @kbd{^S}, @kbd{^Q}, @kbd{^R}.
+
+@item binary
+Whether to transfer binary data when sending a file. If this is false,
+then newlines in the file being sent are converted to carriage returns.
+The default is false.
+
+@item binary-prefix
+A string used before sending a binary character in a file transfer, if
+the @samp{binary} variable is true. The default is @samp{^V}.
+
+@item echo-check
+Whether to check file transfers by examining what the remote system
+echoes back. This probably doesn't work very well. The default is
+false.
+
+@item echonl
+The character to look for after sending each line in a file. The
+default is carriage return.
+
+@item timeout
+The timeout to use, in seconds, when looking for a character, either
+when doing echo checking or when looking for the @samp{echonl}
+character. The default is 30.
+
+@item kill
+The character to use delete a line if the echo check fails. The default
+is @kbd{^U}.
+
+@item resend
+The number of times to resend a line if the echo check continues to
+fail. The default is 10.
+
+@item eofwrite
+The string to write after sending a file with the @samp{~>} command.
+The default is @samp{^D}.
+
+@item eofread
+The string to look for when receiving a file with the @samp{ ~<}
+command. The default is @samp{$}, which is intended to be a typical
+shell prompt.
+
+@item verbose
+Whether to print accumulated information during a file transfer. The
+default is true.
+@end table
+
+@node cu Options, , cu Variables, Invoking cu
+@subsection cu Options
+
+The following options may be given to @code{cu}.
+
+@table @samp
+@item -e
+@itemx --parity=even
+Use even parity.
+
+@item -o
+@itemx --parity=odd
+Use odd parity.
+
+@item --parity=none
+Use no parity. No parity is also used if both @samp{-e} and @samp{-o}
+are given.
+
+@item -h
+@itemx --halfduplex
+Echo characters locally (half-duplex mode).
+
+@item --nostop
+Turn off XON/XOFF handling (it is on by default).
+
+@item -E char
+@itemx --escape char
+Set the escape character. Initially @kbd{~} (tilde). To eliminate the
+escape character, use @samp{-E ''}.
+
+@item -z system
+@itemx --system system
+The system to call.
+
+@item -c phone-number
+@itemx --phone phone-number
+The phone number to call.
+
+@item -p port
+@itemx -a port
+@itemx --port port
+Name the port to use.
+
+@item -l line
+@itemx --line line
+Name the line to use by giving a device name. This may be used to dial
+out on ports that are not listed in the UUCP configuration files. Write
+access to the device is required.
+
+@item -s speed
+@itemx -#
+@itemx --speed speed
+The speed (baud rate) to use. Here, @samp{-#} means an actual number;
+e.g., @samp{-9600}.
+
+@item -n
+@itemx --prompt
+Prompt for the phone number to use.
+
+@item -d
+Enter debugging mode. Equivalent to @samp{--debug all}.
+
+@item -x type
+@itemx --debug type
+@itemx -I file
+@itemx --config file
+@itemx -v
+@itemx --version
+@itemx --help
+@xref{Standard Options}.
+@end table
+
+@node Invoking uucico, Invoking uuxqt, Invoking cu, Invoking the UUCP Programs
+@section Invoking uucico
+
+@menu
+* uucico Description:: Description of uucico
+* uucico Options:: Options Supported by uucico
+@end menu
+
+@node uucico Description, uucico Options, Invoking uucico, Invoking uucico
+@subsection uucico Description
+
+@example
+uucico [options]
+@end example
+
+The @code{uucico} daemon processes file transfer requests queued by
+@code{uucp} and @code{uux}. It is started when @code{uucp} or
+@code{uux} is run (unless they are given the @samp{-r} or
+@samp{--nouucico} options). It is also typically started periodically
+using entries in the @file{crontab} table(s).
+
+When @code{uucico} is invoked with @samp{-r1}, @samp{--master},
+@samp{-s}, @samp{--system}, or @samp{-S}, the daemon will place a call
+to a remote system, running in master mode. Otherwise the daemon will
+start in slave mode, accepting a call from a remote system. Typically a
+special login name will be set up for UUCP which automatically invokes
+@code{uucico} when a remote system calls in and logs in under that name.
+
+When @code{uucico} terminates, it invokes the @code{uuxqt} daemon,
+unless the @samp{-q} or @samp{--nouuxqt} options were given;
+@code{uuxqt} executes any work orders created by @code{uux} on a remote
+system, and any work orders created locally which have received remote
+files for which they were waiting.
+
+If a call fails, @code{uucico} will normally refuse to retry the call
+until a certain (configurable) amount of time has passed. This may be
+overriden by the @samp{-f}, @samp{--force}, or @samp{-S} options.
+
+The @samp{-l}, @samp{--prompt}, @samp{-e}, or @samp{--loop} options may
+be used to force @code{uucico} to produce its own prompts of
+@samp{login: } and @samp{Password:}. When another @code{uucico} daemon
+calls in, it will see these prompts and log in as usual. The login name
+and password will normally be checked against a separate list kept
+specially for @code{uucico}, rather than the @file{/etc/passwd} file
+(@pxref{Configuration File Names}). It is possible, on some systems, to
+configure @code{uucico} to use @file{/etc/passwd}. The @samp{-l} or
+@samp{--prompt} options will prompt once and then exit; in this mode the
+UUCP administrator, or the superuser, may use the @samp{-u} or
+@samp{--login} option to force a login name, in which case @code{uucico}
+will not prompt for one. The @samp{-e} or @samp{--loop} options will
+prompt again after the first session is over; in this mode @code{uucico}
+will permanently control a port.
+
+If @code{uucico} receives a @code{SIGQUIT}, @code{SIGTERM} or
+@code{SIGPIPE} signal, it will cleanly abort any current conversation
+with a remote system and exit. If it receives a @code{SIGHUP} signal it
+will abort any current conversation, but will continue to place calls to
+(if invoked with @samp{-r1} or @samp{--master}) and accept calls from
+(if invoked with @samp{-e} or @samp{--loop}) other systems. If it
+receives a @code{SIGINT} signal it will finish the current conversation,
+but will not place or accept any more calls.
+
+@node uucico Options, , uucico Description, Invoking uucico
+@subsection uucico Options
+
+The following options may be given to @code{uucico}.
+
+@table @samp
+@item -r1
+@itemx --master
+Start in master mode: call out to a remote system. Implied by
+@samp{-s}, @samp{--system}, or @samp{-S}. If no system is specified,
+sequentially call every system for which work is waiting to be done.
+
+@item -r0
+@itemx --slave
+Start in slave mode. This is the default.
+
+@item -s system
+@itemx --system system
+Call the specified system.
+
+@item -S system
+Call the specified system, ignoring any required wait. This is
+equivalent to @samp{-s system -f}.
+
+@item -f
+@itemx --force
+Ignore any required wait for any systems to be called.
+
+@item -l
+@itemx --prompt
+Prompt for login name and password using @samp{login: } and
+@samp{Password:}. This allows @code{uucico} to be easily run from
+@code{inetd}. The login name and password are checked against the UUCP
+password file, which need not be @file{/etc/passwd}. The @samp{--login}
+option may be used to force a login name, in which cause @code{uucico}
+will only prompt for a password.
+
+@item -p port
+@itemx --port port
+Specify a port to call out on or to listen to.
+
+@item -e
+@itemx --loop
+Enter an endless loop of login/password prompts and slave mode daemon
+execution. The program will not stop by itself; you must use
+@code{kill} to shut it down.
+
+@item -w
+@itemx --wait
+After calling out (to a particular system when @samp{-s},
+@samp{--system}, or @samp{-S} is specifed, or to all systems which have
+work when just @samp{-r1} or @samp{--master} is specifed), begin an
+endless loop as with @samp{--loop}.
+
+@item -q
+@itemx --nouuxqt
+Do not start the @code{uuxqt} daemon when finished.
+
+@item -c
+@itemx --quiet
+If no calls are permitted at this time, then don't make the call, but
+also do not put an error message in the log file and do not update the
+system status (as reported by @code{uustat}). This can be convenient
+for automated polling scripts, which may want to simply attempt to call
+every system rather than worry about which particular systems may be
+called at the moment. This option also suppresses the log message
+indicating that there is no work to be done.
+
+@item -C
+@itemx --ifwork
+Only call the system named by @samp{-s}, @samp{--system}, or @samp{-S}
+if there is work for that system.
+
+@item -D
+@itemx --nodetach
+Do not detach from the controlling terminal. Normally @code{uucico}
+detaches from the terminal before each call out to another system and
+before invoking @code{uuxqt}. This option prevents this.
+
+@item -u name
+@itemx --login name
+Set the login name to use instead of that of the invoking user. This
+option may only be used by the UUCP administrator or the superuser. If
+used with @samp{--prompt}, this will cause @code{uucico} to prompt only
+for the password, not the login name.
+
+@item -z
+@itemx --try-next
+If a call fails after the remote system is reached, try the next
+alternate rather than simply exiting.
+
+@item -i type
+@itemx --stdin type
+Set the type of port to use when using standard input. The only
+supported port type is TLI, and this is only available on machines which
+support the TLI networking interface. Specifying @samp{-i TLI} causes
+@code{uucico} to use TLI calls to perform I/O.
+
+@item -X type
+Same as the standard option @samp{-x type}. Provided for historical
+compatibility.
+
+@item -x type
+@itemx --debug type
+@itemx -I file
+@itemx --config file
+@itemx -v
+@itemx --version
+@itemx --help
+@xref{Standard Options}.
+@end table
+
+@node Invoking uuxqt, Invoking uuchk, Invoking uucico, Invoking the UUCP Programs
+@section Invoking uuxqt
+
+@example
+uuxqt [-c command] [-s system] [--command command] [--system system]
+@end example
+
+The @code{uuxqt} daemon executes commands requested by @code{uux} from
+either the local system or from remote systems. It is started
+automatically by the @code{uucico} daemon (unless @code{uucico} is given
+the @samp{-q} or @samp{--nouuxqt} options).
+
+There is normally no need to run @code{uuxqt}, since it will be invoked
+by @code{uucico}. However, @code{uuxqt} can be invoked directly to
+provide greater control over the processing of the work queue.
+
+Multiple invocations of @code{uuxqt} may be run at once, as controlled
+by the @code{max-uuxqts} configuration command; see @ref{Miscellaneous
+(config)}.
+
+The following options may be given to @code{uuxqt}.
+
+@table @samp
+@item -c command
+@itemx --command command
+Only execute requests for the specified command. For example,
+@samp{uuxqt --command rmail}.
+
+@item -s system
+@itemx --system system
+Only execute requests originating from the specified system.
+
+@item -x type
+@itemx --debug type
+@itemx -I file
+@itemx --config
+@itemx -v
+@itemx --version
+@itemx --help
+@xref{Standard Options}.
+@end table
+
+@node Invoking uuchk, Invoking uuconv, Invoking uuxqt, Invoking the UUCP Programs
+@section Invoking uuchk
+
+@example
+uuchk [-s system] [--system system]
+@end example
+
+The @code{uuchk} program displays information read from the UUCP
+configuration files. It should be used to ensure that UUCP has been
+configured correctly.
+
+The @samp{-s} or @samp{--system} options may be used to display the
+configuration for just the specified system, rather than for all
+systems. The @code{uuchk} program also supports the standard UUCP
+program options; see @ref{Standard Options}.
+
+@need 2000
+@node Invoking uuconv, Invoking uusched, Invoking uuchk, Invoking the UUCP Programs
+@section Invoking uuconv
+
+@example
+uuconv -i type -o type [-p program] [--program program]
+uuconv --input type --output type [-p program] [--program program]
+@end example
+
+The @code{uuconv} program converts UUCP configuration files from one
+format to another. The type of configuration file to read is specified
+using the @samp{-i} or @samp{--input} options. The type of
+configuration file to write is specified using the @samp{-o} or
+@samp{--output} options.
+
+The supported configuration file types are @samp{taylor}, @samp{v2}, and
+@samp{hdb}. For a description of the @samp{taylor} configuration files,
+see @ref{Configuration Files}. The other types of configuration files
+are used by traditional UUCP packages, and are not described in this
+manual.
+
+An input configuration of type @samp{v2} or @samp{hdb} is read from a
+compiled in directory (specified by @samp{oldconfigdir} in
+@file{Makefile}). An input configuration of type @samp{taylor} is read
+from a compiled in directory by default, but may be overridden with the
+standard @samp{-I} or @samp{--config} options (@pxref{Standard
+Options}).
+
+The output configuration is written to files in the directory in which
+@code{uuconv} is run.
+
+Some information in the input files may not be representable in the
+desired output format, in which case @code{uuconv} will silently discard
+it. The output of @code{uuconv} should be carefully checked before it
+is used. The @code{uuchk} program may be used for this purpose; see
+@ref{Invoking uuchk}.
+
+The @samp{-p} or @samp{--program} option may be used to convert specific
+@code{cu} configuration information, rather than the default of only
+converting the @code{uucp} configuration information; see @ref{config
+File}.
+
+The @code{uuchk} program also supports the standard UUCP program
+options; see @ref{Standard Options}.
+
+@node Invoking uusched, , Invoking uuconv, Invoking the UUCP Programs
+@section Invoking uusched
+
+The @code{uusched} program is actually just a shell script which invokes
+the @code{uucico} daemon. It is provided for backward compatibility.
+It causes @code{uucico} to call all systems for which there is work.
+Any option which may be given to @code{uucico} may also be given to
+@code{uusched}. @xref{Invoking uucico}.
+
+@node Installing Taylor UUCP, Using Taylor UUCP, Invoking the UUCP Programs, Top
+@chapter Installing Taylor UUCP
+
+These are the installation instructions for the Taylor UUCP package.
+
+@menu
+* Compilation:: Compiling Taylor UUCP
+* Testing the Compilation:: Testing the Compilation
+* Installing the Binaries:: Installing the Binaries
+* Configuration:: Configuring Taylor UUCP
+* Testing the Installation:: Testing the Installation
+@end menu
+
+@node Compilation, Testing the Compilation, Installing Taylor UUCP, Installing Taylor UUCP
@section Compiling Taylor UUCP
+If you have a source code distribution, you must first compile it for
+your system. Free versions of Unix, such as Linux, NetBSD, or FreeBSD,
+often come with pre-compiled binary distributions of UUCP. If you are
+using a binary distribution, you may skip to the configuration section
+(@pxref{Configuration}).
+
+Follow these steps to compile the source code.
+
@enumerate
@item
@@ -515,16 +2032,11 @@ Libraries to pass to the C compiler. If this is not set,
The program to run to install UUCP in the binary directory. If this is
not set, then if @code{configure} finds the BSD @code{install} program,
it will set this to @samp{install -c}; otherwise, it will use @samp{cp}.
-@item INSTALLDATA
-The program to run to install UUCP data files, such as the man pages and
-the info pages. If this is not set, then if @code{configure} finds the
-BSD @code{install} program, it will set this to @samp{install -c -m
-644}; otherwise, it will use @samp{cp}.
@end table
-Suppose you want to set the environment variable @samp{CC} to
-@samp{rcc}. If you are using @code{sh} or @code{bash}, invoke
-@code{configure} as @samp{CC=rcc configure}. If you are using
+Suppose, for example, you want to set the environment variable @samp{CC}
+to @samp{rcc}. If you are using @code{sh}, @code{bash}, or @code{ksh},
+invoke @code{configure} as @samp{CC=rcc configure}. If you are using
@code{csh}, do @samp{setenv CC rcc; sh configure}.
On some systems you will want to use @samp{LIBS=-lmalloc}. On Xenix
@@ -544,24 +2056,25 @@ characters, and set them correctly for your system.
Igor V. Semenyuk provided this (lightly edited) note about ISC Unix 3.0.
The @code{configure} script will default to passing @samp{-posix} to
@code{gcc}. However, using @samp{-posix} changes the environment to
-POSIX, and on ISC 3.0, at least, the default for POSIX_NO_TRUNC is 1.
-This means nothing for uucp, but can lead to a problem when uuxqt
-executes rmail. IDA sendmail has dbm configuration files named
+POSIX, and on ISC 3.0, at least, the default for @code{POSIX_NO_TRUNC}
+is 1. This can lead to a problem when @code{uuxqt} executes
+@code{rmail}. @code{IDA sendmail} has dbm configuration files named
@file{mailertable.@{dir,pag@}}. Notice these names are 15 characters
-long. When uuxqt compiled with @samp{-posix} executes rmail, which in
-turn executes sendmail, the later is run under POSIX environment too!
-This leads to sendmail bombing out with @samp{'error opening 'M'
-database: name too long' (mailertable.dir)}. It's rather obscure
-behaviour, and it took me a day to find out the cause. I don't use
-@samp{-posix}, instead I run @code{gcc} with @samp{-D_POSIX_SOURCE}, and
-add @samp{-lcposix} to @samp{LIBS}.
+long. When @code{uuxqt} compiled with the @samp{-posix} executes
+@code{rmail}, which in turn executes @code{sendmail}, the later is run
+under the POSIX environment too. This leads to @code{sendmail} bombing
+out with @samp{'error opening 'M' database: name too long'
+(mailertable.dir)}. It's rather obscure behaviour, and it took me a day
+to find out the cause. I don't use the @samp{-posix} switch; instead, I
+run @code{gcc} with @samp{-D_POSIX_SOURCE}, and add @samp{-lcposix} to
+@samp{LIBS}.
@item
On some versions of BSDI there is a bug in the shell which causes the
default value for @samp{CFLAGS} to be set incorrectly. If @samp{echo
$@{CFLAGS--g@}} echoes @samp{g} rather than @samp{-g}, then you must set
@samp{CFLAGS} in the environment before running configure. There is a
-patch available from BSDI for this bug. (From David Vrona).
+patch available from BSDI for this bug. (Reported by David Vrona).
@item
On AIX 3.2.5, and possibly other versions, @samp{cc -E} does not work,
@@ -570,24 +2083,35 @@ running configure by doing something like @samp{touch /tmp/foo.c; cc -E
/tmp/foo.c}. This may give a warning about the file being empty, but it
should not give the @samp{Option NOROCONST} warning. The workaround is
to remove the @samp{,noroconst} entry from the @samp{options} clause in
-the @samp{cc} stanza in @file{/etc/xlc.cfg}. (From Chris Lewis).
+the @samp{cc} stanza in @file{/etc/xlc.cfg}. (Reported by Chris Lewis).
@item
You should verify that @code{configure} worked correctly by checking
@file{config.h} and the instances of @file{Makefile}.
@item
-Edit @file{policy.h} for your local system. The comments should explain
-the various choices. The default values are intended to be reasonable,
-so you may not have to make any changes.
+Edit @file{policy.h} for your local system. The comments explain the
+various choices. The default values are intended to be reasonable, so
+you may not have to make any changes.
+
+You must decide what type of configuration files to use; for more
+information on the choices, see @ref{Configuration}.
+
+You must also decide what sort of spool directory you want to use. If
+this is a new installation, I recommend @samp{SPOOLDIR_TAYLOR};
+otherwise, select the spool directory corresponding to your existing
+UUCP package.
@item
-Type @samp{make} to compile everything. The @file{tstuu.c} file is not
-particularly portable; if you can't figure out how to compile it you can
-safely ignore it, as it is only used for testing (to use STREAMS
-pseudo-terminals, tstuu.c must be compiled with
-@samp{-DHAVE_STREAMS_PTYS}; this is not automatically determined at the
-moment). If you have any other problems there is probably a bug in the
+Type @samp{make} to compile everything.
+
+The @file{tstuu.c} file is not particularly portable; if you can't
+figure out how to compile it you can safely ignore it, as it is only
+used for testing. To use STREAMS pseudo-terminals, tstuu.c must be
+compiled with @samp{-DHAVE_STREAMS_PTYS}; this is not determined by the
+configure script.
+
+If you have any other problems there is probably a bug in the
@code{configure} script.
@item
@@ -597,54 +2121,46 @@ just ask for help.
@end enumerate
-@node Testing, Installation, Compilation, Overall Installation
-@section Testing Taylor UUCP
-
-This package is in use at hundreds, perhaps thousands, of sites, and has
-been running at @file{airs.com} for several years. However, it will
-doubtless fail in some situations. Do not rely on this code until you
-have proven to yourself that it will work.
-
-You can use the @code{uuchk} program to test your configuration files.
-It will read them and print out a verbose description. This program
-should not be made setuid, because it will display passwords if it can
-read them.
+@node Testing the Compilation, Installing the Binaries, Compilation, Installing Taylor UUCP
+@section Testing the Compilation
If your system supports pseudo-terminals, and you compiled the code to
-support the new style of configuration files, you should be able to use
-the @code{tstuu} program to test the @code{uucico} daemon (if your
-system supports STREAMS based pseudo-terminals, you must compile tstuu.c
-with @samp{-DHAVE_STREAMS_PTYS}, at least at the moment; the STREAMS
-based code was contributed by Marc Boucher).
-
-To run @code{tstuu}, just type @samp{tstuu} with no arguments while
-logged in to the compilation directory (since it runs @file{./uucp},
-@file{./uux} and @file{./uucico}). It will run a lengthy series of
-tests (it takes over ten minutes on a slow VAX). You will need a fair
-amount of space available in @file{/usr/tmp}. You will probably want to
-put it in the background. Do not use @kbd{^Z}, because the program
-traps on @code{SIGCHLD} and winds up dying. It will create a directory
-@file{/usr/tmp/tstuu} and fill it with configuration files, and create
-spool directories @file{/usr/tmp/tstuu/spool1} and
-@file{/usr/tmp/tstuu/spool2}.
+support the new style of configuration files (@code{HAVE_TAYLOR_CONFIG}
+was set to 1 in @file{policy.h}), you should be able to use the
+@code{tstuu} program to test the @code{uucico} daemon. If your system
+supports STREAMS based pseudo-terminals, you must compile tstuu.c with
+@samp{-DHAVE_STREAMS_PTYS}. (The STREAMS based code was contributed by
+Marc Boucher).
+
+To run @code{tstuu}, just type @samp{tstuu} with no arguments. You must
+run it in the compilation directory, since it runs @file{./uucp},
+@file{./uux} and @file{./uucico}. The @code{tstuu} program will run a
+lengthy series of tests (it takes over ten minutes on a slow VAX). You
+will need a fair amount of space available in @file{/usr/tmp}. You will
+probably want to put it in the background. Do not use @kbd{^Z}, because
+the program traps on @code{SIGCHLD} and winds up dying. The
+@code{tstuu} program will create a directory @file{/usr/tmp/tstuu} and
+fill it with configuration files, and create spool directories
+@file{/usr/tmp/tstuu/spool1} and @file{/usr/tmp/tstuu/spool2}.
If your system does not support the @code{FIONREAD} call, the
@samp{tstuu} program will run very slowly. This may or may not get
fixed in a later version.
-The program will finish with an execute file named
+The @code{tstuu} program will finish with an execute file named
@file{X.@var{something}} and a data file named @file{D.@var{something}}
in the directory @file{/usr/tmp/tstuu/spool1} (or, more likely, in
subdirectories, depending on the choice of @code{SPOOLDIR} in
@file{policy.h}). Two log files will be created in the directory
@file{/usr/tmp/tstuu}. They will be named @file{Log1} and @file{Log2},
or, if you have selected @code{HAVE_HDB_LOGGING} in @file{policy.h},
-@file{Log1/uucico/test2} and @file{Log2/uucico/test1}. You can test
-@code{uuxqt} by running the command @samp{./uuxqt -I
-/usr/tmp/tstuu/Config1}. This should leave a command file
-@file{C.@var{something}} and a data file @file{D.@var{something}} in
-@file{/usr/tmp/tstuu/spool1} or in subdirectories. Again, there should
-be no errors in the log file.
+@file{Log1/uucico/test2} and @file{Log2/uucico/test1}. There should be
+no errors in the log files.
+
+You can test @code{uuxqt} with @samp{./uuxqt -I /usr/tmp/tstuu/Config1}.
+This should leave a command file @file{C.@var{something}} and a data
+file @file{D.@var{something}} in @file{/usr/tmp/tstuu/spool1} or in
+subdirectories. Again, there should be no errors in the log file.
Assuming you compiled the code with debugging enabled, the @samp{-x}
switch can be used to set debugging modes; see the @code{debug} command
@@ -675,70 +2191,141 @@ to keep them from starting @code{uucico}) to make sure they create the
right sorts of files. Unfortunately, if you don't know what the right
sorts of files are, I'm not going to tell you here.
-If @code{tstuu} passes, or you can't run it for some reason or other,
-move on to testing with some other system. Set up the configuration
-files (@pxref{Configuration Files}), or use an existing configuration.
+If you can not run @code{tstuu}, or if it fails inexplicably, don't
+worry about it too much. On some systems @code{tstuu} will fail because
+of problems using pseudo terminals, which will not matter in normal use.
+The real test of the package is talking to another system.
+
+@node Installing the Binaries, Configuration, Testing the Compilation, Installing Taylor UUCP
+@section Installing the Binaries
+
+You can install the executable files by becoming @code{root} and typing
+@samp{make install}. Or you can look at what @samp{make install} does
+and do it by hand. It tries to preserve your old programs, if any, but
+it only does this the first time Taylor UUCP is installed (so that if
+you install several versions of Taylor UUCP, you can still go back to
+your original UUCP programs). You can retrieve the original programs by
+typing @samp{make uninstall}.
+
+Note that by default the programs are compiled with debugging
+information, and they are not stripped when they are installed. You may
+want to strip the installed programs to save disk space. For more
+information, see your system documentation for the @code{strip} program.
+
+Of course, simply installing the executable files is not enough. You
+must also arrange for them to be used correctly.
+
+@node Configuration, Testing the Installation, Installing the Binaries, Installing Taylor UUCP
+@section Configuring Taylor UUCP
+
+You will have to decide what types of configuration files you want to
+use. This package supports a new sort of configuration file; see
+@ref{Configuration Files}. It also supports V2 configuration files
+(@file{L.sys}, @file{L-devices}, etc.) and HDB configuration files
+(@file{Systems}, @file{Devices}, etc.). No documentation is provided
+for V2 or HDB configuration files. All types of configuration files can
+be used at once, if you are so inclined. Currently using just V2
+configuration files is not really possible, because there is no way to
+specify a dialer (there are no built in dialers, and the program does
+not know how to read @file{acucap} or @file{modemcap}); however, V2
+configuration files can be used with a new style dial file (@pxref{dial
+File}), or with a HDB @file{Dialers} file.
+
+Use of HDB configuration files has two known bugs. A blank line in the
+middle of an entry in the @file{Permissions} file will not be ignored as
+it should be. Dialer programs, as found in some versions of HDB, are
+not recognized directly. If you must use a dialer program, rather than
+an entry in @file{Devices}, you must use the @code{chat-program} command
+in a new style dial file; see @ref{dial File}. You will have to invoke
+the dialer program via a shell script or another program, since an exit
+code of 0 is required to recognize success; the @code{dialHDB} program
+in the @file{contrib} directory may be used for this purpose.
+
+The @code{uuconv} (@pxref{Invoking uuconv}) program can be used to
+convert from V2 or HDB configuration files to the new style (it can also
+do the reverse translation, if you are so inclined). It will not do all
+of the work, and the results should be carefully checked, but it can be
+quite useful.
+
+If you are installing a new system, you will, of course, have to write
+the configuration files; see @ref{Configuration Files} for details on
+how to do this.
+
+After writing the configuration files, use the @code{uuchk} program to
+verify that they are what you expect; see @ref{Invoking uuchk}.
+
+@node Testing the Installation, , Configuration, Installing Taylor UUCP
+@section Testing the Installation
+
+After you have written the configuration files, and verified them with
+the @code{uuchk} program (@pxref{Invoking uuchk}), you must check that
+UUCP can correctly contact another system.
+
Tell @code{uucico} to dial out to the system by using the @samp{-s}
-system switch (e.g. @samp{uucico -s uunet}). The log file should tell
-you what happens.
+system switch (e.g., @samp{uucico -s uunet}). The log file should tell
+you what happens. The exact location of the log file depends upon the
+settings in @file{policy.h} when you compiled the program, and on the
+use of the @code{logfile} command in the @file{config} file. Typical
+locations are @file{/usr/spool/uucp/Log} or a subdirectory under
+@file{/usr/spool/uucp/.Log}.
If you compiled the code with debugging enabled, you can use debugging
mode to get a great deal of information about what sort of data is
-flowing back and forth; the various possibilities are described under
-the @code{debug} command (@pxref{Debugging Levels}). When initially
-setting up a connection @samp{-x chat} is probably the most useful (e.g.
+flowing back and forth; the various possibilities are described with the
+@code{debug} command (@pxref{Debugging Levels}). When initially setting
+up a connection @samp{-x chat} is probably the most useful (e.g.,
@samp{uucico -s uunet -x chat}); you may also want to use @samp{-x
handshake,incoming,outgoing}. You can use @samp{-x} multiple times on
one command line, or you can give it comma separated arguments as in the
last example. Use @samp{-x all} to turn on all possible debugging
-information. The debugging information is written to a file, normally
+information.
+
+The debugging information is written to a file, normally
@file{/usr/spool/uucp/Debug}, although the default can be changed in
-@file{policy.h} and the @file{config} file can override the name with
-the @code{debugfile} command. The debugging file may contain passwords
-and some file contents as they are transmitted over the line, so the
-debugging file is only readable by the @code{uucp} user.
+@file{policy.h}, and the @file{config} file can override the default
+with the @code{debugfile} command. The debugging file may contain
+passwords and some file contents as they are transmitted over the line,
+so the debugging file is only readable by the @code{uucp} user.
You can use the @samp{-f} switch to force @code{uucico} to call out even
if the last call failed recently; using @samp{-S} when naming a system
has the same effect. Otherwise the status file (in the @file{.Status}
subdirectory of the main spool directory, normally
-@file{/usr/spool/uucp}) will prevent too many attempts from occurring in
-rapid succession.
-
-Again, please let me know about any problems you have and how you got
-around them. If you do report a problem, please include the version
-number of the package you are using, and a sample of the debugging file
-showing the problem (debugging information is usually what is needed,
-not just the log file). General questions such as ``why doesn't uucico
-dial out'' are impossible to answer without much more information.
-
-@node Installation, TCP, Testing, Overall Installation
-@section Installing Taylor UUCP
-
-You can install the executable files by becoming @code{root} and typing
-@samp{make install}. Or you can look at what @samp{make install} does
-and do it by hand. It tries to preserve your old programs, if any, but
-it only does this the first time Taylor UUCP is installed (so that if
-you install several versions of Taylor UUCP, you can still go back to
-your original UUCP programs). You can retrieve the original programs by
-typing @samp{make uninstall}.
-
-Note that by default the programs are compiled with debugging
-information, and they are not stripped when they are installed. You may
-want to strip the installed programs to save disk space. See your
-system documentation for strip for more information.
-
-However, simply installing the executable files is not enough. You must
-also arrange for them to be used correctly.
+@file{/usr/spool/uucp}) (@pxref{Status Directory}) will prevent too many
+attempts from occurring in rapid succession.
+
+On older System V based systems which do not have the @code{setreuid}
+system call, problems may arise if ordinary users can start an execution
+of @code{uuxqt}, perhaps indirectly via @code{uucp} or @code{uux}. UUCP
+jobs may wind up executing with a real user ID of the user who invoked
+@code{uuxqt}, which can cause problems if the UUCP job checks the real
+user ID for security purposes. On such systems, it is safest to put
+@samp{run-uuxqt never} (@pxref{Miscellaneous (config)}) in the
+@file{config} file, so that @code{uucico} never starts @code{uuxqt}, and
+invoke @code{uuxqt} directly from a @file{crontab} file.
+
+Please let me know about any problems you have and how you got around
+them. If you do report a problem, please include the version number of
+the package you are using, the operating system you are running it on,
+and a sample of the debugging file showing the problem (debugging
+information is usually what is needed, not just the log file). General
+questions such as ``why doesn't @code{uucico} dial out'' are impossible
+to answer without much more information.
+
+@node Using Taylor UUCP, Configuration Files, Installing Taylor UUCP, Top
+@chapter Using Taylor UUCP
@menu
-* Running uucico:: Running uucico
-* Using UUCP for mail and news:: Using UUCP for mail and news.
-* Trimming UUCP Log Files:: Trimming UUCP Log Files
+* Calling Other Systems:: Calling Other Systems
+* Accepting Calls:: Accepting Calls
+* Mail and News:: Using UUCP for Mail and News
+* The Spool Directory Layout:: The Spool Directory Layout
+* Spool Directory Cleaning:: Cleaning the UUCP Spool Directory
@end menu
-@node Running uucico, Using UUCP for mail and news, Installation, Installation
-@subsection Running uucico
+@node Calling Other Systems, Accepting Calls, Using Taylor UUCP, Using Taylor UUCP
+@section Calling Other Systems
+@cindex calling out
By default @code{uucp} and @code{uux} will automatically start up
@code{uucico} to call another system whenever work is queued up.
@@ -747,11 +2334,11 @@ which prevent the call at that time (perhaps because telephone rates are
high) (@pxref{When to Call}). Also, a remote system may have work
queued up for your system, but may not be calling you for some reason
(perhaps you have agreed that your system should always place the call).
-To make sure that works get transferred between the systems withing a
+To make sure that work gets transferred between the systems withing a
reasonable time period, you should arrange to periodically invoke
@code{uucico}.
-These periodic invocations are normally caused by entries in the
+These periodic invocations are normally triggered by entries in the
@file{crontab} file. The exact format of @file{crontab} files, and how
new entries are added, varies from system to system; check your local
documentation (try @samp{man cron}).
@@ -760,7 +2347,7 @@ To attempt to call all systems with outstanding work, use the command
@samp{uucico -r1}. To attempt to call a particular system, use the
command @samp{uucico -s @var{system}}. To attempt to call a particular
system, but only if there is work for it, use the command @samp{uucico
--C -s @var{system}}.
+-C -s @var{system}}. (@pxref{Invoking uucico}).
A common case is to want to try to call a system at a certain time, with
periodic retries if the call fails. A simple way to do this is to
@@ -768,35 +2355,79 @@ create an empty UUCP command file, known as a @dfn{poll file}. If a
poll file exists for a system, then @samp{uucico -r1} will place a call
to it. If the call succeeds, the poll file will be deleted.
-The file can be easily created using the @samp{touch} command. The name
-of a poll file currently depends on the type of spool directory you are
-using, as set in @file{policy.h}. If you are using
-@code{SPOOLDIR_TAYLOR} (the default), put something like this in your
-@file{crontab} file:
-@example
-touch /usr/spool/uucp/@var{sys}/C./C.A0000
-@end example
-In this example @var{sys} is the system you wish to call, and
-@samp{/usr/spool/uucp} is your UUCP spool directory.
-If you are using @code{SPOOLDIR_HDB}, use
+A poll file can be easily created using the @samp{uux} command, by
+requesting the execution of an empty command. To create a poll file for
+@var{system}, just do something like this:
@example
-touch /usr/spool/uucp/@var{sys}/C.@var{sys}A0000
+uux -r @var{system}!
@end example
+The @samp{-r} tells @samp{uux} to not start up @samp{uucico}
+immediately. Of course, if you do want @samp{uucico} to start up right
+away, omit the @samp{-r}; if the call fails, the poll file will be left
+around to cause a later call.
For example, I use the following crontab entries locally:
@example
45 * * * * /bin/echo /usr/lib/uucp/uucico -r1 | /bin/su uucpa
-40 4,10,15 * * * touch /usr/spool/uucp/uunet/C./C.A0000
+40 4,10,15 * * * /usr/bin/uux -r uunet!
@end example
Every hour, at 45 minutes past, this will check if there is any work to
be done, and, if there is, will call the appropriate system. Also, at
-4:40am, 10:40am and 3:40pm this will create a poll file file for
-@samp{uunet}, forcing the next check to call @samp{uunet}.
-
-@node Using UUCP for mail and news, Trimming UUCP Log Files, Running uucico, Installation
-@subsection Using UUCP for mail and news.
+4:40am, 10:40am, and 3:40pm, this will create a poll file file for
+@samp{uunet}, forcing the next run of @code{uucico} to call
+@samp{uunet}.
+
+@node Accepting Calls, Mail and News, Calling Other Systems, Using Taylor UUCP
+@section Accepting Calls
+@cindex calling in
+@cindex accepting calls
+
+To accept calls from another system, you must arrange matters such that
+when that system calls in, it automatically invokes @code{uucico} on
+your system.
+
+The most common arrangement is to create a special user name and
+password for incoming UUCP calls. This user name typically uses the
+same user ID as the regular @code{uucp} user (Unix permits several user
+names to share the same user ID). The shell for this user name should
+be set to @code{uucico}.
+
+Here is a sample @file{/etc/passwd} line to accept calls from a remote
+system named airs:
+@example
+Uairs:@var{password}:4:8:airs UUCP:/usr/spool/uucp:/usr/lib/uucp/uucico
+@end example
+The details may vary on your system. You must use reasonable user and
+group ID's. You must use the correct file name for @code{uucico}. The
+@var{password} must appear in the UUCP configuration files on the remote
+system, but will otherwise never be seen or typed by a human.
+
+Note that @code{uucico} appears as the login shell, and that it will be
+run with no arguments. This means that it will start in slave mode and
+accept an incoming connection. @xref{Invoking uucico}.
+
+On some systems, creating an empty file named @file{.hushlogin} in the
+home directory will skip the printing of various bits of information
+when the remote @code{uucico} logs in, speeding up the UUCP connection
+process.
+
+For the greatest security, each system which calls in should use a
+different user name, each with a different password, and the
+@code{called-login} command should be used in the @file{sys} file to
+ensure that the correct login name is used. @xref{Accepting a Call},
+and see @ref{Security}.
+
+If you never need to dial out from your system, but only accept incoming
+calls, you can arrange for @code{uucico} to handle logins itself,
+completely controlling the port, by using the @samp{--endless} option.
+@xref{Invoking uucico}.
+
+@node Mail and News, The Spool Directory Layout, Accepting Calls, Using Taylor UUCP
+@section Using UUCP for Mail and News.
+@cindex mail
+@cindex news
Taylor UUCP does not include a mail package. All Unix systems come with
some sort of mail delivery agent, typically @code{sendmail} or
@@ -821,25 +2452,26 @@ receiving.
* Receiving mail or news:: Receiving mail or news via UUCP
@end menu
-@node Sending mail or news, Receiving mail or news, Using UUCP for mail and news, Using UUCP for mail and news
-@unnumberedsubsubsec Sending mail or news via UUCP
+@node Sending mail or news, Receiving mail or news, Mail and News, Mail and News
+@subsection Sending mail or news via UUCP
When mail is to be sent from your machine to another machine via UUCP,
the mail delivery agent will invoke @code{uux}. It will generally run a
-command such as @samp{uux - @var{system}!rmail}, where @var{system} is
-the remote system to which the mail is being sent. It may pass other
-options to @code{uux}, such as @samp{-r} or @samp{-g}.
+command such as @samp{uux - @var{system}!rmail @var{address}}, where
+@var{system} is the remote system to which the mail is being sent. It
+may pass other options to @code{uux}, such as @samp{-r} or @samp{-g}
+(@pxref{Invoking uux}).
-News also invokes @code{uux} in order to transfer articles to another
-system. The only difference is that news will use @code{uux} to invoke
-@code{rnews} on the remote system, rather than @code{rmail}.
+The news system also invokes @code{uux} in order to transfer articles to
+another system. The only difference is that news will use @code{uux} to
+invoke @code{rnews} on the remote system, rather than @code{rmail}.
You should arrange for your mail and news systems to invoke the Taylor
-UUCP version of @code{uux} when sending mail via UUCP. If you simply
-replace any existing version of @code{uux} with the Taylor UUCP version,
-this will probably happen automatically. However, if both versions
-exist on your system, you will probably have to modify the mail and news
-configuration files in some way.
+UUCP version of @code{uux}. If you only have Taylor UUCP, or if you
+simply replace any existing version of @code{uux} with the Taylor UUCP
+version, this will probably happen automatically. However, if you have
+two UUCP packages installed on your system, you will probably have to
+modify the mail and news configuration files in some way.
Actually, if both the system UUCP and Taylor UUCP are using the same
spool directory format, the system @code{uux} will probably work fine
@@ -847,121 +2479,337 @@ with the Taylor @code{uucico} (the reverse is not the case: the Taylor
@code{uux} requires the Taylor @code{uucico}). However, data transfer
will be somewhat more efficient if the Taylor @code{uux} is used.
-@node Receiving mail or news, , Sending mail or news, Using UUCP for mail and news
-@unnumberedsubsubsec Receiving mail or news via UUCP
-
-As noted in @ref{Sending mail or news}, mail is sent by requesting a
-remote execution of @code{rmail}. To receive mail, then, all that is
-necessary is for UUCP to invoke @code{rmail} itself.
+@node Receiving mail or news, , Sending mail or news, Mail and News
+@subsection Receiving mail or news via UUCP
-Any mail delivery agent will provide an appropriate version of
-@code{rmail}; you must simply make sure that it is in the command path
-used by UUCP (it almost certainly already is). The default command path
-is set in @file{policy.h}, and it may be overridden for a particular
-system by the @code{command-path} command (@pxref{Miscellaneous (sys)}).
+To receive mail, all that is necessary is for UUCP to invoke
+@code{rmail}. Any mail delivery agent will provide an appropriate
+version of @code{rmail}; you must simply make sure that it is in the
+command path used by UUCP (it almost certainly already is). The default
+command path is set in @file{policy.h}, and it may be overridden for a
+particular system by the @code{command-path} command
+(@pxref{Miscellaneous (sys)}).
Similarly, for news UUCP must be able to invoke @code{rnews}. Any news
system will provide a version of @code{rnews}, and you must ensure that
is in a directory on the path that UUCP will search.
-@node Trimming UUCP Log Files, , Using UUCP for mail and news, Installation
-@subsection Trimming UUCP Log Files
+@node The Spool Directory Layout, Spool Directory Cleaning, Mail and News, Using Taylor UUCP
+@section The Spool Directory Layout
+@cindex spool directory
-You should also periodically trim the log files, as they will otherwise
-continue to grow without limit. The names of the log files are set in
-@file{policy.h}, and may be overridden in the configuration file
-(@pxref{config File}). By default they are are
-@file{/usr/spool/uucp/Log} and @file{/usr/spool/uucp/Stats}.
+In general, the layout of the spool directory may be safely ignored.
+However, it is documented here for the curious. This description only
+covers the @code{SPOOLDIR_TAYLOR} layout. The ways in which the other
+spool directory layouts differ are described in the source file
+@file{unix/spool.c}.
-You may find the @code{savelog} program in the @file{contrib} directory
-to be of use. There is a manual page for it in @file{contrib} as well.
+Directories and files are only created when they are needed, so a
+typical system will not have all of the entries described here.
-@node TCP, , Installation, Overall Installation
-@section TCP together with Taylor UUCP
+@menu
+* System Spool Directories:: System Spool Directories
+* Status Directory:: Status Spool Directory
+* Execution Subdirectories:: Execution Spool Subdirectories
+* Other Spool Subdirectories:: Other Spool Subdirectories
+* Spool Lock Files:: Spool Directory Lock Files
+@end menu
-If your system has a Berkeley style socket library, or a System V style
-TLI interface library, you can compile the code to permit making
-connections over TCP. Specifying that a system should be reached via
-TCP is easy, but nonobvious.
+@node System Spool Directories, Status Directory, The Spool Directory Layout, The Spool Directory Layout
+@subsection System Spool Directories
+@cindex system spool directories
-If you are using the new style configuration files, see
-@ref{Configuration Files}. Basically, you can just add the line
-@samp{port type tcp} to the entry in the system configuration file. By
-default UUCP will get the port number by looking up @samp{uucp} in
-@file{/etc/services}; if @samp{uucp} is not found, port 540 will be
-used. You can set the port number to use with the command @samp{port
-service @var{xxx}}, where @var{xxx} can be either a number or a name to
-look up in @file{/etc/services}. You can specify the address of the
-remote host with @samp{address @var{a.b.c}}; if you don't give an
-address, the remote system name will be used. You should give an
-explicit chat script for the system when you use TCP; the default chat
-script begins with a carriage return, which will not work with some UUCP
-TCP servers.
+@table @file
+@item @var{system}
+There is a subdirectory of the main spool directory for each remote
+system.
-If you are using V2 configuration files, add a line like this to
-@file{L.sys}:
+@item @var{system}/C.
+This directory stores files describing file transfer commands to be sent
+to the @var{system}. Each file name starts with @file{C.@var{g}}, where
+@var{g} is the job grade. Each file contains one or more commands. For
+details of the commands, see @ref{UUCP Protocol Commands}.
+
+@item @var{system}/D.
+This directory stores data files. Files with names like
+@file{D.@var{g}@var{ssss}}, where @var{g} is the grade and @var{ssss} is
+a sequence number, are waiting to be transferred to the @var{system}, as
+directed by the files in the @file{@var{system}/C.} directory. Files
+with other names, typically @file{D.@var{system}@var{g}@var{ssss}}, have
+been received from @var{system} and are waiting to be processed by an
+execution file in the @file{@var{system}/X.} directory.
+
+@item @var{system}/D.X
+This directory stores data files which will become execution files on
+the remote system. In current practice, this directory rarely exists,
+because most simple executions, including typical uses of @code{rmail}
+and @code{rnews}, send an @samp{E} command rather than an execution file
+(@pxref{The E Command}).
+
+@item @var{system}/X.
+This directory stores execution files which have been received from
+@var{system}. This directory normally exists, even though the
+corresponding @file{D.X} directory does not, because @code{uucico} will
+create an execution file on the fly when it receives an @samp{E}
+command.
+
+@item @var{system}/SEQF
+This file holds the sequence number of the last job sent to
+@var{system}. The sequence number is used to ensure that file names are
+unique in the remote system spool directory. The file is four bytes
+long. Sequence numbers are composed of digits and the upper case
+letters.
+@end table
-@example
-@var{sys} Any TCP uucp @var{host}.@var{domain} chat-script
-@end example
+@node Status Directory, Execution Subdirectories, System Spool Directories, The Spool Directory Layout
+@subsection Status Directory
+
+@table @file
+@item .Status
+@cindex .Status
+@cindex status files
+This directory holds status files for each remote system. The name of
+the status file is the name of the system which it describes. Each
+status file describes the last conversation with the system. Running
+@code{uustat --status} basically just formats and prints the contents of
+the status files (@pxref{uustat Examples}).
+
+Each status file has a single text line with six fields.
+
+@table @asis
+@item code
+A code indicating the status of the last conversation. The following
+values are defined, though not all are actually used.
+@table @samp
+@item 0
+Conversation completed normally.
+@item 1
+@code{uucico} was unable to open the port.
+@item 2
+The last call to the system failed while dailing.
+@item 3
+The last call to the system failed while logging in.
+@item 4
+The last call to the system failed during the initial UUCP protocol
+handshake (@pxref{The Initial Handshake}).
+@item 5
+The last call to the system failed after the initial handshake.
+@item 6
+@code{uucico} is currently talking to the system.
+@item 7
+The last call to the system failed because it was the wrong time to call
+(this is not used if calling the system is never permitted).
+@end table
-This will make an entry for system @var{sys}, to be called at any time,
-over TCP, using port number @samp{uucp} (as found in
-@file{/etc/services}; this may be specified as a number), using remote
-host @file{@var{host}.@var{domain}}, with some chat script.
+@item retries
+The number of retries since the last successful call.
-@need 1000
-If you are using HDB configuration files, add a line like this to
-Systems:
+@item time of last call
+The time of the last call, in seconds since the epoch (as returned by
+the @code{time} system call).
-@example
-@var{sys} Any TCP - @var{host}.@var{domain} chat-script
-@end example
+@item wait
+If the last call failed, this is the number of seconds since the last
+call before @code{uucico} may attempt another call. This is set based
+on the retry time; see @ref{When to Call}. The @samp{-f} or @samp{-S}
+options to @code{uucico} direct it to ignore this wait time; see
+@ref{Invoking uucico}.
-and a line like this to Devices:
+@item description
+A text description of the status, corresponding to the code in the first
+field. This may contain spaces.
-@example
-TCP uucp - -
-@end example
+@item system name
+The name of the remote system.
+@end table
+@end table
-You only need one line in Devices regardless of how many systems you
-contact over TCP. This will make an entry for system @var{sys}, to be
-called at any time, over TCP, using port number @samp{uucp} (as found in
-@file{/etc/services}; this may be specified as a number), using remote
-host @file{@var{host}.@var{domain}}, with some chat script.
+@node Execution Subdirectories, Other Spool Subdirectories, Status Directory, The Spool Directory Layout
+@subsection Execution Subdirectories
+
+@table @file
+@item .Xqtdir
+@cindex .Xqtdir
+When @code{uuxqt} executes a job requested by @code{uux}, it first
+changes the working directory to the @file{.Xqtdir} subdirectory. This
+permits the job to create any sort of temporary file without worrying
+about overwriting other files in the spool directory. Any files left
+in the @file{.Xqtdir} subdirectory are removed after each execution is
+complete.
+
+@item .Xqtdir@var{nnnn}
+When several instances of @code{uuxqt} are executing simultaneously,
+each one executes jobs in a separate directory. The first uses
+@file{.Xqtdir}, the second uses @file{.Xqtdir0001}, the third uses
+@file{.Xqtdir0002}, and so forth.
+
+@item .Corrupt
+@cindex .Corrupt
+If @code{uuxqt} encounters an execution file which it is unable to
+parse, it saves it in the @file{.Corrupt} directory, and sends mail
+about it to the UUCP administrator.
+
+@item .Failed
+@cindex .Failed
+If @code{uuxqt} executes a job, and the job fails, and there is enough
+disk space to hold the command file and all the data files, then
+@code{uuxqt} saves the files in the @file{.Failed} directory, and sends
+mail about it to the UUCP administrator.
+@end table
-The @code{uucico} daemon can also be run as a TCP server. To use the
-default port number, which is a reserved port, @code{uucico} must be
-invoked by root (or it must be set user ID to root, but I don't
-recommend doing that).
+@node Other Spool Subdirectories, Spool Lock Files, Execution Subdirectories, The Spool Directory Layout
+@subsection Other Spool Subdirectories
+
+@table @file
+@item .Sequence
+@cindex .Sequence
+This directory holds conversation sequence number files. These are used
+if the @code{sequence} command is used for a system
+(@pxref{Miscellaneous (sys)}). The sequence number for the system
+@var{system} is stored in the file @file{.Sequence/@var{system}}. It is
+simply stored as a printable number.
+
+@item .Temp
+@cindex .Temp
+This directory holds data files as they are being received from a remote
+system, before they are moved to their final destination. For file send
+requests which use a valid temporary file name in the @var{temp} field
+of the @samp{S} or @samp{E} command (@pxref{The S Command}),
+@code{uucico} receives the file into
+@file{.Temp/@var{system}/@var{temp}}, where @var{system} is the name of
+the remote system, and @var{temp} is the temporary file name. If a
+conversation fails during a file transfer, these files are used to
+automatically restart the file transfer from the point of failure.
+
+If the @samp{S} or @samp{E} command does not include a temporary file
+name, automatic restart is not possible. In this case, the files are
+received into a randomly named file in the @file{.Temp} directory
+itself.
+
+@item .Preserve
+@cindex .Preserve
+This directory holds data files which could not be transferred to a
+remote system for some reason (for example, the data file might be
+large, and exceed size restrictions imposed by the remote system). When
+a locally requested file transfer fails, @code{uucico} will store the
+data file in the @file{.Preserve} directory, and send mail to the
+requestor describing the failure and naming the saved file.
+
+@item .Received
+@cindex .Received
+This directory records which files have been received. If a
+conversation fails just after @code{uucico} acknowledges receipt of a
+file, it is possible for the acknowledgement to be lost. If this
+happens, the remote system will resend the file. If the file were an
+execution request, and @code{uucico} did not keep track of which files
+it had already received, this could lead to the execution being
+performed twice.
+
+To avoid this problem, when a conversation fails, @code{uucico} records
+each file that has been received, but for which the remote system may
+not have received the acknowledgement. It records this information by
+creating an empty file with the name
+@file{.Received/@var{system}/@var{temp}}, where @var{system} is the name
+of the remote system, and @var{temp} is the @var{temp} field of the
+@samp{S} or @samp{E} command from the remote system (@pxref{The S
+Command}). Then, if the remote system offers the file again in the next
+conversation, @code{uucico} refuses the send request and deletes the
+record in the @file{.Received} directory. This approach only works for
+file sends which use a temporary file name, but this is true of all
+execution requests.
+@end table
-Basically, you must define a port, either using the port file
-(@pxref{port File}) if you are using the new configuration method or
-with an entry in Devices if you are using HDB; there is no way to define
-a port using V2. If you are using HDB the port must be named
-@samp{TCP}; a line as shown above will suffice. You can then start
-@code{uucico} as @samp{uucico -p TCP} (after the @samp{-p}, name the
-port; in HDB it must be @samp{TCP}). This will wait for incoming
-connections, and fork off a child for each one. Each connection will be
-prompted with @samp{login:} and @samp{Password:}; the results will be
-checked against the UUCP (not the system) password file
-(@pxref{Configuration File Names}).
-
-Of course, you can get a similar effect by using the BSD @code{uucpd}
-program.
+@node Spool Lock Files, , Other Spool Subdirectories, The Spool Directory Layout
+@subsection Lock Files in the Spool Directory
+@cindex lock files in spool directory
+
+Lock files for devices and systems are stored in the lock directory,
+which may or may not be the same as the spool directory. The lock
+directory is set at compilation time by @code{LOCKDIR} in
+@file{policy.h}, which may be overridden by the @code{lockdir} command
+in the @file{config} file (@pxref{Miscellaneous (config)}).
+
+For a description of the names used for device lock files, and the
+format of the contents of a lock file, see @ref{UUCP Lock Files}.
+
+@table @file
+@item LCK..@var{sys}
+@cindex LCK..@var{sys}
+@cindex system lock files
+A lock file for a system, where @var{sys} is the system name. As noted
+above, these lock files are kept in the lock directory, which may not be
+the spool directory. These lock files are created by @code{uucico}
+while talking to a remote system, and are used to prevent multiple
+simultaneous conversations with a system.
+
+On systems which limit file names to 14 characters, only the first eight
+characters of the system name are used in the lock file name. This
+requires that the names of each directly connected remote system be
+unique in the first eight characters.
+
+@item LCK.XQT.@var{NN}
+@cindex LCK.XQT.@var{NN}
+When @code{uuxqt} starts up, it uses lock files to determine how many
+other @code{uuxqt} daemons are currently running. It first tries to
+lock @file{LCK.XQT.0}, then @file{LCK.XQT.1}, and so forth. This is
+used to implement the @code{max-uuxqts} command (@pxref{Miscellaneous
+(config)}). It is also used to parcel out the @file{.Xqtdir}
+subdirectories (@pxref{Execution Subdirectories}).
+
+@item LXQ.@var{cmd}
+@cindex LXQ.@var{cmd}
+When @code{uuxqt} is invoked with the @samp{-c} or @samp{--command}
+option (@pxref{Invoking uuxqt}), it creates a lock file named after the
+command it is executing. For example, @samp{uuxqt -c rmail} will create
+the lock file @file{LXQ.rmail}. This prevents other @code{uuxqt}
+daemons from executing jobs of the specified type.
+
+@item @var{system}/X./L.@var{xxx}
+@cindex L.@var{xxx}
+While @code{uuxqt} is executing a particular job, it creates a lock file
+with the same name as the @file{X.} file describing the job, but
+replacing the initial @samp{X} with @samp{L}. This ensures that if
+multiple @code{uuxqt} daemons are running, they do not simultaneously
+execute the same job.
+
+@item LCK..SEQ
+This lock file is used to control access to the sequence files for each
+system (@pxref{System Spool Directories}). It is only used on systems
+which do not support POSIX file locking using the @code{fcntl} system
+call.
+@end table
-You can also have @code{inetd} start up @code{uucico} with the @samp{-l}
-switch, which will cause it to prompt with @samp{login:} and
-@samp{Password:} and check the results against the UUCP (not the system)
-password file (you may want to also use the @samp{-D} switch to avoid a
-fork, which in this case is unnecessary). This may be used in place of
-@code{uucpd}.
+@node Spool Directory Cleaning, , The Spool Directory Layout, Using Taylor UUCP
+@section Cleaning the Spool Directory
+@cindex spool directory, cleaning
+@cindex cleaning the spool directory
+
+The spool directory may need to be cleaned up periodically. Under some
+circumstances, files may accumulate in various subdirectories, such as
+@file{.Preserve} (@pxref{Other Spool Subdirectories}) or @file{.Corrupt}
+(@pxref{Execution Subdirectories}).
+
+Also, if a remote system stops calling in, you may want to arrange for
+any queued up mail to be returned to the sender. This can be done using
+the @code{uustat} command (@pxref{Invoking uustat}).
-@node Configuration Files, Protocols, Overall Installation, Top
+The @file{contrib} directory includes a simple @file{uuclean} script
+which may be used as an example of a clean up script. It can be run
+daily out of @file{crontab}.
+
+You should periodically trim the UUCP log files, as they will otherwise
+grow without limit. The names of the log files are set in
+@file{policy.h}, and may be overridden in the configuration file
+(@pxref{config File}). By default they are are
+@file{/usr/spool/uucp/Log} and @file{/usr/spool/uucp/Stats}. You may
+find the @code{savelog} program in the @file{contrib} directory to be of
+use. There is a manual page for it in @file{contrib} as well.
+
+@node Configuration Files, Protocols, Using Taylor UUCP, Top
@chapter Taylor UUCP Configuration Files
This chapter describes the configuration files accepted by the Taylor
-UUCP package if compiled with @code{HAVE_TAYLOR_CONFIG} defined in
+UUCP package if compiled with @code{HAVE_TAYLOR_CONFIG} set to 1 in
@file{policy.h}.
The configuration files are normally found in the directory
@@ -971,56 +2819,25 @@ The configuration files are normally found in the directory
@file{config}, is the only one which must be in that directory, since it
may specify a different location for any or all of the other files. You
may run any of the UUCP programs with a different main configuration
-file by using the @samp{-I} option; this can be useful when testing a
-new configuration. When you use the @samp{-I} option the programs will
-revoke any setuid privileges.
+file by using the @samp{-I} or @samp{--config} option; this can be
+useful when testing a new configuration. When you use the @samp{-I}
+option the programs will revoke any setuid privileges.
@menu
-* Configuration File Format:: Configuration file format
-* Configuration File Overview:: Configuration File Overview
-* Configuration Examples:: Examples of configuration files
-* Time Strings:: How to write time strings
-* Chat Scripts:: How to write chat scripts
-* config File:: The main configuration file
-* sys File:: The system configuration file
-* port File:: The port configuration files
-* dial File:: The dialer configuration files
-* Security:: Security issues
+* Configuration Overview:: Configuration File Overview
+* Configuration File Format:: Configuration File Format
+* Configuration Examples:: Examples of Configuration Files
+* Time Strings:: How to Write Time Strings
+* Chat Scripts:: How to Write Chat Scripts
+* config File:: The Main Configuration File
+* sys File:: The System Configuration File
+* port File:: The Port Configuration Files
+* dial File:: The Dialer Configuration Files
+* UUCP Over TCP:: UUCP Over TCP
+* Security:: Security Issues
@end menu
-@node Configuration File Format, Configuration File Overview, Configuration Files, Configuration Files
-@section Configuration File Format
-
-All the configuration files follow a simple line-oriented
-@samp{@var{keyword} @var{value}} format. Empty lines are ignored, as
-are leading spaces; unlike HDB, lines with leading spaces are read. The
-first word on each line is a keyword. The rest of the line is
-interpreted according to the keyword. Most keywords are followed by
-numbers, boolean values or simple strings with no embedded spaces.
-
-The @kbd{#} character is used for comments. Everything from a @kbd{#}
-to the end of the line is ignored unless the @kbd{#} is preceded by a
-@kbd{\} (backslash); if the @kbd{#} is preceeded by a @kbd{\}, the
-@kbd{\} is removed but the @kbd{#} remains in the line. This can be
-useful for a phone number containing a @kbd{#}. To enter the sequence
-@samp{\#}, use @samp{\\#}.
-
-The backslash character may be used to continue lines. If the last
-character in a line is a backslash, the backslash is removed and the
-line is continued by the next line. The second line is attached to the
-first with no intervening characters; if you want any whitespace between
-the end of the first line and the start of the second line, you must
-insert it yourself.
-
-However, the backslash is not a general quoting character. For example,
-you cannot use it to get an embedded space in a string argument.
-
-Everything after the keyword must be on the same line. A @var{boolean}
-may be specified as @kbd{y}, @kbd{Y}, @kbd{t}, or @kbd{T} for true and
-@kbd{n}, @kbd{N}, @kbd{f}, or @kbd{F} for false; any trailing characters
-are ignored, so @code{true}, @code{false}, etc., are also acceptable.
-
-@node Configuration File Overview, Configuration Examples, Configuration File Format, Configuration Files
+@node Configuration Overview, Configuration File Format, Configuration Files, Configuration Files
@section Configuration File Overview
UUCP uses several different types of configuration files, each
@@ -1063,7 +2880,39 @@ dialer.
There are other types of configuration files, but these are the
important ones. The other types are described below.
-@node Configuration Examples, Time Strings, Configuration File Overview, Configuration Files
+@node Configuration File Format, Configuration Examples, Configuration Overview, Configuration Files
+@section Configuration File Format
+
+All the configuration files follow a simple line-oriented
+@samp{@var{keyword} @var{value}} format. Empty lines are ignored, as
+are leading spaces; unlike HDB, lines with leading spaces are read. The
+first word on each line is a keyword. The rest of the line is
+interpreted according to the keyword. Most keywords are followed by
+numbers, boolean values or simple strings with no embedded spaces.
+
+The @kbd{#} character is used for comments. Everything from a @kbd{#}
+to the end of the line is ignored unless the @kbd{#} is preceded by a
+@kbd{\} (backslash); if the @kbd{#} is preceeded by a @kbd{\}, the
+@kbd{\} is removed but the @kbd{#} remains in the line. This can be
+useful for a phone number containing a @kbd{#}. To enter the sequence
+@samp{\#}, use @samp{\\#}.
+
+The backslash character may be used to continue lines. If the last
+character in a line is a backslash, the backslash is removed and the
+line is continued by the next line. The second line is attached to the
+first with no intervening characters; if you want any whitespace between
+the end of the first line and the start of the second line, you must
+insert it yourself.
+
+However, the backslash is not a general quoting character. For example,
+you cannot use it to get an embedded space in a string argument.
+
+Everything after the keyword must be on the same line. A @var{boolean}
+may be specified as @kbd{y}, @kbd{Y}, @kbd{t}, or @kbd{T} for true and
+@kbd{n}, @kbd{N}, @kbd{f}, or @kbd{F} for false; any trailing characters
+are ignored, so @code{true}, @code{false}, etc., are also acceptable.
+
+@node Configuration Examples, Time Strings, Configuration File Format, Configuration Files
@section Examples of Configuration Files
This section provides few typical examples of configuration files.
@@ -1071,9 +2920,9 @@ There are also sample configuration files in the @file{sample}
subdirectory of the distribution.
@menu
-* config File Examples:: Examples of the main configuration file
-* Leaf Example:: Call a single remote site
-* Gateway Example:: The gateway for several local systems
+* config File Examples:: Examples of the Main Configuration File
+* Leaf Example:: Call a Single Remote Site
+* Gateway Example:: The Gateway for Several Local Systems
@end menu
@node config File Examples, Leaf Example, Configuration Examples, Configuration Examples
@@ -1086,8 +2935,8 @@ are permitted in @file{config}, see @ref{config File}.
In many cases you will not need to create a @file{config} file at all.
The most common reason to create one is to give your machine a special
-UUCP name. Other reasons might be to change the UUCP spool directory or
-to permit any remote system to call in.
+UUCP name. Other reasons might be to change the UUCP spool directory,
+or to permit any remote system to call in.
If you have an internal network of machines, then it is likely that the
internal name of your UUCP machine is not the name you want to use when
@@ -1103,7 +2952,7 @@ nodename airs
@end example
@cindex changing spool directory
-@cindex spool directory (changing)
+@cindex spool directory, changing
The UUCP spool directory name is set in @file{policy.h} when the code is
compiled. You might at some point decide that it is appropriate to move
the spool directory, perhaps to put it on a different disk partition.
@@ -1266,7 +3115,7 @@ which I will show the configuration file. @file{elmer} calls out to
@file{uupsi}. As an additional complication, @file{uupsi} knows
@file{elmer} as @file{airs}; this will show how a machine can have one
name on an internal network but a different name to the external world.
-@file{elmer} has two modems. It also has an TCP/IP connection to
+@file{elmer} has two modems. It also has an TCP connection to
@file{uupsi}, but since that is supposed to be reserved for interactive
work (it is, perhaps, only a 9600 baud SLIP line) it will only use it if
the modems are not available.
@@ -1304,7 +3153,7 @@ called-login Ulocal
local-send /
remote-send /
-# Permit requesting into any world writable directory
+# Permit receiving into any world writable directory
local-receive /
remote-receive /
@@ -1418,7 +3267,7 @@ Several commands use time strings to specify a range of times. This
section describes how to write time strings.
A time string may be a list of simple time strings separated with a
-vertical bar @kbd{|} or a comma @kbd{,}.
+vertical bar @samp{|} or a comma @samp{,}.
Each simple time string must begin with @samp{Su}, @samp{Mo}, @samp{Tu},
@samp{We}, @samp{Th}, @samp{Fr}, or @samp{Sa}, or @samp{Wk} for any
@@ -1429,9 +3278,10 @@ Following the day may be a range of hours separated with a hyphen using
@samp{2300-0700} means any time except 7 AM to 11 PM. If no time is
given, calls may be made at any time on the specified day(s).
-The time string may also consist of the single word @samp{Never}, which
-does not match any time, or a single word with a name defined in a
-previous @code{timetable} command (@pxref{Miscellaneous (config)}).
+The time string may also be the single word @samp{Never}, which does not
+match any time. The time string may also be a single word with a name
+defined in a previous @code{timetable} command (@pxref{Miscellaneous
+(config)}).
Here are a few sample time strings with an explanation of what they
mean.
@@ -1487,7 +3337,7 @@ pairs of strings separated by whitespace. The first string of each pair
is an expect string, the second is a send string. The program will wait
for the expect string to appear; when it does, the program will send the
send string. If the expect string does not appear within a certain
-number of seconds (as set by the @code{chat-timeout} command) the chat
+number of seconds (as set by the @code{chat-timeout} command), the chat
script fails and, typically, the call is aborted. If the final expect
string is seen (and the optional final send string has been sent), the
chat script is successful.
@@ -1575,17 +3425,17 @@ following @kbd{\e}.
@item chat-timeout @var{number}
@findex chat-timeout
-The number of seconds to wait for an expect string in the chat script
-before timing out and sending the next subsend or failing the chat
-script entirely. The default value is 10 for a login chat or 60 for
-any other type of chat.
+The number of seconds to wait for an expect string in the chat script,
+before timing out and sending the next subsend, or failing the chat
+script entirely. The default value is 10 for a login chat or 60 for any
+other type of chat.
@item chat-fail @var{string}
@findex chat-fail
If the @var{string} is seen at any time during a chat script, the chat
script is aborted. The string may not contain any whitespace
-characters; escape sequences must be used for them. Multiple
+characters: escape sequences must be used for them. Multiple
@code{chat-fail} commands may appear in a single chat script. The
default is to have none.
@@ -1596,8 +3446,9 @@ string @samp{BUSY} was seen.
The @code{chat-fail} strings are considered in the order they are
listed, so if one string is a suffix of another the longer one should be
-listed first. Of course, if one string is contained within another, the
-smaller string will always be found before the larger string could
+listed first. This affects the error message which will be logged. Of
+course, if one string is contained within another, but is not a suffix,
+the smaller string will always be found before the larger string could
match.
@item chat-seven-bit @var{boolean}
@@ -1653,7 +3504,7 @@ The program will be run as the @code{uucp} user, and the environment
will be that of the process that started @code{uucico}, so care must be
taken to maintain security.
-No search path is used to find the program; a full path name must be
+No search path is used to find the program; a full file name must be
given. If the program is an executable shell script, it will be passed
to @file{/bin/sh} even on systems which are unable to execute shell
scripts.
@@ -1697,10 +3548,10 @@ a separate file @file{@var{file}} and put @samp{cu sysfile
@file{@var{file}}} in @file{config}.
@menu
-* Miscellaneous (config):: Miscellaneous config file commands
-* Configuration File Names:: Using different configuration files
-* Log File Names:: Using different log files
-* Debugging Levels:: Debugging levels
+* Miscellaneous (config):: Miscellaneous config File Commands
+* Configuration File Names:: Using Different Configuration Files
+* Log File Names:: Using Different Log Files
+* Debugging Levels:: Debugging Levels
@end menu
@node Miscellaneous (config), Configuration File Names, config File, config File
@@ -1723,7 +3574,7 @@ will be used to get the host name, if possible.
@item spool @var{string}
@findex spool
-@cindex spool directory
+@cindex spool directory, setting
@cindex /usr/spool/uucp
Specify the spool directory. The default is from @file{policy.h}. This
@@ -1751,7 +3602,9 @@ Specify the directory to place lock files in. The default is from
@file{policy.h}; see the information in that file. Normally the lock
directory should be set correctly in @file{policy.h}, and not changed
here. However, changing the lock directory is sometimes useful for
-testing purposes.
+testing purposes. This only affects lock files for devices and systems;
+it does not affect certain internal lock files which are stored in the
+spool directory (@pxref{Spool Lock Files}).
@item unknown @var{string} @dots{}
@findex unknown
@@ -1763,18 +3616,39 @@ to any unknown systems that may call in, probably to set file transfer
permissions and the like. If the @code{unknown} command is not used,
unknown systems are not permitted to call in.
+@item strip-login @var{boolean}
+@findex strip-login
+@cindex parity in login names
+
+If the argument is true, then, when @code{uucico} is doing its own login
+prompting with the @samp{-e}, @samp{-l}, or @samp{-w} switches, it will
+strip the parity bit when it reads the login name and password.
+Otherwise all eight bits will be used when checking the strings against
+the UUCP password file. The default is true, since some other UUCP
+packages send parity bits with the login name and password, and few
+systems use eight bit characters in the password file.
+
+@item strip-proto @var{boolean}
+@findex strip-proto
+
+If the argument is true, then @code{uucico} will strip the parity bit
+from incoming UUCP protocol commands. Otherwise all eight bits will be
+used. This only applies to commands which are not encapsulated in a
+link layer protocol. The default is true, which should always be
+correct unless your UUCP system names use eight bit characters.
+
@item max-uuxqts @var{number}
@findex max-uuxqts
Specify the maximum number of @code{uuxqt} processes which may run at
the same time. Having several @code{uuxqt} processes running at once
-can significantly slow down a system, but since @code{uuxqt} is
+can significantly slow down a system, but, since @code{uuxqt} is
automatically started by @code{uucico}, it can happen quite easily. The
default for @code{max-uuxqts} is 0, which means that there is no limit.
If HDB configuration files are being read and the code was compiled
-without @code{HAVE_TAYLOR_CONFIG}, then if the file @file{Maxuuxqts} in
-the configuration directory contains a readable number it will be used as
-the value for @code{max-uuxqts}.
+without @code{HAVE_TAYLOR_CONFIG}, then, if the file @file{Maxuuxqts} in
+the configuration directory contains a readable number, it will be used
+as the value for @code{max-uuxqts}.
@item run-uuxqt @var{string} or @var{number}
@findex run-uuxqt
@@ -1789,8 +3663,8 @@ start @code{uuxqt} once at the end of execution. The string
@samp{percall} means that @code{uucico} will start @code{uuxqt} once per
call that it makes (this is only different from @code{once} when
@code{uucico} is invoked in a way that causes it to make multiple calls,
-such as when the @samp{-r1} argument is used without the @samp{-s}
-argument). The string @samp{never} means that @code{uucico} will never
+such as when the @samp{-r1} option is used without the @samp{-s}
+option). The string @samp{never} means that @code{uucico} will never
start @code{uuxqt}, in which case @code{uuxqt} should be periodically
run via some other mechanism. The default depends upon which type of
configuration files are being used; if @code{HAVE_TAYLOR_CONFIG} is used
@@ -1802,7 +3676,7 @@ the default is @samp{10}.
@findex timetable
The @code{timetable} defines a timetable that may be used in
-subsequently appearing time strings; @ref{Time Strings}. The first
+subsequently appearing time strings; see @ref{Time Strings}. The first
string names the timetable entry; the second is a time string.
The following @code{timetable} commands are predefined. The NonPeak
@@ -1816,8 +3690,8 @@ timetable Night Wk2305-0755,Sa,Su2305-1655
timetable NonPeak Wk1805-0655,Sa,Su
@end example
-If this command does not appear, then obviously no additional timetables
-will be defined.
+If this command does not appear, then, obviously, no additional
+timetables will be defined.
@item v2-files @var{boolean}
@findex v2-files
@@ -1863,7 +3737,7 @@ given on the line, and the @code{portfile} command may be repeated.
Specify the dial file(s). The default is the file @file{dial} in the
directory @var{newconfigdir}. These files describe dialing devices
-(modems); @xref{dial File}. No dial files need be named at all.
+(modems); see @ref{dial File}. No dial files need be named at all.
Multiple dial files may be given on the line, and the @code{dialfile}
command may be repeated.
@@ -1924,7 +3798,7 @@ Specify the password file(s) to use for login names when @code{uucico}
is doing its own login prompting, which it does when given the
@samp{-e}, @samp{-l} or @samp{-w} switches. The default is the file
@file{passwd} in the directory @var{newconfigdir}. Each line in the
-file(s) has two words: the login name and the password (e.g. @code{Ufoo
+file(s) has two words: the login name and the password (e.g., @code{Ufoo
foopas}). They may contain escape sequences like those in a chat script
expect string (@pxref{Chat Scripts}). The login name is accepted before
the system name is known, so these are independent of which system is
@@ -1959,7 +3833,7 @@ turn until the login name is found.
Name the log file. The default is from @file{policy.h}. Logging
information is written to this file. If @code{HAVE_HDB_LOGGING} is
defined in @file{policy.h}, then by default a separate log file is used
-for each system. Using this command to name a log file will cause all
+for each system; using this command to name a log file will cause all
the systems to use it.
@item statfile @var{string}
@@ -2035,7 +3909,7 @@ running any of the programs, the @samp{-x} switch (actually, for
@code{uulog} it's the @samp{-X} switch) may be used to turn on
debugging. The argument to the @samp{-x} switch is one of the strings
listed above, or a number as described above, or a comma separated list
-of strings (e.g. @samp{-x chat,handshake}). The @samp{-x} switch may
+of strings (e.g., @samp{-x chat,handshake}). The @samp{-x} switch may
also appear several times on the command line, in which case all named
debugging types will be turned on. The @samp{-x} debugging is in
addition to any debugging specified by the @code{debug} command; there
@@ -2062,14 +3936,14 @@ the directory @var{newconfigdir}. This may be overridden by the
These files describe all remote systems known to the UUCP package.
@menu
-* Defaults and Alternates:: Using defaults and alternates
-* Naming the System:: Naming the system
-* Calling Out:: Calling out
-* Accepting a Call:: Accepting a call
-* Protocol Selection:: Protocol selection
-* File Transfer Control:: File transfer control
-* Miscellaneous (sys):: Miscellaneous sys file commands
-* Default sys File Values:: Default values
+* Defaults and Alternates:: Using Defaults and Alternates
+* Naming the System:: Naming the System
+* Calling Out:: Calling Out
+* Accepting a Call:: Accepting a Call
+* Protocol Selection:: Protocol Selection
+* File Transfer Control:: File Transfer Control
+* Miscellaneous (sys):: Miscellaneous sys File Commands
+* Default sys File Values:: Default Values
@end menu
@node Defaults and Alternates, Naming the System, sys File, sys File
@@ -2128,6 +4002,7 @@ This can all get rather confusing, although it's easier to use than to
describe concisely; the @code{uuchk} program may be used to ensure that
you are getting what you want.
+@need 2000
@node Naming the System, Calling Out, Defaults and Alternates, sys File
@subsection Naming the System
@@ -2144,7 +4019,7 @@ Specify the remote system name. Subsequent commands up to the next
Start an alternate set of commands (@pxref{Defaults and Alternates}).
An optional argument may be used to name the alternate. This name will
-be put in the log file if the alternate is used to call the system.
+be recorded in the log file if the alternate is used to call the system.
There is no way to name the first alternate (the commands before the
first @code{alternate} command).
@@ -2186,11 +4061,12 @@ This section describes commands used when placing a call to another
system.
@menu
-* When to Call:: When to call
-* Placing the Call:: Placing the call
-* Logging In:: Logging in
+* When to Call:: When to Call
+* Placing the Call:: Placing the Call
+* Logging In:: Logging In
@end menu
+@need 2000
@node When to Call, Placing the Call, Calling Out, Calling Out
@subsubsection When to Call
@@ -2217,6 +4093,7 @@ The default time string is @samp{Never}.
@item timegrade @var{character} @var{string} [@var{number}]
@findex timegrade
+@cindex grades
The @var{character} specifies a grade. It must be a single letter or
digit. The @var{string} is a time string (@pxref{Time Strings}). All
@@ -2238,9 +4115,10 @@ is no job of sufficiently high grade the system will not be called, and
given to @code{uucico}) only jobs of sufficiently high grade will be
transferred. However, if the other system calls in, the
@code{timegrade} commands are ignored, and jobs of any grade may be
-transferred (but see @code{call-timegrade} below). Also, the
-@code{timegrade} command will not prevent the other system from
-transferring any job it chooses, regardless of who placed the call.
+transferred (but see @code{call-timegrade} and @code{called-timegrade},
+below). Also, the @code{timegrade} command will not prevent the other
+system from transferring any job it chooses, regardless of who placed
+the call.
The @code{timegrade} command may appear multiple times without using
@code{alternate}. When the @code{timegrade} command is used for a
@@ -2270,24 +4148,46 @@ there is no limit.
The @var{character} is a single character @kbd{A} to @kbd{Z}, @kbd{a} to
@kbd{z}, or @kbd{0} to @kbd{9} and specifies a grade. The @var{string}
-is a time string as described under the @code{time} command. If a call
-is placed to the other system during a time which matches the time
-string, the remote system will be requested to only run jobs of grade
-@var{character} or higher. Unfortunately, there is no way to guarantee
-that the other system will obey the request (this UUCP package will, but
-there are others which will not); moreover job grades are historically
-somewhat arbitrary, so specifying a grade will only be meaningful if the
-other system cooperates in assigning grades. This grade restriction
-only applies when the other system is called, not when the other system
-calls in.
+is a time string (@pxref{Time Strings}). If a call is placed to the
+other system during a time which matches the time string, the remote
+system will be requested to only run jobs of grade @var{character} or
+higher. Unfortunately, there is no way to guarantee that the other
+system will obey the request (this UUCP package will, but there are
+others which will not); moreover, job grades are historically somewhat
+arbitrary, so specifying a grade will only be meaningful if the other
+system cooperates in assigning grades. This grade restriction only
+applies when the other system is called, not when the other system calls
+in.
The @code{call-timegrade} command may appear multiple times without
using @code{alternate}. If this command does not appear, or if none of
the time strings match, the remote system will be allowed to send
whatever grades of work it chooses.
+@item called-timegrade @var{character} @var{string}
+@findex called-timegrade
+
+The @var{character} is a single character @kbd{A} to @kbd{Z}, @kbd{a} to
+@kbd{z}, or @kbd{0} to @kbd{9} and specifies a grade. The @var{string}
+is a time string (@pxref{Time Strings}). If a call is received from the
+other system during a time which matches the time string, only jobs of
+grade @var{character} or higher will be sent to the remote system. This
+allows the job grade to be set for incoming calls, overriding any
+request made by the remote uucico. As noted above, job grades are
+historically somewhat arbitrary, so specifying a grade will only be
+meaningful if the other system cooperates in assigning grades. This
+grade restriction only applies to jobs on the local system; it does not
+affect the jobs transferred by the remote system. This grade
+restriction only applies when the other system calls in, not when the
+other system is called.
+
+The @code{called-timegrade} command may appear multiple times. If this
+command does not appear, or if none of the time strings match, any grade
+may be sent to the remote system upon receiving a call.
+
@end table
+@need 2000
@node Placing the Call, Logging In, When to Call, Calling Out
@subsubsection Placing the Call
@@ -2383,7 +4283,9 @@ ignored.
@findex chat-program in sys file
These commands describe a chat script to use when logging on to a remote
-system. Chat scripts are explained in @ref{Chat Scripts}.
+system. This login chat script is run after any chat script defined in
+the @file{dial} file (@pxref{dial File}). Chat scripts are explained in
+@ref{Chat Scripts}.
Two additional escape sequences may be used in send strings.
@@ -2437,7 +4339,7 @@ have to specify the simple chat script @samp{ogin: \L word: \P}.
@findex call-login
Specify the login name to send with @kbd{\L} in the chat script. If the
-string is @samp{*} (e.g. @samp{call-login *}) the login name will be
+string is @samp{*} (e.g., @samp{call-login *}) the login name will be
fetched from the call out login name and password file
(@pxref{Configuration File Names}). The string may contain escape
sequences as though it were an expect string in a chat script
@@ -2447,7 +4349,7 @@ sequences as though it were an expect string in a chat script
@findex call-password
Specify the password to send with @kbd{\P} in the chat script. If the
-string is @samp{*} (e.g. @samp{call-password *}) the password will be
+string is @samp{*} (e.g., @samp{call-password *}) the password will be
fetched from the call-out login name and password file
(@pxref{Configuration File Names}). The string may contain escape
sequences as though it were an expect string in a chat script
@@ -2464,7 +4366,7 @@ sequences as though it were an expect string in a chat script
@findex called-login
The first @var{string} specifies the login name that the system must use
-when calling in. If it is @samp{ANY} (e.g. @samp{called-login ANY}) any
+when calling in. If it is @samp{ANY} (e.g., @samp{called-login ANY}) any
login name may be used; this is useful to override a file-wide default
and to indicate that future alternates may have different login names.
Case is significant. The default value is @samp{ANY}.
@@ -2514,8 +4416,8 @@ being defined. The chat script defined by the @code{chat} command
is called. This called chat script might be used to set special modem
parameters that are appropriate to a particular system. It is run after
protocol negotiation is complete, but before the protocol has been
-started. See @ref{Logging In} for additional escape sequence which may
-be used besides those defined for all chat scripts. There is no default
+started. For additional escape sequence which may be used besides those
+defined for all chat scripts, see @ref{Logging In}. There is no default
called chat script. If the called chat script fails, the incoming call
will be aborted.
@@ -2545,17 +4447,20 @@ negotiation with the remote side.
The @samp{t} and @samp{e} protocols are intended for use over TCP or
some other communication path with end to end reliability, as they do no
checking of the data at all. They will only be considered on a TCP port
-which is both reliable and eight bit.
+which is both reliable and eight bit. For technical details, see @ref{t
+Protocol}, and @ref{e Protocol}.
The @samp{i} protocol is a bidirectional protocol. It requires an
eight-bit connection. It will run over a half-duplex link, such as
Telebit modems in PEP mode, but for efficient use of such a connection
you must use the @code{half-duplex} command (@pxref{port File}).
+@xref{i Protocol}.
The @samp{g} protocol is robust, but requires an eight-bit connection.
+@xref{g Protocol}.
The @samp{G} protocol is the System V Release 4 version of the @samp{g}
-protocol.
+protocol. @xref{Big G Protocol}.
The @samp{a} protocol is a Zmodem like protocol, contributed by Doug
Evans. It requires an eight-bit connection, but unlike the @samp{g} or
@@ -2568,18 +4473,27 @@ be set by a parameter. While it technically does not require an eight
bit connection (it could be configured to avoid all characters with the
high bit set) it would be very inefficient to use it over one. It is
useful over a eight-bit connection that will not transmit certain
-control characters.
+control characters. @xref{j Protocol}.
The @samp{f} protocol is intended for use with X.25 connections; it
checksums each file as a whole, so any error causes the entire file to
be retransmitted. It requires a reliable connection, but only uses
seven-bit transmissions. It is a streaming protocol, so, while it can
be used on a serial port, the port must be completely reliable and flow
-controlled; many aren't.
+controlled; many aren't. @xref{f Protocol}.
The @samp{v} protocol is the @samp{g} protocol as used by the DOS
program UUPC/Extended. It is provided only so that UUPC/Extended users
-can use it; there is no particular reason to select it.
+can use it; there is no particular reason to select it. @xref{v
+Protocol}.
+
+The @samp{y} protocol is an efficient streaming protocol. It does error
+checking, but when it detects an error it immediately aborts the
+connection. This requires a reliable, flow controlled, eight-bit
+connection. In practice, it is only useful on a connection that is
+nearly always error-free. Unlike the @samp{t} and @samp{e} protocols,
+the connection need not be entirely error-free, so the @samp{y} protocol
+can be used on a serial port. @xref{y Protocol}.
The protocols will be considered in the order shown above. This means
that if neither the @code{seven-bit} nor the @code{reliable} command are
@@ -2595,7 +4509,8 @@ to use the @code{protocol} command for the system or no protocol will be
selected at all (the only reasonable choice would be @samp{protocol f}).
A protocol list may also be specified for a port (@pxref{port File}),
-but if there is a list for the system the list for the port is ignored.
+but, if there is a list for the system, the list for the port is
+ignored.
@item protocol-parameter @var{character} @var{string} @dots{}
@findex protocol-parameter in sys file
@@ -2617,7 +4532,7 @@ The packet size to request the remote system to use. This must be
between 1 and 4095 inclusive. The default is 1024.
@item remote-packet-size
If this is between 1 and 4095 inclusive, the packet size requested by
-the remote system is ignored and this is used instead. The default is
+the remote system is ignored, and this is used instead. The default is
0, which means that the remote system's request is honored.
@item sync-timeout
The length of time, in seconds, to wait for a SYNC packet from the remote
@@ -2658,13 +4573,13 @@ between 1 and 7 inclusive. The default is 7.
@item packet-size
The packet size to request the remote system to use. This must be a
power of 2 between 32 and 4096 inclusive. The default is 64 for the
-@samp{g} and @samp{G} protocols and 512 for the @samp{v} protocol. Many
-older UUCP packages do not support packet sizes larger than 64, and many
-others do not support packet sizes larger than 128. Some UUCP packages
-will even dump core if a larger packet size is requested. The packet
-size is not a negotiation, and it may be different in each direction.
-If you request a packet size larger than the remote system supports, you
-will not be able to send any files.
+@samp{g} and @samp{G} protocols and 1024 for the @samp{v} protocol.
+Many older UUCP packages do not support packet sizes larger than 64, and
+many others do not support packet sizes larger than 128. Some UUCP
+packages will even dump core if a larger packet size is requested. The
+packet size is not a negotiation, and it may be different in each
+direction. If you request a packet size larger than the remote system
+supports, you will not be able to send any files.
@item startup-retries
The number of times to retry the initialization sequence. The default
is 8.
@@ -2750,7 +4665,7 @@ an escape sequence (@pxref{Chat Scripts}). The protocol does not have a
way to avoid printable ASCII characters (byte values from 32 to 126,
inclusive); only ASCII control characters and eight-bit characters may
be avoided. The default value is @samp{\021\023}; these are the
-characters @code{XON} and @code{XOFF} which many connections use for
+characters @code{XON} and @code{XOFF}, which many connections use for
flow control. If the package is configured to use @code{HAVE_BSD_TTY},
then on some versions of Unix you may have to avoid @samp{\377} as well,
due to the way some implementations of the BSD terminal driver handle
@@ -2779,6 +4694,17 @@ takes a numeric argument:
The timeout in seconds before giving up. The default is 120.
@end table
+The @samp{y} protocol is a streaming protocol contributed by Jorge Cwik.
+It supports the following commands, both of which take numeric
+arguments:
+
+@table @code
+@item timeout
+The timeout in seconds when waiting for a packet. The default is 60.
+@item packet-size
+The packet size to use. The default is 1024.
+@end table
+
The protocol parameters are reset to their default values after each
call.
@@ -2824,15 +4750,15 @@ the remote system. The default is yes.
@item transfer @var{boolean}
@findex transfer
-Equivalent to specifying both @samp{call-transfer @var{boolean}}
-@samp{called-transfer @var{boolean}}.
+A shorthand command, equivalent to specifying both @samp{call-transfer
+@var{boolean}} and @samp{called-transfer @var{boolean}}.
@item call-local-size @var{number} @var{string}
@findex call-local-size
The @var{string} is a time string (@pxref{Time Strings}). The
@var{number} is the size in bytes of the largest file that should be
-transferred at a time matching the time string if the local system
+transferred at a time matching the time string, if the local system
placed the call and the request was made by the local system. This
command may appear multiple times in a single alternate. If this
command does not appear, or if none of the time strings match, there are
@@ -2840,32 +4766,31 @@ no size restrictions.
With all the size control commands, the size of a file from the remote
system (as opposed to a file from the local system) will only be checked
-if the other system is running this package; other UUCP packages will
+if the other system is running this package: other UUCP packages will
not understand a maximum size request, nor will they provide the size of
remote files.
@item call-remote-size @var{number} @var{string}
@findex call-remote-size
-Specify the size in bytes of the largest file that should be
-transferred at a given time by remote request when the local system
-placed the call. This command may appear multiple times in a single
-alternate. If this command does not appear, there are no size
-restrictions.
+Specify the size in bytes of the largest file that should be transferred
+at a given time by remote request, when the local system placed the
+call. This command may appear multiple times in a single alternate. If
+this command does not appear, there are no size restrictions.
@item called-local-size @var{number} @var{string}
@findex called-local-size
Specify the size in bytes of the largest file that should be transferred
-at a given time by local request when the remote system placed the call.
-This command may appear multiple times in a single alternate. If this
-command does not appear, there are no size restrictions.
+at a given time by local request, when the remote system placed the
+call. This command may appear multiple times in a single alternate. If
+this command does not appear, there are no size restrictions.
@item called-remote-size @var{number} @var{string}
@findex called-remote-size
Specify the size in bytes of the largest file that should be transferred
-at a given time by remote request when the remote system placed the
+at a given time by remote request, when the remote system placed the
call. This command may appear multiple times in a single alternate. If
this command does not appear, there are no size restrictions.
@@ -2875,7 +4800,7 @@ this command does not appear, there are no size restrictions.
Specifies that files in the directories named by the @var{strings} may
be sent to the remote system when requested locally (using @code{uucp}
or @code{uux}). The directories in the list should be separated by
-whitespace. A @kbd{~} may be used for the public directory. On a Unix
+whitespace. A @samp{~} may be used for the public directory. On a Unix
system, this is typically @file{/usr/spool/uucppublic}; the public
directory may be set with the @code{pubdir} command. Here is an example
of @code{local-send}:
@@ -2904,19 +4829,19 @@ sent by local request).
@findex remote-send
Specifies that files in the named directories may be sent to the remote
-system when requested by the remote system. The default is @kbd{~}.
+system when requested by the remote system. The default is @samp{~}.
@item local-receive @var{strings}
@findex local-receive
Specifies that files may be received into the named directories when
-requested by a local user. The default is @kbd{~}.
+requested by a local user. The default is @samp{~}.
@item remote-receive @var{strings}
@findex remote-receive
Specifies that files may be received into the named directories when
-requested by the remote system. The default is @kbd{~}. On Unix, the
+requested by the remote system. The default is @samp{~}. On Unix, the
remote system may only request that files be received into directories
that are writeable by the world, regardless of how this is set.
@@ -2964,7 +4889,7 @@ used for the remote system, so that if somebody manages to spoof as the
remote system, it will be detected the next time the remote system
actually calls. This is false by default.
-@item command-path @var{string}
+@item command-path @var{strings}
@findex command-path
Specifies the path (a list of whitespace separated directories) to be
@@ -2997,7 +4922,7 @@ systems.
@item pubdir @var{string}
@findex pubdir in sys file
-Specifies the public directory that is used when @kbd{~} is specifed in
+Specifies the public directory that is used when @samp{~} is specifed in
a file transfer or a list of directories. This essentially overrides
the public directory specified in the main configuration file for this
system only. The default is the public directory specified in the main
@@ -3018,11 +4943,12 @@ that specified in the main configuration file or on the command line.
@findex max-remote-debug
When the system calls in, it may request that the debugging level be set
-to a certain value. This command may be used to put a limit on the
-debugging level which the system may request, to avoid filling up the
-disk with debugging information. Only the debugging types named in the
-@code{max-remote-debug} command may be turned on by the remote system.
-To prohibit any debugging, use @samp{max-remote-debug none}.
+to a certain value. The @code{max-remote-debug} command may be used to
+put a limit on the debugging level which the system may request, to
+avoid filling up the disk with debugging information. Only the
+debugging types named in the @code{max-remote-debug} command may be
+turned on by the remote system. To prohibit any debugging, use
+@samp{max-remote-debug none}.
@end table
@@ -3210,12 +5136,13 @@ to call out on a modem.
@item dialer @var{string} @dots{} [ modem only ]
-Execute a dialer command. If a dialer is named (by using the first form
-of this command, described just above), these commands are ignored.
-They may be used to specify dialer information directly in simple
-situations without needing to go to a separate file. There is no
-default. Some sort of dialer information must be specified to call out
-on a modem.
+If more than one string follows the @code{dialer} command, the strings
+are treated as a command that might appear in the dial file (@pxref{dial
+File}). If a dialer is named (by using the first form of this command,
+described just above), these commands are ignored. They may be used to
+specify dialer information directly in simple situations without needing
+to go to a separate file. There is no default. Some sort of dialer
+information must be specified to call out on a modem.
@item dialer-sequence @var{strings} [ modem or tcp or tli only ]
@findex dialer-sequence
@@ -3295,20 +5222,35 @@ Give the address to use when running as a TLI server. Escape sequences
in the address are expanded as they are for chat script expect strings
(@pxref{Chat Scripts}).
+The string is passed directly to the TLI @code{t_bind} function. The
+value needed may depend upon your particular TLI implementation. Check
+the manual pages, and, if necessary, try writing some sample programs.
+
+For AT&T 3B2 System V Release 3 using the Wollongong TCP/IP stack, which
+is probably typical, the format of TLI string is @samp{SSPPIIII}, where
+@samp{SS} is the service number (for TCP, this is 2), @samp{PP} is the
+TCP port number, and @samp{IIII} is the Internet address. For example,
+to accept a connection from on port 540 from any interface, use
+@samp{server-address \x00\x02\x02\x1c\x00\x00\x00\x00}. To only accept
+connections from a particular interface, replace the last four digits
+with the network address of the interface. (Thanks to Paul Pryor for
+the information in this paragraph).
+
@item command @var{strings} [ pipe only ]
@findex command
Give the command, with arguments, to run when using a pipe port type.
-When a port of this type is used, the command is executed and uucico
-communicates with it over a pipe. This permits uucico or cu to
-communicate with another system which can only be reached through some
-unusual means. A sample use might be @samp{command /bin/rlogin -E -8 -l
-@var{login} @var{system}}. The command is run with the full privileges
-of UUCP; it is responsible for maintaining security.
+When a port of this type is used, the command is executed and
+@code{uucico} communicates with it over a pipe. This permits
+@code{uucico} or @code{cu} to communicate with another system which can
+only be reached through some unusual means. A sample use might be
+@samp{command /bin/rlogin -E -8 -l @var{login} @var{system}}. The
+command is run with the full privileges of UUCP; it is responsible for
+maintaining security.
@end table
-@node dial File, Security, port File, Configuration Files
+@node dial File, UUCP Over TCP, port File, Configuration Files
@section The Dialer Configuration File
@cindex dial file
@cindex dialer configuration file
@@ -3343,12 +5285,14 @@ Introduces and names a dialer.
@item chat-program @var{strings}
@findex chat-program in dial file
-Specify a chat script to be used to dial the phone. See @ref{Chat
-Scripts} for full details on chat scripts.
+Specify a chat script to be used to dial the phone. This chat script is
+used before the login chat script in the @file{sys} file, if any
+(@pxref{Logging In}). For full details on chat scripts, see @ref{Chat
+Scripts}.
-Taylor UUCP will sleep for one second between attempts to dial out on a
-modem. If your modem requires a longer wait period, you must start your
-chat script with delays (@samp{\d} in a send string).
+The @code{uucico} daemon will sleep for one second between attempts to
+dial out on a modem. If your modem requires a longer wait period, you
+must start your chat script with delays (@samp{\d} in a send string).
The chat script will be read from and sent to the port specified by the
@code{dial-device} command for the port, if there is one.
@@ -3369,10 +5313,10 @@ require carrier (fail if not present)
See the description of the dialcodes file (@pxref{Configuration File
Names}) for a description of dialcode translation. If the port does not
-support carrier (as set by the @code{carrier} command in the port file)
+support carrier, as set by the @code{carrier} command in the port file,
@kbd{\M} and @kbd{\m} are ignored. If both the port and the dialer
-support carrier (as set by the @code{carrier} command in the port file
-and the @code{carrier} command in the dialer file), then every chat
+support carrier, as set by the @code{carrier} command in the port file
+and the @code{carrier} command in the dialer file, then every chat
script implicitly begins with @kbd{\M} and ends with @kbd{\m}. There is
no default chat script for dialers.
@@ -3407,10 +5351,10 @@ in a phone number. The default is a comma.
@item carrier @var{boolean}
@findex carrier in dial file
-If the argument is true, the dialer supports the modem carrier signal.
-After the phone number is dialed, @code{uucico} will require that
-carrier be on. One some systems, it will be able to wait for it. If
-the argument is false, carrier will not be required. The default is
+An argument of true means that the dialer supports the modem carrier
+signal. After the phone number is dialed, @code{uucico} will require
+that carrier be on. One some systems, it will be able to wait for it.
+If the argument is false, carrier will not be required. The default is
true.
@item carrier-wait @var{number}
@@ -3427,8 +5371,9 @@ If the first argument is true, then DTR is toggled before using
the modem. This is only supported on some systems and some ports. The
second @var{boolean} need not be present; if it is, and it is
true, the program will sleep for 1 second after toggling DTR.
-The default is not to toggle DTR.
+The default is to not toggle DTR.
+@need 500
@item complete-chat @var{strings}
@findex complete-chat
@item complete-chat-timeout @var{number}
@@ -3507,7 +5452,90 @@ causes them to not do bidirectional transfers.
@end table
-@node Security, , dial File, Configuration Files
+@node UUCP Over TCP, Security, dial File, Configuration Files
+@section UUCP Over TCP
+
+If your system has a Berkeley style socket library, or a System V style
+TLI interface library, you can compile the code to permit making
+connections over TCP. Specifying that a system should be reached via
+TCP is easy, but nonobvious.
+
+@menu
+* TCP Client:: Connecting to Another System Over TCP
+* TCP Server:: Running a TCP Server
+@end menu
+
+@node TCP Client, TCP Server, UUCP Over TCP, UUCP Over TCP
+@subsection Connecting to Another System Over TCP
+
+If you are using the new style configuration files (@pxref{Configuration
+Files}), add the line @samp{port type tcp} to the entry in the
+@file{sys} file. By default UUCP will get the port number by looking up
+@samp{uucp} in @file{/etc/services}; if the @samp{uucp} service is not
+defined, port 540 will be used. You can set the port number to use with
+the command @samp{port service @var{xxx}}, where @var{xxx} can be either
+a number or a name to look up in @file{/etc/services}. You can specify
+the address of the remote host with @samp{address @var{a.b.c}}; if you
+don't give an address, the remote system name will be used. You should
+give an explicit chat script for the system when you use TCP; the
+default chat script begins with a carriage return, which will not work
+with some UUCP TCP servers.
+
+If you are using V2 configuration files, add a line like this to
+@file{L.sys}:
+@example
+@var{sys} Any TCP uucp @var{host}.@var{domain} chat-script
+@end example
+This will make an entry for system @var{sys}, to be called at any time,
+over TCP, using port number @samp{uucp} (as found in
+@file{/etc/services}; this may be specified as a number), using remote
+host @file{@var{host}.@var{domain}}, with some chat script.
+
+If you are using HDB configuration files, add a line like this to
+Systems:
+@example
+@var{sys} Any TCP - @var{host}.@var{domain} chat-script
+@end example
+and a line like this to @file{Devices}:
+@example
+TCP uucp - -
+@end example
+You only need one line in @file{Devices} regardless of how many systems
+you contact over TCP. This will make an entry for system @var{sys}, to
+be called at any time, over TCP, using port number @samp{uucp} (as found
+in @file{/etc/services}; this may be specified as a number), using
+remote host @file{@var{host}.@var{domain}}, with some chat script.
+
+@node TCP Server, , TCP Client, UUCP Over TCP
+@subsection Running a TCP Server
+
+The @code{uucico} daemon may be run as a TCP server. To use the default
+port number, which is a reserved port, @code{uucico} must be invoked by
+the superuser (or it must be set user ID to the superuser, but I don't
+recommend doing that).
+
+You must define a port, either using the port file (@pxref{port File}),
+if you are using the new configuration method, or with an entry in
+@file{Devices} if you are using HDB; there is no way to define a port
+using V2. If you are using HDB the port must be named @samp{TCP}; a
+line as shown above will suffice. You can then start @code{uucico} as
+@samp{uucico -p TCP} (after the @samp{-p}, name the port; in HDB it must
+be @samp{TCP}). This will wait for incoming connections, and fork off a
+child for each one. Each connection will be prompted with @samp{login:}
+and @samp{Password:}; the results will be checked against the UUCP (not
+the system) password file (@pxref{Configuration File Names}).
+
+Another way to run a UUCP TCP server is to use the BSD @code{uucpd}
+program.
+
+Yet another way to run a UUCP TCP server is to use @code{inetd}.
+Arrange for @code{inetd} to start up @code{uucico} with the @samp{-l}
+switch. This will cause @code{uucico} to prompt with @samp{login:} and
+@samp{Password:} and check the results against the UUCP (not the system)
+password file (you may want to also use the @samp{-D} switch to avoid a
+fork, which in this case is unnecessary).
+
+@node Security, , UUCP Over TCP, Configuration Files
@section Security
This discussion of UUCP security applies only to Unix. It is a bit
@@ -3520,18 +5548,19 @@ If security is very important to you, then you should not permit any
external access to your computer, including UUCP. Any opening to the
outside world is a potential security risk.
-By default Taylor UUCP provides few mechanisms to secure local users of
-the system from each other. You can allow increased security by putting
-the owner of the UUCP programs (normally @code{uucp}) into a separate
-group; the use of this is explained in the following paragraphs, which
-refer to this separate group as @code{uucp-group}.
+When local users use UUCP to transfer files, Taylor UUCP can do little
+to secure them from each other. You can allow somewhat increased
+security by putting the owner of the UUCP programs (normally
+@code{uucp}) into a separate group; the use of this is explained in the
+following paragraphs, which refer to this separate group as
+@code{uucp-group}.
When the @code{uucp} program is invoked to copy a file to a remote
-system, it will by default copy the file into the UUCP spool directory.
-When the @code{uux} program is used, the @samp{-C} switch must be used
-to copy the file into the UUCP spool directory. In any case, once the
-file has been copied into the spool directory, other local users will
-not be able to access it.
+system, it will, by default, copy the file into the UUCP spool
+directory. When the @code{uux} program is used, the @samp{-C} switch
+must be used to copy the file into the UUCP spool directory. In any
+case, once the file has been copied into the spool directory, other
+local users will not be able to access it.
When a file is requested from a remote system, UUCP will only permit it
to be placed in a directory which is writable by the requesting user.
@@ -3570,7 +5599,7 @@ is used only for UUCP. If this is the case, then you should create a
call-in password file (@pxref{Configuration File Names}) and let
@code{uucico} do its own login prompting. For example, to let remote
sites log in on a port named @samp{entry} in the port file (@pxref{port
-File}) you might invoke @samp{uucico -p entry}. This would cause
+File}), you might invoke @samp{uucico -e -p entry}. This would cause
@code{uucico} to enter an endless loop of login prompts and daemon
executions. The advantage of this approach is that even if remote users
break into the system by guessing or learning the password, they will
@@ -3594,21 +5623,2292 @@ commands may be executed at the remote system's request. The default is
If different remote systems call in and they must be granted different
privileges (perhaps some systems are within the same organization and
some are not) then the @code{called-login} command should be used for
-each system to require that they different login names. Otherwise it
-would be simple for a remote system to use the @code{myname} command and
-pretend to be a different system. The @code{sequence} command can be
-used to detect when one system pretended to be another, but since the
-sequence numbers must be reset manually after a failed handshake this
-can sometimes be more trouble than it's worth.
+each system to require that they use different login names. Otherwise,
+it would be simple for a remote system to use the @code{myname} command
+and pretend to be a different system. The @code{sequence} command can
+be used to detect when one system pretended to be another, but, since
+the sequence numbers must be reset manually after a failed handshake,
+this can sometimes be more trouble than it's worth.
+
+@c START-OF-FAQ
+@ignore
+This chapter is used to generate the comp.mail.uucp UUCP Internals FAQ,
+as well as being part of the Taylor UUCP manual. Text that should
+appear only in the manual is bracketed by ifclear faq. Text that should
+appear only in the FAQ is bracketed by ifset faq.
+@end ignore
+
+@ifset faq
+@paragraphindent asis
+@format
+Subject: UUCP Internals Frequently Asked Questions
+Newsgroups: comp.mail.uucp,comp.answers,news.answers
+Followup-To: comp.mail.uucp
+Reply-To: ian@@airs.com (Ian Lance Taylor)
+Keywords: UUCP, protocol, FAQ
+Approved: news-answers-request@@MIT.Edu
+
+Archive-name: uucp-internals
+Version: $Revision: 1.108 $
+Last-modified: $Date: 1995/08/02 01:35:25 $
+@end format
+@end ifset
@node Protocols, Hacking, Configuration Files, Top
-@chapter UUCP protocol internals
+@chapter UUCP Protocol Internals
+
+@ifclear faq
+This chapter describes how the various UUCP protocols work, and
+discusses some other internal UUCP issues.
+
+This chapter is quite technical. You do not need to understand it, or
+even read it, in order to use Taylor UUCP. It is intended for people
+who are interested in how the UUCP code works.
+
+The information in this chapter is posted monthly to the Usenet
+newsgroups @samp{comp.mail.uucp}, @samp{news.answers}, and
+@samp{comp.answers}. The posting is available from any
+@samp{news.answers} archive site, such as @samp{rtfm.mit.edu}. If you
+plan to use this information to write a UUCP program, please make sure
+you get the most recent version of the posting, in case there have been
+any corrections.
+@end ifclear
+
+@ifset faq
+Recent changes:
+@itemize @bullet
+@item Conversion to Texinfo format.
+@item Description of the @samp{E} command.
+@item Description of optional number following @samp{-N} and @samp{ROKN}
+in UUCP protocol startup.
+@item Detailed description of the @samp{y} protocol.
+@item Mention the name uuxqt uses for lock files.
+@end itemize
+
+This article was written by Ian Lance Taylor @samp{<ian@@airs.com>} and
+I may even update it periodically. Please send me mail about
+suggestions or inaccuracies.
+
+This article describes how the various UUCP protocols work, and
+discusses some other internal UUCP issues. It does not describe how to
+configure UUCP, nor how to solve UUCP connection problems, nor how to
+deal with UUCP mail. I do not know of any FAQ postings on these topics.
+There are some documents on the net describing UUCP configuration, but I
+can not keep an up to date list here; try using archie.
+
+If you haven't read the @samp{news.announce.newusers} articles, read
+them.
+
+This article is in digest format. Some newsreaders will be able to
+break it apart into separate articles. Please don't ask me how to do
+this, though.
+
+This article covers the following topics. If questions about one of
+these topics is posted to @samp{comp.mail.uucp}, please send mail to the
+poster referring her or him to this FAQ. There is no reason to post a
+followup, as most of us know the answer already.
+@end ifset
+
+@menu
+* UUCP Protocol Sources:: Sources for UUCP Protocol Information
+* UUCP Grades:: UUCP Grades
+* UUCP Lock Files:: UUCP Lock Files
+* Execution File Format:: Execution File Format
+* UUCP Protocol:: UUCP Protocol
+* g Protocol:: g protocol
+* f Protocol:: f protocol
+* t Protocol:: t protocol
+* e Protocol:: e protocol
+* Big G Protocol:: G protocol
+* i Protocol:: i protocol
+* j Protocol:: j protocol
+* x Protocol:: x protocol
+* y Protocol:: y protocol
+* d Protocol:: d protocol
+* h Protocol:: h protocol
+* v Protocol:: v protocol
+@end menu
+
+@ifset faq
+@format
+UUCP Protocol Sources
+Alarm in Debugging Output
+UUCP Grades
+UUCP Lock Files
+Execution File Format
+UUCP Protocol
+UUCP @samp{g} Protocol
+UUCP @samp{f} Protocol
+UUCP @samp{t} Protocol
+UUCP @samp{e} Protocol
+UUCP @samp{G} Protocol
+UUCP @samp{i} Protocol
+UUCP @samp{j} Protocol
+UUCP @samp{x} Protocol
+UUCP @samp{y} Protocol
+UUCP @samp{d} Protocol
+UUCP @samp{h} Protocol
+UUCP @samp{v} Protocol
+Thanks
+
+----------------------------------------------------------------------
+
+From: UUCP Protocol Sources
+Subject: UUCP Protocol Sources
+
+@end format
+@end ifset
+
+@node UUCP Protocol Sources, UUCP Grades, Protocols, Protocols
+@section UUCP Protocol Sources
+
+@quotation
+``Unix-to-Unix Copy Program,'' said PDP-1. ``You will never find a more
+wretched hive of bugs and flamers. We must be cautious.''
+@flushright
+---DECWars
+@end flushright
+@end quotation
+
+I took a lot of the information from Jamie E. Hanrahan's paper in the
+Fall 1990 DECUS Symposium, and from @cite{Managing UUCP and Usenet} by Tim
+O'Reilly and Grace Todino (with contributions by several other
+people). The latter includes most of the former, and is published by
+@example
+O'Reilly & Associates, Inc.
+103 Morris Street, Suite A
+Sebastopol, CA 95472
+@end example
+It is currently in its tenth edition. The ISBN number is
+@samp{0-937175-93-5}.
+
+Some information is originally due to a Usenet article by Chuck Wegrzyn.
+The information on execution files comes partially from Peter Honeyman.
+The information on the @samp{g} protocol comes partially from a paper by
+G.L.@: Chesson of Bell Laboratories, partially from Jamie E. Hanrahan's
+paper, and partially from source code by John Gilmore. The information
+on the @samp{f} protocol comes from the source code by Piet Berteema.
+The information on the @samp{t} protocol comes from the source code by
+Rick Adams. The information on the @samp{e} protocol comes from a
+Usenet article by Matthias Urlichs. The information on the @samp{d}
+protocol comes from Jonathan Clark, who also supplied information about
+QFT. The UUPlus information comes straight from Christopher J. Ambler,
+of UUPlus Development; it applies to version 1.52 and up of the
+shareware version of UUPlus Utilities, called FSUUCP 1.52, but referred
+to in this article as UUPlus.
+
+Although there are few books about UUCP, there are many about networks
+and protocols in general. I recommend two non-technical books which
+describe the sorts of things that are available on the network:
+@cite{The Whole Internet}, by Ed Krol, and @cite{Zen and the Art of the
+Internet}, by Brendan P. Kehoe. Good technical discussions of
+networking issues can be found in @cite{Internetworking with TCP/IP}, by
+Douglas E. Comer and David L. Stevens and in @cite{Design and Validation
+of Computer Protocols} by Gerard J. Holzmann.
+
+@ifset faq
+@c Note that this section is only in the FAQ, since it does not fit in
+@c here in the manual.
+@format
+------------------------------
+
+From: Alarm in Debugging Output
+Subject: Alarm in Debugging Output
+
+Alarm in Debugging Output
+=========================
+@end format
+
+The debugging output of many versions of UUCP will include messages like
+@samp{alarm 1} or @samp{pkcget: alarm 1}. Taylor UUCP does not use the
+word @samp{alarm}, but will instead log messages like @samp{Timed out
+waiting for packet}.
+
+These types of messages mean that the UUCP package has timed out while
+waiting for some sort of response from the remote system. If it happens
+consistently when trying to transfer a particular file, then the most
+likely problem is that one of the modems will not transmit the XON or
+XOFF characters. Several UUCP protocols require an eight bit clean
+connection, which means that the modems must treat XON or XOFF as normal
+data characters, not as flow control signals. This should always be
+checked first.
+
+Other possible problems are that the modems have simply dropped their
+connection, or perhaps on one side or the other the serial buffer is
+overflowing and dropping characters. Another possibility is that the
+UUCP packages disagree about some aspect of the UUCP protocol, which is
+uncommon but does happen occasionally.
+
+Using the information in the following sections, you should be able to
+figure out what type of data your UUCP was expecting to receive. This
+may give some indication as to exactly what the problem is. It is
+difficult to be more specific, since there are many possiblities.
+
+@format
+------------------------------
+
+From: UUCP Grades
+Subject: UUCP Grades
+@end format
+@end ifset
+
+@node UUCP Grades, UUCP Lock Files, UUCP Protocol Sources, Protocols
+@section UUCP Grades
+@cindex grades implementation
+
+Modern UUCP packages support a priority grade for each command. The
+grades generally range from @kbd{A} (the highest) to @kbd{Z} followed by
+@kbd{a} to @kbd{z}. Some UUCP packages (including Taylor UUCP) also
+support @kbd{0} to @kbd{9} before @kbd{A}. Some UUCP packages may
+permit any ASCII character as a grade.
+
+On Unix, these grades are encoded in the name of the command file
+created by @code{uucp} or @code{uux}. A command file name generally has
+the form @file{C.nnnngssss} where @samp{nnnn} is the remote system name
+for which the command is queued, @samp{g} is a single character grade,
+and @samp{ssss} is a four character sequence number. For example, a
+command file created for the system @samp{airs} at grade @samp{Z} might
+be named @file{C.airsZ2551}.
+
+The remote system name will be truncated to seven characters, to
+ensure that the command file name will fit in the 14 character file
+name limit of the traditional Unix file system. UUCP packages which
+have no other means of distinguishing which command files are intended
+for which systems thus require all systems they connect to to have
+names that are unique in the first seven characters. Some UUCP
+packages use a variant of this format which truncates the system name
+to six characters. HDB and Taylor UUCP use a different spool
+directory format, which allows up to fourteen characters to be used
+for each system name.
+
+The sequence number in the command file name may be a decimal integer,
+or it may be a hexadecimal integer, or it may contain any alphanumeric
+character. Different UUCP packages are different.
+@ifclear faq
+Taylor UUCP uses any alphanumeric character.
+@end ifclear
+
+UUPlus Utilities (as FSUUCP, a shareware DOS based UUCP and news
+package) uses up to 8 characters for file names in the spool (this is a
+DOS file system limitation; actually, with the extension, 11 characters
+are available, but FSUUCP reserves that for future use). FSUUCP
+defaults mail to grade @samp{D}, and news to grade @samp{N}, except that
+when the grade of incoming mail can be determined, that grade is
+preserved if the mail is forwarded to another system. The default grades
+may be changed by editing the @file{LIB/MAILRC} file for mail, or the
+@file{UUPLUS.CFG} file for news.
+
+UUPC/extended for DOS, OS/2 and Windows NT handles mail at grade
+@samp{C}, news at grade @samp{d}, and file transfers at grade @samp{n}.
+The UUPC/extended @code{UUCP} and @code{RMAIL} commands accept grades to
+override the default, the others do not.
+
+I do not know how command grades are handled in other non-Unix UUCP
+packages.
+
+Modern UUCP packages allow you to restrict file transfer by grade
+depending on the time of day. Typically this is done with a line in
+the @file{Systems} (or @file{L.sys}) file like this:
+@example
+ airs Any/Z,Any2305-0855 ...
+@end example
+This allows grades @samp{Z} and above to be transferred at any time.
+Lower grades may only be transferred at night. I believe that this
+grade restriction applies to local commands as well as to remote
+commands, but I am not sure. It may only apply if the UUCP package
+places the call, not if it is called by the remote system.
+
+Taylor UUCP can use the @code{timegrade} and @code{call-timegrade}
+commands to achieve the same effect.
+@ifclear faq
+@xref{When to Call}.
+@end ifclear
+It supports the above format when reading @file{Systems} or
+@file{L.sys}.
+
+UUPC/extended provides the @code{symmetricgrades} option to announce the
+current grade in effect when calling the remote system.
+
+UUPlus allows specification of the highest grade accepted on a per-call
+basis with the @samp{-g} option in @code{UUCICO}.
+
+This sort of grade restriction is most useful if you know what grades
+are being used at the remote site. The default grades used depend on
+the UUCP package. Generally @code{uucp} and @code{uux} have different
+defaults. A particular grade can be specified with the @samp{-g} option
+to @code{uucp} or @code{uux}. For example, to request execution of
+@samp{rnews} on @samp{airs} with grade @samp{d}, you might use something
+like
+@example
+ uux -gd - airs!rnews < article
+@end example
+
+Uunet queues up mail at grade @samp{C}, but increases the grade based on
+the size. News is queued at grade @samp{d}, and file transfers at grade
+@samp{n}. The example above would allow mail (below some large size) to
+be received at any time, but would only permit news to be transferred at
+night.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP Lock Files
+Subject: UUCP Lock Files
+@end format
+@end ifset
+
+@node UUCP Lock Files, Execution File Format, UUCP Grades, Protocols
+@section UUCP Lock Files
+@cindex lock files
+
+This discussion applies only to Unix. I have no idea how UUCP locks
+ports on other systems.
+
+UUCP creates files to lock serial ports and systems. On most, if not
+all, systems, these same lock files are also used by @code{cu} to
+coordinate access to serial ports. On some systems @code{getty} also
+uses these lock files, often under the name @code{uugetty}.
+
+The lock file normally contains the process ID of the locking process.
+This makes it easy to determine whether a lock is still valid. The
+algorithm is to create a temporary file and then link it to the name
+that must be locked. If the link fails because a file with that name
+already exists, the existing file is read to get the process ID. If the
+process still exists, the lock attempt fails. Otherwise the lock file
+is deleted and the locking algorithm is retried.
+
+Older UUCP packages put the lock files in the main UUCP spool directory,
+@file{/usr/spool/uucp}. HDB UUCP generally puts the lock files in a
+directory of their own, usually @file{/usr/spool/locks} or
+@file{/etc/locks}.
+
+The original UUCP lock file format encodes the process ID as a four byte
+binary number. The order of the bytes is host-dependent. HDB UUCP
+stores the process ID as a ten byte ASCII decimal number, with a
+trailing newline. For example, if process 1570 holds a lock file, it
+would contain the eleven characters space, space, space, space, space,
+space, one, five, seven, zero, newline. Some versions of UUCP add a
+second line indicating which program created the lock (@code{uucp},
+@code{cu}, or @code{getty/uugetty}). I have also seen a third type of
+UUCP lock file which does not contain the process ID at all.
+
+The name of the lock file is traditionally @file{LCK..} followed by the
+base name of the device. For example, to lock @file{/dev/ttyd0} the
+file @file{LCK..ttyd0} would be created. On SCO Unix, the lock file
+name is always forced to lower case even if the device name has upper
+case letters.
+
+System V Release 4 UUCP names the lock file using the major and minor
+device numbers rather than the device name. The file is named
+@file{LK.@var{XXX}.@var{YYY}.@var{ZZZ}}, where @var{XXX}, @var{YYY} and
+@var{ZZZ} are all three digit decimal numbers. @var{XXX} is the major
+device number of the device holding the directory holding the device
+file (e.g., @file{/dev}). @var{YYY} is the major device number of the
+device file itself. @var{ZZZ} is the minor device number of the device
+file itself. If @code{s} holds the result of passing the device to the
+stat system call (e.g., @code{stat ("/dev/ttyd0", &s)}), the following
+line of C code will print out the corresponding lock file name:
+@example
+ printf ("LK.%03d.%03d.%03d", major (s.st_dev),
+ major (s.st_rdev), minor (s.st_rdev));
+@end example
+The advantage of this system is that even if there are several links to
+the same device, they will all use the same lock file name.
+
+When two or more instances of @code{uuxqt} are executing, some sort of
+locking is needed to ensure that a single execution job is only started
+once. I don't know how most UUCP packages deal with this. Taylor UUCP
+uses a lock file for each execution job. The name of the lock file is
+the same as the name of the @file{X.*} file, except that the initial
+@samp{X} is changed to an @samp{L}. The lock file holds the process ID
+as described above.
+
+@ifset faq
+@format
+------------------------------
+
+From: Execution File Format
+Subject: Execution File Format
+@end format
+@end ifset
+
+@node Execution File Format, UUCP Protocol, UUCP Lock Files, Protocols
+@section Execution File Format
+@cindex execution file format
+@cindex @file{X.*} file format
+
+UUCP @file{X.*} files control program execution. They are created by
+@code{uux}. They are transferred between systems just like any other
+file. The @code{uuxqt} daemon reads them to figure out how to execute
+the job requested by @code{uux}.
+
+An @file{X.*} file is simply a text file. The first character of each
+line is a command, and the remainder of the line supplies arguments.
+The following commands are defined:
+
+@table @samp
+@item C command
+This gives the command to execute, including the program and all
+arguments. For example, @samp{rmail ian@@airs.com}.
+
+@item U user system
+This names the user who requested the command, and the system from which
+the request came.
+
+@item I standard-input
+This names the file from which standard input is taken. If no standard
+input file is given, the standard input will probably be attached to
+@file{/dev/null}. If the standard input file is not from the system on
+which the execution is to occur, it will also appear in an @samp{F}
+command.
+
+@item O standard-output [system]
+This names the standard output file. The optional second argument names
+the system to which the file should be sent. If there is no second
+argument, the file should be created on the executing system.
+
+@item F required-file [filename-to-use]
+The @samp{F} command can appear multiple times. Each @samp{F} command
+names a file which must exist before the execution can proceed. This
+will usually be a file which is transferred from the system on which
+@code{uux} was executed, but it can also be a file from the local system
+or some other system. If the file is not from the local system, then
+the command will usually name a file in the spool directory. If the
+optional second argument appears, then the file should be copied to the
+execution directory under that name. This is necessary for any file
+other than the standard input file. If the standard input file is not
+from the local system, it will appear in both an @samp{F} command and an
+@samp{I} command.
+
+@item R requestor-address
+This is the address to which mail about the job should be sent. It is
+relative to the system named in the @samp{U} command. If the @samp{R}
+command does not appear, then mail is sent to the user named in the
+@samp{U} command.
+
+@item Z
+This command takes no arguments. It means that a mail message should be
+sent if the command failed. This is the default behaviour for most
+modern UUCP packages, and for them the @samp{Z} command does not
+actually do anything.
+
+@item N
+This command takes no arguments. It means that no mail message should
+be sent, even if the command failed.
+
+@item n
+This command takes no arguments. It means that a mail message should be
+sent if the command succeeded. Normally a message is sent only if the
+command failed.
+
+@item B
+This command takes no arguments. It means that the standard input
+should be returned with any error message. This can be useful in cases
+where the input would otherwise be lost.
+
+@item e
+This command takes no arguments. It means that the command should be
+processed with @file{/bin/sh}. For some packages this is the default
+anyhow. Most packages will refuse to execute complex commands or
+commands containing wildcards, because of the security holes this opens.
+
+@item E
+This command takes no arguments. It means that the command should be
+processed with the @code{execve} system call. For some packages this is
+the default anyhow.
+
+@item M status-file
+This command means that instead of mailing a message, the message should
+be copied to the named file on the system named by the @samp{U} command.
+
+@item # comment
+This command is ignored, as is any other unrecognized command.
+@end table
+
+Here is an example. Given the following command executed on system
+test1
+@example
+ uux - test2!cat - test2!~ian/bar !qux '>~/gorp'
+@end example
+(this is only an example, as most UUCP systems will not permit the cat
+command to be executed) Taylor UUCP will produce something like the
+following @file{X.} file:
+@example
+U ian test1
+F D.test1N003r qux
+O /usr/spool/uucppublic test1
+F D.test1N003s
+I D.test1N003s
+C cat - ~ian/bar qux
+@end example
+The standard input will be read into a file and then transferred to the
+file @file{D.test1N003s} on system @samp{test2}. The file @file{qux}
+will be transferred to @file{D.test1N003r} on system @samp{test2}. When
+the command is executed, the latter file will be copied to the execution
+directory under the name @samp{qux}. Note that since the file
+@file{~ian/bar} is already on the execution system, no action need be
+taken for it. The standard output will be collected in a file, then
+copied to the directory @file{/usr/spool/uucppublic} on the system
+@samp{test1}.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP Protocol
+Subject: UUCP Protocol
+@end format
+@end ifset
+
+@node UUCP Protocol, g Protocol, Execution File Format, Protocols
+@section UUCP Protocol
+@cindex UUCP protocol
+@cindex protocol, UUCP
+
+The UUCP protocol is a conversation between two UUCP packages. A UUCP
+conversation consists of three parts: an initial handshake, a series of
+file transfer requests, and a final handshake.
+
+@menu
+* The Initial Handshake:: The Initial Handshake
+* UUCP Protocol Commands:: UUCP Protocol Commands
+* The Final Handshake:: The Final Handshake
+@end menu
+
+@node The Initial Handshake, UUCP Protocol Commands, UUCP Protocol, UUCP Protocol
+@subsection The Initial Handshake
+@cindex initial handshake
+
+Before the initial handshake, the caller will usually have logged in the
+called machine and somehow started the UUCP package there. On Unix this
+is normally done by setting the shell of the login name used to
+@file{/usr/lib/uucp/uucico}.
+
+All messages in the initial handshake begin with a @kbd{^P} (a byte with
+the octal value @samp{\020}) and end with a null byte (@samp{\000}). A
+few systems end these messages with a line feed character (@samp{\012})
+instead of a null byte; the examples below assume a null byte is being
+used.
+
+Some options below are supported by QFT, which stands for Queued File
+Transfer, and is (or was) an internal Bell Labs version of UUCP.
+
+Taylor UUCP size negotiation was introduced by Taylor UUCP, and is
+also supported by DOS based UUPlus and Amiga based wUUCP and
+UUCP-1.17.
-A detailed description of how the various UUCP protocols work is posted
-monthly to the newsgroups @samp{comp.mail.uucp}, @samp{news.answers} and
-@samp{comp.answers}. There is no need to read this information in order
-to use Taylor UUCP. It is intended for people who are interested in how
-the UUCP code works.
+The initial handshake goes as follows. It is begun by the called
+machine.
+
+@table @asis
+@item called: @samp{\020Shere=hostname\000}
+The hostname is the UUCP name of the called machine. Older UUCP
+packages do not output it, and simply send @samp{\020Shere\000}.
+
+@item caller: @samp{\020Shostname options\000}
+The hostname is the UUCP name of the calling machine. The following
+options may appear (or there may be none):
+
+@table @samp
+@item -QSEQ
+Report sequence number for this conversation. The sequence number is
+stored at both sites, and incremented after each call. If there is a
+sequence number mismatch, something has gone wrong (somebody may have
+broken security by pretending to be one of the machines) and the call is
+denied. If the sequence number changes on one of the machines, perhaps
+because of an attempted breakin or because a disk backup was restored,
+the sequence numbers on the two machines must be reconciled manually.
+
+@item -xLEVEL
+Requests the called system to set its debugging level to the specified
+value. This is not supported by all systems.
+
+@item -pGRADE
+@itemx -vgrade=GRADE
+Requests the called system to only transfer files of the specified grade
+or higher. This is not supported by all systems. Some systems support
+@samp{-p}, some support @samp{-vgrade=}. UUPlus allows either @samp{-p}
+or @samp{-v} to be specified on a per-system basis in the @file{SYSTEMS}
+file (@samp{gradechar} option).
+
+@item -R
+Indicates that the calling UUCP understands how to restart failed file
+transmissions. Supported only by System V Release 4 UUCP, QFT, and
+Taylor UUCP.
+
+@item -ULIMIT
+Reports the ulimit value of the calling UUCP. The limit is specified as
+a base 16 number in C notation (e.g., @samp{-U0x1000000}). This number
+is the number of 512 byte blocks in the largest file which the calling
+UUCP can create. The called UUCP may not transfer a file larger than
+this. Supported only by System V Release 4 UUCP, QFT and UUPlus.
+UUPlus reports the lesser of the available disk space on the spool
+directory drive and the ulimit variable in @file{UUPLUS.CFG}. Taylor
+UUCP understands this option, but does not generate it.
+
+@item -N[NUMBER]
+Indicates that the calling UUCP understands the Taylor UUCP size
+negotiation extension. Not supported by traditional UUCP packages.
+Supported by UUPlus. The optional number is a bitmask of features
+supported by the calling UUCP, and is described below.
+@end table
+
+@item called: @samp{\020ROK\000}
+There are actually several possible responses.
+@table @samp
+@item ROK
+The calling UUCP is acceptable, and the handshake proceeds to the
+protocol negotiation. Some options may also appear; see below.
+@item ROKN[NUMBER]
+The calling UUCP is acceptable, it specified @samp{-N}, and the called
+UUCP also understands the Taylor UUCP size limiting extensions. The
+optional number is a bitmask of features supported by the called UUCP,
+and is described below.
+@item RLCK
+The called UUCP already has a lock for the calling UUCP, which normally
+indicates the two machines are already communicating.
+@item RCB
+The called UUCP will call back. This may be used to avoid impostors
+(but only one machine out of each pair should call back, or no
+conversation will ever begin).
+@item RBADSEQ
+The call sequence number is wrong (see the @samp{-Q} discussion above).
+@item RLOGIN
+The calling UUCP is using the wrong login name.
+@item RYou are unknown to me
+The calling UUCP is not known to the called UUCP, and the called UUCP
+does not permit connections from unknown systems. Some versions of UUCP
+just drop the line rather than sending this message.
+@end table
+
+If the response is @samp{ROK}, the following options are supported by
+System V Release 4 UUCP and QFT.
+@table @samp
+@item -R
+The called UUCP knows how to restart failed file transmissions.
+@item -ULIMIT
+Reports the ulimit value of the called UUCP. The limit is specified as
+a base 16 number in C notation. This number is the number of 512 byte
+blocks in the largest file which the called UUCP can create. The
+calling UUCP may not send a file larger than this. Also supported by
+UUPlus. Taylor UUCP understands this option, but does not generate it.
+@item -xLEVEL
+I'm not sure just what this means. It may request the
+calling UUCP to set its debugging level to the specified
+value.
+@end table
+
+If the response is not @samp{ROK} (or @samp{ROKN}) both sides hang up
+the phone, abandoning the call.
+
+@item called: @samp{\020Pprotocols\000}
+Note that the called UUCP outputs two strings in a row. The protocols
+string is a list of UUCP protocols supported by the caller. Each UUCP
+protocol has a single character name. These protocols are discussed in
+more detail later in this document. For example, the called UUCP might
+send @samp{\020Pgf\000}.
+
+@item caller: @samp{\020Uprotocol\000}
+The calling UUCP selects which protocol to use out of the protocols
+offered by the called UUCP. If there are no mutually supported
+protocols, the calling UUCP sends @samp{\020UN\000} and both sides hang
+up the phone. Otherwise the calling UUCP sends something like
+@samp{\020Ug\000}.
+@end table
+
+Most UUCP packages will consider each locally supported protocol in turn
+and select the first one supported by the called UUCP. With some
+versions of HDB UUCP, this can be modified by giving a list of protocols
+after the device name in the @file{Devices} file or the @file{Systems}
+file. For example, to select the @samp{e} protocol in @file{Systems},
+@example
+ airs Any ACU,e ...
+@end example
+or in Devices,
+@example
+ ACU,e ttyXX ...
+@end example
+Taylor UUCP provides the @code{protocol}
+command which may be used either
+for a system
+@ifclear faq
+(@pxref{Protocol Selection})
+@end ifclear
+or a
+@ifclear faq
+port (@pxref{port File}).
+@end ifclear
+@ifset faq
+port.
+@end ifset
+UUPlus allows specification of the protocol string on a per-system basis
+in the @file{SYSTEMS} file.
+
+The optional number following a @samp{-N} sent by the calling system, or
+an @samp{ROKN} sent by the called system, is a bitmask of features
+supported by the UUCP package. The optional number was introduced in
+Taylor UUCP version 1.04. The number is sent as an octal number with a
+leading zero. The following bits are currently defined. A missing
+number should be taken as @samp{011}.
+
+@table @samp
+@item 01
+UUCP supports size negotiation.
+
+@item 02
+UUCP supports file restart.
+
+@item 04
+UUCP supports the @samp{E} command.
+
+@item 010
+UUCP requires the file size in the @samp{S} and @samp{R} commands to be
+in base 10. This bit is used by default if no number appears, but
+should not be explicitly sent.
+
+@item 020
+UUCP expects a dummy string between the notify field and the size field
+in an @samp{S} command. This is true of SVR4 UUCP. This bit should not
+be used.
+@end table
+
+After the protocol has been selected and the initial handshake has been
+completed, both sides turn on the selected protocol. For some protocols
+(notably @samp{g}) a further handshake is done at this point.
+
+@node UUCP Protocol Commands, The Final Handshake, The Initial Handshake, UUCP Protocol
+@subsection UUCP Protocol Commands
+
+Each protocol supports a method for sending a command to the remote
+system. This method is used to transmit a series of commands between
+the two UUCP packages. At all times, one package is the master and the
+other is the slave. Initially, the calling UUCP is the master.
+
+If a protocol error occurs during the exchange of commands, both sides
+move immediately to the final handshake.
+
+The master will send one of five commands: @samp{S}, @samp{R}, @samp{X},
+@samp{E}, or @samp{H}.
+
+Any file name referred to below is either an absolute file name
+beginning with @file{/}, a public directory file name beginning with
+@file{~/}, a file name relative to a user's home directory beginning
+with @file{~@var{USER}/}, or a spool directory file name. File names in
+the spool directory are not absolute, but instead are converted to file
+names within the spool directory by UUCP. They always begin with
+@file{C.} (for a command file created by @code{uucp} or @code{uux}),
+@file{D.} (for a data file created by @code{uucp}, @code{uux} or by an
+execution, or received from another system for an execution), or
+@file{X.} (for an execution file created by @code{uux} or received from
+another system).
+
+@menu
+* The S Command:: The S Command
+* The R Command:: The R Command
+* The X Command:: The X Command
+* The E Command:: The E Command
+* The H Command:: The H Command
+@end menu
+
+@node The S Command, The R Command, UUCP Protocol Commands, UUCP Protocol Commands
+@subsubsection The S Command
+@cindex S UUCP protocol command
+@cindex UUCP protocol S command
+
+@table @asis
+@item master: @samp{S @var{from} @var{to} @var{user} -@var{options} @var{temp} @var{mode} @var{notify} @var{size}}
+The @samp{S} and the @samp{-} are literal characters. This is a request
+by the master to send a file to the slave.
+
+@table @var
+@item from
+The name of the file to send. If the @samp{C} option does not appear in
+@var{options}, the master will actually open and send this file.
+Otherwise the file has been copied to the spool directory, where it is
+named @var{temp}. The slave ignores this field unless @var{to} is a
+directory, in which case the basename of @var{from} will be used as the
+file name. If @var{from} is a spool directory filename, it must be a
+data file created for or by an execution, and must begin with @file{D.}.
+
+@item to
+The name to give the file on the slave. If this field names a directory
+the file is placed within that directory with the basename of
+@var{from}. A name ending in @samp{/} is taken to be a directory even
+if one does not already exist with that name. If @var{to} begins with
+@file{X.}, an execution file will be created on the slave. Otherwise,
+if @var{to} begins with @file{D.} it names a data file to be used by
+some execution file. Otherwise, @var{to} should not be in the spool
+directory.
+
+@item user
+The name of the user who requested the transfer.
+
+@item options
+A list of options to control the transfer. The following
+options are defined (all options are single characters):
+@table @samp
+@item C
+The file has been copied to the spool directory
+(the master should use @var{temp} rather than @var{from}).
+@item c
+The file has not been copied to the spool directory (this is the
+default).
+@item d
+The slave should create directories as necessary (this is the default).
+@item f
+The slave should not create directories if necessary, but should fail
+the transfer instead.
+@item m
+The master should send mail to @var{user} when the transfer is complete.
+@item n
+The slave should send mail to @var{notify} when the transfer is
+complete.
+@end table
+
+@item temp
+If the @samp{C} option appears in @var{options}, this names the file to
+be sent. Otherwise if @var{from} is in the spool directory, @var{temp}
+is the same as @var{from}. Otherwise @var{temp} may be a dummy string,
+such as @file{D.0}. After the transfer has been succesfully completed,
+the master will delete the file @var{temp}.
+
+@item mode
+This is an octal number giving the mode of the file on the master. If
+the file is not in the spool directory, the slave will always create it
+with mode 0666, except that if (@var{mode} & 0111) is not zero (the file
+is executable), the slave will create the file with mode 0777. If the
+file is in the spool directory, some UUCP packages will use the
+algorithm above and some will always create the file with mode 0600.
+This field is ignored by UUPlus, since it is meaningless on DOS; UUPlus
+uses 0666 for outgoing files.
+
+@item notify
+This field may not be present, and in any case is only meaningful if the
+@samp{n} option appears in @var{options}. If the @samp{n} option
+appears, then, when the transfer is successfully completed, the slave
+will send mail to @var{notify}, which must be a legal mailing address on
+the slave. If a @var{size} field will appear but the @samp{n} option
+does not appear, @var{notify} will always be present, typically as the
+string @samp{dummy} or simply a pair of double quotes.
+
+@item size
+This field is only present when doing Taylor UUCP or SVR4 UUCP size
+negotiation. It is the size of the file in bytes. Taylor UUCP version
+1.03 sends the size as a decimal integer, while versions 1.04 and up,
+and all other UUCP packages that support size negotiation, send the size
+in base 16 with a leading 0x.
+@end table
+
+The slave then responds with an @samp{S} command response.
+
+@table @samp
+@item SY @var{start}
+The slave is willing to accept the file, and file transfer begins. The
+@var{start} field will only be present when using file restart. It
+specifies the byte offset into the file at which to start sending. If
+this is a new file, @var{start} will be 0x0.
+
+@item SN2
+The slave denies permission to transfer the file. This can mean that
+the destination directory may not be accessed, or that no requests are
+permitted. It implies that the file transfer will never succeed.
+
+@item SN4
+The slave is unable to create the necessary temporary file. This
+implies that the file transfer might succeed later.
+
+@item SN6
+This is only used by Taylor UUCP size negotiation. It means that the
+slave considers the file too large to transfer at the moment, but it may
+be possible to transfer it at some other time.
+
+@item SN7
+This is only used by Taylor UUCP size negotiation. It means that the
+slave considers the file too large to ever transfer.
+
+@item SN8
+This is only used by Taylor UUCP. It means that the file was already
+received in a previous conversation. This can happen if the receive
+acknowledgement was lost after it was sent by the receiver but before it
+was received by the sender.
+
+@item SN9
+This is only used by Taylor UUCP (versions 1.05 and up) and UUPlus
+(versions 2.0 and up). It means that the remote system was unable to
+open another channel (see the discussion of the @samp{i} protocol for
+more information about channels). This implies that the file transfer
+might succeed later.
+
+@item SN10
+This is reportedly used by SVR4 UUCP to mean that the file size is too
+large.
+@end table
+
+If the slave responds with @samp{SY}, a file transfer begins. When the
+file transfer is complete, the slave sends a @samp{C} command response.
+
+@table @samp
+@item CY
+The file transfer was successful.
+@item CYM
+The file transfer was successful, and the slave wishes to become the
+master; the master should send an @samp{H} command, described below.
+@item CN5
+The temporary file could not be moved into the final location. This
+implies that the file transfer will never succeed.
+@end table
+@end table
+
+After the @samp{C} command response has been received (in the @samp{SY}
+case) or immediately (in an @samp{SN} case) the master will send another
+command.
+
+@node The R Command, The X Command, The S Command, UUCP Protocol Commands
+@subsubsection The R Command
+@cindex R UUCP protocol command
+@cindex UUCP protocol R command
+
+@table @asis
+@item master: @samp{R @var{from} @var{to} @var{user} -@var{options} @var{size}}
+The @samp{R} and the @samp{-} are literal characters. This is a request
+by the master to receive a file from the slave. I do not know how SVR4
+UUCP or QFT implement file transfer restart in this case.
+
+@table @var
+@item from
+This is the name of the file on the slave which the master wishes to
+receive. It must not be in the spool directory, and it may not contain
+any wildcards.
+
+@item to
+This is the name of the file to create on the master. I do not believe
+that it can be a directory. It may only be in the spool directory if
+this file is being requested to support an execution either on the
+master or on some system other than the slave.
+
+@item user
+The name of the user who requested the transfer.
+
+@item options
+A list of options to control the transfer. The following
+options are defined (all options are single characters):
+@table @samp
+@item d
+The master should create directories as necessary (this is the default).
+@item f
+The master should not create directories if necessary, but should fail
+the transfer instead.
+@item m
+The master should send mail to @var{user} when the transfer is complete.
+@end table
+
+@item size
+This only appears if Taylor UUCP size negotiation is being used. It
+specifies the largest file which the master is prepared to accept (when
+using SVR4 UUCP or QFT, this was specified in the @samp{-U} option
+during the initial handshake).
+@end table
+
+The slave then responds with an @samp{R} command response. UUPlus does
+not support @samp{R} requests, and always responds with @samp{RN2}.
+
+@table @samp
+@item RY @var{mode} [@var{size}]
+The slave is willing to send the file, and file transfer begins. The
+@var{mode} argument is the octal mode of the file on the slave. The
+master treats this just as the slave does the @var{mode} argument in the
+send command, q.v. I am told that SVR4 UUCP sends a trailing @var{size}
+argument. For some versions of BSD UUCP, the @var{mode} argument may
+have a trailing @samp{M} character (e.g., @samp{RY 0666M}). This means
+that the slave wishes to become the master.
+
+@item RN2
+The slave is not willing to send the file, either because it is not
+permitted or because the file does not exist. This implies that the
+file request will never succeed.
+
+@item RN6
+This is only used by Taylor UUCP size negotiation. It means that the
+file is too large to send, either because of the size limit specifies by
+the master or because the slave considers it too large. The file
+transfer might succeed later, or it might not (this may be cleared up in
+a later release of Taylor UUCP).
+
+@item RN9
+This is only used by Taylor UUCP (versions 1.05 and up) and FSUUCP
+(versions 1.5 and up). It means that the remote system was unable to
+open another channel (see the discussion of the @samp{i} protocol for
+more information about channels). This implies that the file transfer
+might succeed later.
+@end table
+
+If the slave responds with @samp{RY}, a file transfer begins. When the
+file transfer is complete, the master sends a @samp{C} command. The
+slave pretty much ignores this, although it may log it.
+
+@table @samp
+@item CY
+The file transfer was successful.
+@item CN5
+The temporary file could not be moved into the final location.
+@end table
+
+After the @samp{C} command response has been sent (in the @samp{RY}
+case) or immediately (in an @samp{RN} case) the master will send another
+command.
+@end table
+
+@node The X Command, The E Command, The R Command, UUCP Protocol Commands
+@subsubsection The X Command
+@cindex X UUCP protocol command
+@cindex UUCP protocol X command
+
+@table @asis
+@item master: @samp{X @var{from} @var{to} @var{user} -@var{options}}
+The @samp{X} and the @samp{-} are literal characters. This is a request
+by the master to, in essence, execute uucp on the slave. The slave
+should execute @samp{uucp @var{from} @var{to}}.
+
+@table @var
+@item from
+This is the name of the file or files on the slave which the master
+wishes to transfer. Any wildcards are expanded on the slave. If the
+master is requesting that the files be transferred to itself, the
+request would normally contain wildcard characters, since otherwise an
+@samp{R} command would suffice. The master can also use this command to
+request that the slave transfer files to a third system.
+
+@item to
+This is the name of the file or directory to which the files should be
+transferred. This will normally use a UUCP name. For example, if the
+master wishes to receive the files itself, it would use
+@samp{master!path}.
+
+@item user
+The name of the user who requested the transfer.
+
+@item options
+A list of options to control the transfer. It is not clear which, if
+any, options are supported by most UUCP packages.
+@end table
+
+The slave then responds with an @samp{X} command response. FSUUCP does
+not support @samp{X} requests, and always responds with @samp{XN}.
+
+@table @samp
+@item XY
+The request was accepted, and the appropriate file transfer commands
+have been queued up for later processing.
+
+@item XN
+The request was denied. No particular reason is given.
+@end table
+
+In either case, the master will then send another command.
+@end table
+
+@node The E Command, The H Command, The X Command, UUCP Protocol Commands
+@subsubsection The E Command
+@cindex E UUCP protocol command
+@cindex UUCP protocol E command
+
+@table @asis
+@item master: @samp{E @var{from} @var{to} @var{user} -@var{options} @var{temp} @var{mode} @var{notify} @var{size} @var{command}}
+The @samp{E} command is only supported by Taylor UUCP 1.04 and up. It
+is used to make an execution request without requiring a separate
+@file{X.*} file.
+@ifclear faq
+@xref{Execution File Format}.
+@end ifclear
+It is only used when the command to be executed requires a single input
+file which is passed to it as standard input.
+
+All the fields have the same meaning as they do for an @samp{S} command,
+except for @var{options} and @var{command}.
+
+@table @var
+@item options
+A list of options to control the transfer. The following options are
+defined (all options are single characters):
+@table @samp
+@item C
+The file has been copied to the spool directory (the master should use
+@var{temp} rather than @var{from}).
+@item c
+The file has not been copied to the spool directory (this is the
+default).
+@item N
+No mail message should be sent, even if the command fails. This is the
+equivalent of the @samp{N} command in an @file{X.*} file.
+@item Z
+A mail message should be sent if the command fails (this is generally
+the default in any case). This is the equivalent of the @samp{Z}
+command in an @file{X.*} file.
+@item R
+Mail messages about the execution should be sent to the address in the
+@var{notify} field. This is the equivalent of the @samp{R} command in
+an @file{X.*} file.
+@item e
+The execution should be done with @file{/bin/sh}. This is the
+equivalent of the @samp{e} command in an @file{X.*} file.
+@end table
+
+@item command
+The command which should be executed. This is the equivalent of the
+@samp{C} command in an @file{X.*} file.
+@end table
+
+The slave then responds with an @samp{E} command response. These are
+the same as the @samp{S} command responses, but the initial character is
+@samp{E} rather than @samp{S}.
+
+If the slave responds with @samp{EY}, the file transfer begins. When
+the file transfer is complete, the slave sends a @samp{C} command
+response, just as for the @samp{S} command. After a successful file
+transfer, the slave is responsible for arranging for the command to be
+executed. The transferred file is passed as standard input, as though
+it were named in the @samp{I} and @samp{F} commands of an @file{X.*}
+file.
+
+After the @samp{C} command response has been received (in the @samp{EY}
+case) or immediately (in an @samp{EN} case) the master will send another
+command.
+@end table
+
+@node The H Command, , The E Command, UUCP Protocol Commands
+@subsubsection The H Command
+@cindex H UUCP protocol command
+@cindex UUCP protocol H command
+
+@table @asis
+@item master: @samp{H}
+This is used by the master to hang up the connection. The slave will
+respond with an @samp{H} command response.
+
+@table @samp
+@item HY
+The slave agrees to hang up the connection. In this case the master
+sends another @samp{HY} command. In some UUCP packages the slave will
+then send a third @samp{HY} command. At this point the protocol is shut
+down, and the final handshake is begun.
+@item HN
+The slave does not agree to hang up. In this case the master and the
+slave exchange roles. The next command will be sent by the former
+slave, which is the new master. The roles may be reversed several times
+during a single connection.
+@end table
+@end table
+
+@node The Final Handshake, , UUCP Protocol Commands, UUCP Protocol
+@subsection The Final Handshake
+@cindex final handshake
+
+After the protocol has been shut down, the final handshake is performed.
+This handshake has no real purpose, and some UUCP packages simply drop
+the connection rather than do it (in fact, some will drop the connection
+immediately after both sides agree to hangup, without even closing down
+the protocol).
+
+@table @asis
+@item caller: @samp{\020OOOOOO\000}
+
+@item called: @samp{\020OOOOOOO\000}
+@end table
+
+That is, the calling UUCP sends six @samp{O} characters and the called
+UUCP replies with seven @samp{O} characters. Some UUCP packages always
+send six @samp{O} characters.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{g} Protocol
+Subject: UUCP @samp{g} Protocol
+@end format
+@end ifset
+
+@node g Protocol, f Protocol, UUCP Protocol, Protocols
+@section UUCP @samp{g} Protocol
+@cindex @samp{g} protocol
+@cindex protocol @samp{g}
+
+The @samp{g} protocol is a packet based flow controlled error correcting
+protocol that requires an eight bit clear connection. It is the
+original UUCP protocol, and is supported by all UUCP implementations.
+Many implementations of it are only able to support small window and
+packet sizes, specifically a window size of 3 and a packet size of 64
+bytes, but the protocol itself can support up to a window size of 7 and
+a packet size of 4096 bytes. Complaints about the inefficiency of the
+@samp{g} protocol generally refer to specific implementations, rather
+than to the correctly implemented protocol.
+
+The @samp{g} protocol was originally designed for general packet
+drivers, and thus contains some features that are not used by UUCP,
+including an alternate data channel and the ability to renegotiate
+packet and window sizes during the communication session.
+
+The @samp{g} protocol is spoofed by many Telebit modems. When spoofing
+is in effect, each Telebit modem uses the @samp{g} protocol to
+communicate with the attached computer, but the data between the modems
+is sent using a Telebit proprietary error correcting protocol. This
+allows for very high throughput over the Telebit connection, which,
+because it is half-duplex, would not normally be able to handle the
+@samp{g} protocol very well at all. When a Telebit is spoofing the
+@samp{g} protocol, it forces the packet size to be 64 bytes and the
+window size to be 3.
+
+This discussion of the @samp{g} protocol explains how it works, but does
+not discuss useful error handling techniques. Some discussion of this
+can be found in Jamie E. Hanrahan's paper, cited
+@ifclear faq
+above (@pxref{UUCP Protocol Sources}).
+@end ifclear
+@ifset faq
+above.
+@end ifset
+
+All @samp{g} protocol communication is done with packets. Each packet
+begins with a six byte header. Control packets consist only of the
+header. Data packets contain additional data.
+
+The header is as follows:
+
+@table @asis
+@item @samp{\020}
+Every packet begins with a @kbd{^P}.
+
+@item @var{k} (1 <= @var{k} <= 9)
+The @var{k} value is always 9 for a control packet. For a data packet,
+the @var{k} value indicates how much data follows the six byte header.
+The amount of data is
+@ifinfo
+2 ** (@var{k} + 4), where ** indicates exponentiation.
+@end ifinfo
+@iftex
+@tex
+$2^{k + 4}$.
+@end tex
+@end iftex
+Thus a @var{k} value of 1 means 32 data bytes and a
+@var{k} value of 8 means 4096 data bytes. The @var{k} value for a data
+packet must be between 1 and 8 inclusive.
+
+@item checksum low byte
+@itemx checksum high byte
+The checksum value is described below.
+
+@item control byte
+The control byte indicates the type of packet, and is described below.
+
+@item xor byte
+This byte is the xor of @var{k}, the checksum low byte, the checksum
+high byte and the control byte (i.e., the second, third, fourth and
+fifth header bytes). It is used to ensure that the header data is
+valid.
+@end table
+
+The control byte in the header is composed of three bit fields, referred
+to here as @var{tt} (two bits), @var{xxx} (three bits) and @var{yyy}
+(three bits). The control is @var{tt}@var{xxx}@var{yyy}, or @code{(@var{tt}
+<< 6) + (@var{xxx} << 3) + @var{yyy}}.
+
+The @var{TT} field takes on the following values:
+
+@table @samp
+@item 0
+This is a control packet. In this case the @var{k} byte in the
+header must be 9. The @var{xxx} field indicates the type of control
+packet; these types are described below.
+
+@item 1
+This is an alternate data channel packet. This is not used by UUCP.
+
+@item 2
+This is a data packet, and the entire contents of the attached data
+field (whose length is given by the @var{k} byte in the header) are
+valid. The @var{xxx} and @var{yyy} fields are described below.
+
+@item 3
+This is a short data packet. Let the length of the data field (as given
+by the @var{k} byte in the header) be @var{l}. Let the first byte in
+the data field be @var{b1}. If @var{b1} is less than 128 (if the most
+significant bit of @var{b1} is 0), then there are @code{@var{l} -
+@var{b1}} valid bytes of data in the data field, beginning with the
+second byte. If @code{@var{b1} >= 128}, let @var{b2} be the second byte
+in the data field. Then there are @code{@var{l} - ((@var{b1} & 0x7f) +
+(@var{b2} << 7))} valid bytes of data in the data field, beginning with
+the third byte. In all cases @var{l} bytes of data are sent (and all
+data bytes participate in the checksum calculation) but some of the
+trailing bytes may be dropped by the receiver. The @var{xxx} and
+@var{yyy} fields are described below.
+@end table
+
+In a data packet (short or not) the @var{xxx} field gives the sequence
+number of the packet. Thus sequence numbers can range from 0 to 7,
+inclusive. The @var{yyy} field gives the sequence number of the last
+correctly received packet.
+
+Each communication direction uses a window which indicates how many
+unacknowledged packets may be transmitted before waiting for an
+acknowledgement. The window may range from 1 to 7, and may be different
+in each direction. For example, if the window is 3 and the last packet
+acknowledged was packet number 6, packet numbers 7, 0 and 1 may be sent
+but the sender must wait for an acknowledgement before sending packet
+number 2. This acknowledgement could come as the @var{yyy} field of a
+data packet, or as the @var{yyy} field of a @samp{RJ} or @samp{RR}
+control packet (described below).
+
+Each packet must be transmitted in order (the sender may not skip
+sequence numbers). Each packet must be acknowledged, and each packet
+must be acknowledged in order.
+
+In a control packet, the @var{xxx} field takes on the following values:
+
+@table @asis
+@item 1 @samp{CLOSE}
+The connection should be closed immediately. This is typically sent
+when one side has seen too many errors and wants to give up. It is also
+sent when shutting down the protocol. If an unexpected @samp{CLOSE}
+packet is received, a @samp{CLOSE} packet should be sent in reply and
+the @samp{g} protocol should halt, causing UUCP to enter the final
+handshake.
+
+@item 2 @samp{RJ} or @samp{NAK}
+The last packet was not received correctly. The @var{yyy} field
+contains the sequence number of the last correctly received packet.
+
+@item 3 @samp{SRJ}
+Selective reject. The @var{yyy} field contains the sequence number of a
+packet that was not received correctly, and should be retransmitted.
+This is not used by UUCP, and most implementations will not recognize
+it.
+
+@item 4 @samp{RR} or @samp{ACK}
+Packet acknowledgement. The @var{yyy} field contains the sequence
+number of the last correctly received packet.
+
+@item 5 @samp{INITC}
+Third initialization packet. The @var{yyy} field contains the maximum
+window size to use.
+
+@item 6 @samp{INITB}
+Second initialization packet. The @var{yyy} field contains the
+packet size to use. It requests a size of
+@ifinfo
+2 ** (@var{yyy} + 5).
+@end ifinfo
+@iftex
+@tex
+$2^{yyy + 5}$.
+@end tex
+@end iftex
+Note that this is not the same coding used for the @var{k} byte in the
+packet header (it is 1 less). Most UUCP implementations that request a
+packet size larger than 64 bytes can handle any packet size up to that
+specified.
+
+@item 7 @samp{INITA}
+First initialization packet. The @var{yyy} field contains the maximum
+window size to use.
+@end table
+
+To compute the checksum, call the control byte (the fifth byte in the
+header) @var{c}.
+
+The checksum of a control packet is simply @code{0xaaaa - @var{c}}.
+
+The checksum of a data packet is @code{0xaaaa - (@var{check} ^
+@var{c})}, where @code{^} denotes exclusive or, and @var{check} is the
+result of the following routine as run on the contents of the data field
+(every byte in the data field participates in the checksum, even for a
+short data packet). Below is the routine used by an early version of
+Taylor UUCP; it is a slightly modified version of a routine which John
+Gilmore patched from G.L.@: Chesson's original paper. The @code{z}
+argument points to the data and the @code{c} argument indicates how much
+data there is.
+
+@example
+int
+igchecksum (z, c)
+ register const char *z;
+ register int c;
+@{
+ register unsigned int ichk1, ichk2;
+
+ ichk1 = 0xffff;
+ ichk2 = 0;
+
+ do
+ @{
+ register unsigned int b;
+
+ /* Rotate ichk1 left. */
+ if ((ichk1 & 0x8000) == 0)
+ ichk1 <<= 1;
+ else
+ @{
+ ichk1 <<= 1;
+ ++ichk1;
+ @}
+
+ /* Add the next character to ichk1. */
+ b = *z++ & 0xff;
+ ichk1 += b;
+
+ /* Add ichk1 xor the character position in the buffer counting from
+ the back to ichk2. */
+ ichk2 += ichk1 ^ c;
+
+ /* If the character was zero, or adding it to ichk1 caused an
+ overflow, xor ichk2 to ichk1. */
+ if (b == 0 || (ichk1 & 0xffff) < b)
+ ichk1 ^= ichk2;
+ @}
+ while (--c > 0);
+
+ return ichk1 & 0xffff;
+@}
+@end example
+
+When the @samp{g} protocol is started, the calling UUCP sends an
+@samp{INITA} control packet with the window size it wishes the called
+UUCP to use. The called UUCP responds with an @samp{INITA} packet with
+the window size it wishes the calling UUCP to use. Pairs of
+@samp{INITB} and @samp{INITC} packets are then similarly exchanged.
+When these exchanges are completed, the protocol is considered to have
+been started.
+
+Note that the window and packet sizes are not a negotiation. Each
+system announces the window and packet size which the other system
+should use. It is possible that different window and packet sizes will
+be used in each direction. The protocol works this way on the theory
+that each system knows how much data it can accept without getting
+overrun. Therefore, each system tells the other how much data to send
+before waiting for an acknowledgement.
+
+When a UUCP package transmits a command, it sends one or more data
+packets. All the data packets will normally be complete, although some
+UUCP packages may send the last one as a short packet. The command
+string is sent with a trailing null byte, to let the receiving package
+know when the command is finished. Some UUCP packages require the last
+byte of the last packet sent to be null, even if the command ends
+earlier in the packet. Some packages may require all the trailing bytes
+in the last packet to be null, but I have not confirmed this.
+
+When a UUCP package sends a file, it will send a sequence of data
+packets. The end of the file is signalled by a short data packet
+containing zero valid bytes (it will normally be preceeded by a short
+data packet containing the last few bytes in the file).
+
+Note that the sequence numbers cover the entire communication session,
+including both command and file data.
+
+When the protocol is shut down, each UUCP package sends a @samp{CLOSE}
+control packet.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{f} Protocol
+Subject: UUCP @samp{f} Protocol
+@end format
+@end ifset
+
+@node f Protocol, t Protocol, g Protocol, Protocols
+@section UUCP @samp{f} Protocol
+@cindex @samp{f} protocol
+@cindex protocol @samp{f}
+
+The @samp{f} protocol is a seven bit protocol which checksums an entire
+file at a time. It only uses the characters between @samp{\040} and
+@samp{\176} (ASCII @kbd{space} and @kbd{~}) inclusive, as well as the
+carriage return character. It can be very efficient for transferring
+text only data, but it is very inefficient at transferring eight bit
+data (such as compressed news). It is not flow controlled, and the
+checksum is fairly insecure over large files, so using it over a serial
+connection requires handshaking (XON/XOFF can be used) and error
+correcting modems. Some people think it should not be used even under
+those circumstances.
+
+I believe that the @samp{f} protocol originated in BSD versions of UUCP.
+It was originally intended for transmission over X.25 PAD links.
+
+The @samp{f} protocol has no startup or finish protocol. However, both
+sides typically sleep for a couple of seconds before starting up,
+because they switch the terminal into XON/XOFF mode and want to allow
+the changes to settle before beginning transmission.
+
+When a UUCP package transmits a command, it simply sends a string
+terminated by a carriage return.
+
+When a UUCP package transmits a file, each byte @var{b} of the file is
+translated according to the following table:
+
+@example
+ 0 <= @var{b} <= 037: 0172, @var{b} + 0100 (0100 to 0137)
+ 040 <= @var{b} <= 0171: @var{b} ( 040 to 0171)
+ 0172 <= @var{b} <= 0177: 0173, @var{b} - 0100 ( 072 to 077)
+ 0200 <= @var{b} <= 0237: 0174, @var{b} - 0100 (0100 to 0137)
+ 0240 <= @var{b} <= 0371: 0175, @var{b} - 0200 ( 040 to 0171)
+ 0372 <= @var{b} <= 0377: 0176, @var{b} - 0300 ( 072 to 077)
+@end example
+
+That is, a byte between @samp{\040} and @samp{\171} inclusive is
+transmitted as is, and all other bytes are prefixed and modified as
+shown.
+
+When all the file data is sent, a seven byte sequence is sent: two bytes
+of @samp{\176} followed by four ASCII bytes of the checksum as printed
+in base 16 followed by a carriage return. For example, if the checksum
+was 0x1234, this would be sent: @samp{\176\1761234\r}.
+
+The checksum is initialized to 0xffff. For each byte that is sent it is
+modified as follows (where @var{b} is the byte before it has been
+transformed as described above):
+
+@example
+ /* Rotate the checksum left. */
+ if ((ichk & 0x8000) == 0)
+ ichk <<= 1;
+ else
+ @{
+ ichk <<= 1;
+ ++ichk;
+ @}
+
+ /* Add the next byte into the checksum. */
+ ichk += @var{b};
+@end example
+
+When the receiving UUCP sees the checksum, it compares it against its
+own calculated checksum and replies with a single character followed
+by a carriage return.
+
+@table @samp
+@item G
+The file was received correctly.
+
+@item R
+The checksum did not match, and the file should be resent from the
+beginning.
+
+@item Q
+The checksum did not match, but too many retries have occurred and the
+communication session should be abandoned.
+@end table
+
+The sending UUCP checks the returned character and acts accordingly.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{t} Protocol
+Subject: UUCP @samp{t} Protocol
+@end format
+@end ifset
+
+@node t Protocol, e Protocol, f Protocol, Protocols
+@section UUCP @samp{t} Protocol
+@cindex @samp{t} protocol
+@cindex protocol @samp{t}
+
+The @samp{t} protocol is intended for use on links which provide
+reliable end-to-end connections, such as TCP. It does no error checking
+or flow control, and requires an eight bit clear channel.
+
+I believe the @samp{t} protocol originated in BSD versions of UUCP.
+
+When a UUCP package transmits a command, it first gets the length of the
+command string, @var{c}. It then sends @code{((@var{c} / 512) + 1) *
+512} bytes (the smallest multiple of 512 which can hold @var{c} bytes
+plus a null byte) consisting of the command string itself followed by
+trailing null bytes.
+
+When a UUCP package sends a file, it sends it in blocks. Each block
+contains at most 1024 bytes of data. Each block consists of four bytes
+containing the amount of data in binary (most significant byte first,
+the same format as used by the Unix function @code{htonl}) followed by
+that amount of data. The end of the file is signalled by a block
+containing zero bytes of data.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{e} Protocol
+Subject: UUCP @samp{e} Protocol
+@end format
+@end ifset
+
+@node e Protocol, Big G Protocol, t Protocol, Protocols
+@section UUCP @samp{e} Protocol
+@cindex @samp{e} protocol
+@cindex protocol @samp{e}
+
+The @samp{e} protocol is similar to the @samp{t} protocol. It does no
+flow control or error checking and is intended for use over networks
+providing reliable end-to-end connections, such as TCP.
+
+The @samp{e} protocol originated in versions of HDB UUCP.
+
+When a UUCP package transmits a command, it simply sends the command
+as an ASCII string terminated by a null byte.
+
+When a UUCP package transmits a file, it sends the complete size of the
+file as an ASCII decimal number. The ASCII string is padded out to 20
+bytes with null bytes (i.e. if the file is 1000 bytes long, it sends
+@samp{1000\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0}). It then sends the entire
+file.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{G} Protocol
+Subject: UUCP @samp{G} Protocol
+@end format
+@end ifset
+
+@node Big G Protocol, i Protocol, e Protocol, Protocols
+@section UUCP @samp{G} Protocol
+@cindex @samp{G} protocol
+@cindex protocol @samp{G}
+
+The @samp{G} protocol is used by SVR4 UUCP. It is identical to the
+@samp{g} protocol, except that it is possible to modify the window and
+packet sizes. The SVR4 implementation of the @samp{g} protocol
+reportedly is fixed at a packet size of 64 and a window size of 7.
+Supposedly SVR4 chose to implement a new protocol using a new letter to
+avoid any potential incompatibilities when using different packet or
+window sizes.
+
+Most implementations of the @samp{g} protocol that accept packets larger
+than 64 bytes will also accept packets smaller than whatever they
+requested in the @samp{INITB} packet. The SVR4 @samp{G} implementation
+is an exception; it will only accept packets of precisely the size it
+requests in the INITB packet.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{i} Protocol
+Subject: UUCP @samp{i} Protocol
+@end format
+@end ifset
+
+@node i Protocol, j Protocol, Big G Protocol, Protocols
+@section UUCP @samp{i} Protocol
+@cindex @samp{i} protocol
+@cindex protocol @samp{i}
+
+The @samp{i} protocol was written by Ian Lance Taylor (who also wrote
+this
+@ifclear faq
+manual).
+@end ifclear
+@ifset faq
+FAQ).
+@end ifset
+It was first used by Taylor UUCP version 1.04.
+
+It is a sliding window packet protocol, like the @samp{g} protocol, but
+it supports bidirectional transfers (i.e., file transfers in both
+directions simultaneously). It requires an eight bit clear connection.
+Several ideas for the protocol were taken from the paper @cite{A
+High-Throughput Message Transport System} by P.@: Lauder. I don't know
+where the paper was published, but the author's e-mail address is
+@code{piers@@cs.su.oz.au}. The @samp{i} protocol does not adopt his
+main idea, which is to dispense with windows entirely. This is because
+some links still do require flow control and, more importantly, because
+using windows sets a limit to the amount of data which the protocol must
+be able to resend upon request. To reduce the costs of window
+acknowledgements, the protocol uses a large window and only requires an
+ack at the halfway point.
+
+Each packet starts with a six byte header, optionally followed by data
+bytes with a four byte checksum. There are currently five defined
+packet types (@samp{DATA}, @samp{SYNC}, @samp{ACK}, @samp{NAK},
+@samp{SPOS}, @samp{CLOSE}) which are described below. Although any
+packet type may include data, any data provided with an @samp{ACK},
+@samp{NAK} or @samp{CLOSE} packet is ignored.
+
+Every @samp{DATA}, @samp{SPOS} and @samp{CLOSE} packet has a sequence
+number. The sequence numbers are independent for each side. The first
+packet sent by each side is always number 1. Each packet is numbered
+one greater than the previous packet, modulo 32.
+
+Every packet has a local channel number and a remote channel number.
+For all packets at least one channel number is zero. When a UUCP
+command is sent to the remote system, it is assigned a non-zero local
+channel number. All packets associated with that UUCP command sent by
+the local system are given the selected local channel number. All
+associated packets sent by the remote system are given the selected
+number as the remote channel number. This permits each UUCP command
+to be uniquely identified by the channel number on the originating
+system, and therefore each UUCP package can associate all file data
+and UUCP command responses with the appropriate command. This is a
+requirement for bidirectional UUCP transfers.
+
+The protocol maintains a single global file position, which starts at 0.
+For each incoming packet, any associated data is considered to occur at
+the current file position, and the file position is incremented by the
+amount of data contained. The exception is a packet of type
+@samp{SPOS}, which is used to change the file position. The reason for
+keeping track of the file position is described below.
+
+The header is as follows:
+
+@table @asis
+@item @samp{\007}
+Every packet begins with @kbd{^G}.
+
+@item @code{(@var{packet} << 3) + @var{locchan}}
+The five bit packet number combined with the three bit local channel
+number. @samp{DATA}, @samp{SPOS} and @samp{CLOSE} packets use the
+packet sequence number for the @var{packet} field. @samp{NAK} packet
+types use the @var{packet} field for the sequence number to be resent.
+@samp{ACK} and @samp{SYNC} do not use the @var{packet} field, and
+generally leave it set to 0. Packets which are not associated with a
+UUCP command from the local system use a local channel number of 0.
+
+@item @code{(@var{ack} << 3) + @var{remchan}}
+The five bit packet acknowledgement combined with the three bit remote
+channel number. The packet acknowledgement is the number of the last
+packet successfully received; it is used by all packet types. Packets
+which are not sent in response to a UUCP command from the remote system
+use a remote channel number of 0.
+
+@item @code{(@var{type} << 5) + (@var{caller} << 4) + @var{len1}}
+The three bit packet type combined with the one bit packet direction
+combined with the upper four bits of the data length. The packet
+direction bit is always 1 for packets sent by the calling UUCP, and 0
+for packets sent by the called UUCP. This prevents confusion caused by
+echoed packets.
+
+@item @var{len2}
+The lower eight bits of the data length. The twelve bits of data length
+permit packets ranging in size from 0 to 4095 bytes.
+
+@item @var{check}
+The exclusive or of the second through fifth bytes of the header. This
+provides an additional check that the header is valid.
+@end table
+
+If the data length is non-zero, the packet is immediately followed by
+the specified number of data bytes. The data bytes are followed by a
+four byte CRC 32 checksum, with the most significant byte first. The
+CRC is calculated over the contents of the data field.
+
+The defined packet types are as follows:
+
+@table @asis
+@item 0 @samp{DATA}
+This is a plain data packet.
+
+@item 1 @samp{SYNC}
+@samp{SYNC} packets are exchanged when the protocol is initialized, and
+are described further below. @samp{SYNC} packets do not carry sequence
+numbers (that is, the @var{packet} field is ignored).
+
+@item 2 @samp{ACK}
+This is an acknowledgement packet. Since @samp{DATA} packets also carry
+packet acknowledgements, @samp{ACK} packets are only used when one side
+has no data to send. @samp{ACK} packets do not carry sequence numbers.
+
+@item 3 @samp{NAK}
+This is a negative acknowledgement. This is sent when a packet is
+received incorrectly, and means that the packet number appearing in the
+@var{packet} field must be resent. @samp{NAK} packets do not carry
+sequence numbers (the @var{packet} field is already used).
+
+@item 4 @samp{SPOS}
+This packet changes the file position. The packet contains four bytes
+of data holding the file position, most significant byte first. The
+next packet received will be considered to be at the named file
+position.
+
+@item 5 @samp{CLOSE}
+When the protocol is shut down, each side sends a @samp{CLOSE} packet.
+This packet does have a sequence number, which could be used to ensure
+that all packets were correctly received (this is not needed by UUCP,
+however, which uses the higher level @samp{H} command with an @samp{HY}
+response).
+@end table
+
+When the protocol starts up, both systems send a @samp{SYNC} packet.
+The @samp{SYNC} packet includes at least three bytes of data. The first
+two bytes are the maximum packet size the remote system should send,
+most significant byte first. The third byte is the window size the
+remote system should use. The remote system may send packets of any
+size up to the maximum. If there is a fourth byte, it is the number of
+channels the remote system may use (this must be between 1 and 7,
+inclusive). Additional data bytes may be defined in the future.
+
+The window size is the number of packets that may be sent before a
+packet is acknowledged. There is no requirement that every packet be
+acknowledged; any acknowledgement is considered to acknowledge all
+packets through the number given. In the current implementation, if one
+side has no data to send, it sends an @samp{ACK} when half the window is
+received.
+
+Note that the @samp{NAK} packet corresponds to the unused @samp{g}
+protocol @samp{SRJ} packet type, rather than to the @samp{RJ} packet
+type. When a @samp{NAK} is received, only the named packet should be
+resent, not any subsequent packets.
+
+Note that if both sides have data to send, but a packet is lost, it is
+perfectly reasonable for one side to continue sending packets, all of
+which will acknowledge the last packet correctly received, while the
+system whose packet was lost will be unable to send a new packet because
+the send window will be full. In this circumstance, neither side will
+time out and one side of the communication will be effectively shut down
+for a while. Therefore, any system with outstanding unacknowledged
+packets should arrange to time out and resend a packet even if data is
+being received.
+
+Commands are sent as a sequence of data packets with a non-zero local
+channel number. The last data packet for a command includes a trailing
+null byte (normally a command will fit in a single data packet). Files
+are sent as a sequence of data packets ending with one of length zero.
+
+The channel numbers permit a more efficient implementation of the UUCP
+file send command. Rather than send the command and then wait for the
+@samp{SY} response before sending the file, the file data is sent
+beginning immediately after the @samp{S} command is sent. If an
+@samp{SN} response is received, the file send is aborted, and a final
+data packet of length zero is sent to indicate that the channel number
+may be reused. If an @samp{SY} reponse with a file position indicator
+is received, the file send adjusts to the file position; this is why the
+protocol maintains a global file position.
+
+Note that the use of channel numbers means that each UUCP system may
+send commands and file data simultaneously. Moreover, each UUCP system
+may send multiple files at the same time, using the channel number to
+disambiguate the data. Sending a file before receiving an
+acknowledgement for the previous file helps to eliminate the round trip
+delays inherent in other UUCP protocols.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{j} Protocol
+Subject: UUCP @samp{j} Protocol
+@end format
+@end ifset
+
+@node j Protocol, x Protocol, i Protocol, Protocols
+@section UUCP @samp{j} Protocol
+@cindex @samp{j} protocol
+@cindex protocol @samp{j}
+
+The @samp{j} protocol is a variant of the @samp{i} protocol. It was
+also written by Ian Lance Taylor, and first appeared in Taylor UUCP
+version 1.04.
+
+The @samp{j} protocol is a version of the @samp{i} protocol designed for
+communication links which intercept a few characters, such as XON or
+XOFF. It is not efficient to use it on a link which intercepts many
+characters, such as a seven bit link. The @samp{j} protocol performs no
+error correction or detection; that is presumed to be the responsibility
+of the @samp{i} protocol.
+
+When the @samp{j} protocol starts up, each system sends a printable
+ASCII string indicating which characters it wants to avoid using. The
+string begins with the ASCII character @kbd{^} (octal 136) and ends with
+the ASCII character @kbd{~} (octal 176). After sending this string,
+each system looks for the corresponding string from the remote system.
+The strings are composed of escape sequences: @samp{\ooo}, where
+@samp{o} is an octal digit. For example, sending the string
+@samp{^\021\023~} means that the ASCII XON and XOFF characters should be
+avoided. The union of the characters described in both strings (the
+string which is sent and the string which is received) is the set of
+characters which must be avoided in this conversation. Avoiding a
+printable ASCII character (octal 040 to octal 176, inclusive) is not
+permitted.
+
+After the exchange of characters to avoid, the normal @samp{i} protocol
+start up is done, and the rest of the conversation uses the normal
+@samp{i} protocol. However, each @samp{i} protocol packet is wrapped to
+become a @samp{j} protocol packet.
+
+Each @samp{j} protocol packet consists of a seven byte header, followed
+by data bytes, followed by index bytes, followed by a one byte trailer.
+The packet header looks like this:
+
+@table @asis
+@item @kbd{^}
+Every packet begins with the ASCII character @kbd{^}, octal 136.
+
+@item @var{high}
+@itemx @var{low}
+These two characters give the total number of bytes in the packet. Both
+@var{high} and @var{low} are printable ASCII characters. The length of
+the packet is @code{(@var{high} - 040) * 0100 + (@var{low} - 040)},
+where @code{040 <= @var{high} < 0177} and @code{040 <= @var{low} <
+0140}. This permits a length of 6079 bytes, but there is a further
+restriction on packet size described below.
+
+@item @kbd{=}
+The ASCII character @kbd{=}, octal 075.
+
+@item @var{data-high}
+@itemx @var{data-low}
+These two characters give the total number of data bytes in the packet.
+The encoding is as described for @var{high} and @var{low}. The number
+of data bytes is the size of the @samp{i} protocol packet wrapped inside
+this @samp{j} protocol packet.
+
+@item @kbd{@@}
+The ASCII character @kbd{@@}, octal 100.
+@end table
+
+The header is followed by the number of data bytes given in
+@var{data-high} and @var{data-low}. These data bytes are the @samp{i}
+protocol packet which is being wrapped in the @samp{j} protocol packet.
+However, each character in the @samp{i} protocol packet which the
+@samp{j} protocol must avoid is transformed into a printable ASCII
+character (recall that avoiding a printable ASCII character is not
+permitted). Two index bytes are used for each character which must be
+transformed.
+
+The index bytes immediately follow the data bytes. The index bytes are
+created in pairs. Each pair of index bytes encodes the location of a
+character in the @samp{i} protocol packet which was transformed to
+become a printable ASCII character. Each pair of index bytes also
+encodes the precise transformation which was performed.
+
+When the sender finds a character which must be avoided, it will
+transform it using one or two operations. If the character is 0200 or
+greater, it will subtract 0200. If the resulting character is less than
+020, or is equal to 0177, it will xor by 020. The result is a printable
+ASCII character.
+
+The zero based byte index of the character within the @samp{i} protocol
+packet is determined. This index is turned into a two byte printable
+ASCII index, @var{index-high} and @var{index-low}, such that the index
+is @code{(@var{index-high} - 040) * 040 + (@var{index-low} - 040)}.
+@var{index-low} is restricted such that @code{040 <= @var{index-low} <
+0100}. @var{index-high} is not permitted to be 0176, so @code{040 <=
+@var{index-high} < 0176}. @var{index-low} is then modified to encode
+the transformation:
+
+@itemize @bullet
+@item If the character transformation only had to subtract 0200, then
+@var{index-low} is used as is.
+
+@item If the character transformation only had to xor by 020, then 040
+is added to @var{index-low}.
+
+@item If both operations had to be performed, then 0100 is added to
+@var{index-low}. However, if the value of @var{index-low} was initially
+077, then adding 0100 would result in 0177, which is not a printable
+ASCII character. For that special case, @var{index-high} is set to
+0176, and @var{index-low} is set to the original value of
+@var{index-high}.
+@end itemize
+
+The receiver decodes the index bytes as follows (this is the reverse of
+the operations performed by the sender, presented here for additional
+clarity):
+
+@itemize @bullet
+@item The first byte in the index is @var{index-high}, and the second is
+@var{index-low}.
+
+@item If @code{040 <= @var{index-high} < 0176}, the index refers to the
+data byte at position @code{(@var{index-high} - 040) * 040 +
+@var{index-low} % 040}.
+
+@item If @code{040 <= @var{index-low} < 0100}, then 0200 must be added
+to indexed byte.
+
+@item If @code{0100 <= @var{index-low} < 0140}, then 020 must be xor'ed
+to the indexed byte.
+
+@item If @code{0140 <= @var{index-low} < 0177}, then 0200 must be added
+to the indexed byte, and 020 must be xor'ed to the indexed byte.
+
+@item If @code{@var{index-high} == 0176}, the index refers to the data
+byte at position @code{(@var{index-low} - 040) * 040 + 037}. 0200 must
+be added to the indexed byte, and 020 must be xor'ed to the indexed
+byte.
+@end itemize
+
+This means the largest @samp{i} protocol packet which may be wrapped
+inside a @samp{j} protocol packet is @code{(0175 - 040) * 040 + (077 -
+040) == 3007} bytes.
+
+The final character in a @samp{j} protocol packet, following the index
+bytes, is the ASCII character @kbd{~} (octal 176).
+
+The motivation behind using an indexing scheme, rather than escape
+characters, is to avoid data movement. The sender may simply add a
+header and a trailer to the @samp{i} protocol packet. Once the receiver
+has loaded the @samp{j} protocol packet, it may scan the index bytes,
+transforming the data bytes, and then pass the data bytes directly on to
+the @samp{i} protocol routine.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{x} Protocol
+Subject: UUCP @samp{x} Protocol
+@end format
+@end ifset
+
+@node x Protocol, y Protocol, j Protocol, Protocols
+@section UUCP @samp{x} Protocol
+@cindex @samp{x} protocol
+@cindex protocol @samp{x}
+
+The @samp{x} protocol is used in Europe (and probably elsewhere) with
+machines that contain an builtin X.25 card and can send eight bit data
+transparently across X.25 circuits, without interference from the X.28
+or X.29 layers. The protocol sends packets of 512 bytes, and relies on
+a write of zero bytes being read as zero bytes without stopping
+communication. It first appeared in the original System V UUCP
+implementation.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{y} Protocol
+Subject: UUCP @samp{y} Protocol
+@end format
+@end ifset
+
+@node y Protocol, d Protocol, x Protocol, Protocols
+@section UUCP @samp{y} Protocol
+@cindex @samp{y} protocol
+@cindex protocol @samp{y}
+
+The @samp{y} protocol was developed by Jorge Cwik for use in FX UUCICO,
+a PC uucico program. It is designed for communication lines which
+handle error correction and flow control. It requires an eight bit
+clean connection. It performs error detection, but not error
+correction: when an error is detected, the line is dropped. It is a
+streaming protocol, like the @samp{f} protocol; there are no packet
+acknowledgements, so the protocol is efficient over a half-duplex
+communication line such as PEP.
+
+Every packet contains a six byte header:
+
+@table @asis
+@item sequence low byte
+@itemx sequence high byte
+A two byte sequence number, in little endian order. The first sequence
+number is 0. Since the first packet is always a sync packet (described
+below) the sequence number of the first data packet is always 1. Each
+system counts sequence numbers independently.
+
+@item length low byte
+@itemx length high byte
+A two byte data length, in little endian order. If the high bit of the
+sixteen bit field is clear, this is the number of data bytes which
+follow the six byte header. If the high bit is set, there is no data,
+and the length field is a type of control packet.
+
+@item checksum low byte
+@itemx checksum high byte
+A two byte checksum, in little endian order. The checksum is computed
+over the data bytes. The checksum algorithm is described below. If
+there are no data bytes, the checksum is sent as 0.
+@end table
+
+When the protocol starts up, each side must send a sync packet. This is
+a packet with a normal six byte header followed by data. The sequence
+number of the sync packet should be 0. Currently at least four bytes of
+data must be sent with the sync packet. Additional bytes should be
+ignored. They are defined as follows:
+
+@table @asis
+@item version
+The version number of the protocol. Currently this must be 1. Larger
+numbers should be ignored; it is the responsibility of the newer version
+to accommodate the older one.
+
+@item packet size
+The maximum data length to use divided by 256. This is sent as a single
+byte. The maximum data length permitted is 32768, which would be sent
+as 128. Customarily both systems will use the same maximum data length,
+the lower of the two requested.
+
+@item flags low byte
+@itemx flags high byte
+Two bytes of flags. None are currently defined. These bytes should be
+sent as 0, and ignored by the receiver.
+@end table
+
+A length field with the high bit set is a control packet. The
+following control packet types are defined:
+
+@table @asis
+@item 0xfffe @samp{YPKT_ACK}
+Acknowledges correct receipt of a file.
+
+@item 0xfffd @samp{YPKT_ERR}
+Indicates an incorrect checksum.
+
+@item 0xfffc @samp{YPKT_BAD}
+Indicates a bad sequence number, an invalid length, or some other error.
+@end table
+
+If a control packet other than @samp{YPKT_ACK} is received, the
+connection is dropped. If a checksum error is detected for a received
+packet, a @samp{YPKT_ERR} control packet is sent, and the connection is
+dropped. If a packet is received out of sequence, a @samp{YPKT_BAD}
+control packet is sent, and the connection is dropped.
+
+The checksum is initialized to 0xffff. For each data byte in a packet
+it is modified as follows (where @var{b} is the byte before it has been
+transformed as described above):
+
+@example
+ /* Rotate the checksum left. */
+ if ((ichk & 0x8000) == 0)
+ ichk <<= 1;
+ else
+ @{
+ ichk <<= 1;
+ ++ichk;
+ @}
+
+ /* Add the next byte into the checksum. */
+ ichk += @var{b};
+@end example
+
+This is the same algorithm as that used by the @samp{f} protocol.
+
+A command is sent as a sequence of data packets followed by a null byte.
+In the normal case, a command will fit into a single packet. The packet
+should be exactly the length of the command plus a null byte. If the
+command is too long, more packets are sent as required.
+
+A file is sent as a sequence of data packets, ending with a zero length
+packet. The data packets may be of any length greater than zero and
+less than or equal to the maximum permitted packet size specified in the
+initial sync packet.
+
+After the zero length packet ending a file transfer has been received,
+the receiving system sends a @samp{YPKT_ACK} control packet. The
+sending system waits for the @samp{YPKT_ACK} control packet before
+continuing; this wait should be done with a large timeout, since there
+may be a considerable amount of data buffered on the communication path.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{d} Protocol
+Subject: UUCP @samp{d} Protocol
+@end format
+@end ifset
+
+@node d Protocol, h Protocol, y Protocol, Protocols
+@section UUCP @samp{d} Protocol
+@cindex @samp{d} protocol
+@cindex protocol @samp{d}
+
+The @samp{d} protocol is apparently used for DataKit muxhost (not
+RS-232) connections. No file size is sent. When a file has been
+completely transferred, a write of zero bytes is done; this must be read
+as zero bytes on the other end.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{h} Protocol
+Subject: UUCP @samp{h} Protocol
+@end format
+@end ifset
+
+@node h Protocol, v Protocol, d Protocol, Protocols
+@section UUCP @samp{h} Protocol
+@cindex @samp{h} protocol
+@cindex protocol @samp{h}
+
+The @samp{h} protocol is apparently used in some places with HST modems.
+It does no error checking, and is not that different from the @samp{t}
+protocol. I don't know the details.
+
+@ifset faq
+@format
+------------------------------
+
+From: UUCP @samp{v} Protocol
+Subject: UUCP @samp{v} Protocol
+@end format
+@end ifset
+
+@node v Protocol, , h Protocol, Protocols
+@section UUCP @samp{v} Protocol
+@cindex @samp{v} protocol
+@cindex protocol @samp{v}
+
+The @samp{v} protocol is used by UUPC/extended, a PC UUCP program. It
+is simply a version of the @samp{g} protocol which supports packets of
+any size, and also supports sending packets of different sizes during
+the same conversation. There are many @samp{g} protocol implementations
+which support both, but there are also many which do not. Using
+@samp{v} ensures that everything is supported.
+
+@ifset faq
+@format
+------------------------------
+
+From: Thanks
+Subject: Thanks
+@end format
+
+Besides the papers and information acknowledged at the top of this
+article, the following people have contributed help, advice,
+suggestions and information:
+@format
+ Earle Ake 513-429-6500 <ake@@Dayton.SAIC.COM>
+ chris@@uuplus.com (Christopher J. Ambler)
+ jhc@@iscp.bellcore.com (Jonathan Clark)
+ jorge@@laser.satlink.net (Jorge Cwik)
+ celit!billd@@UCSD.EDU (Bill Davidson)
+ "Drew Derbyshire" <ahd@@kew.com>
+ erik@@pdnfido.fidonet.org
+ Matthew Farwell <dylan@@ibmpcug.co.uk>
+ dgilbert@@gamiga.guelphnet.dweomer.org (David Gilbert)
+ kherron@@ms.uky.edu (Kenneth Herron)
+ Mike Ipatow <mip@@fido.itc.e-burg.su>
+ Romain Kang <romain@@pyramid.com>
+ "Jonathan I. Kamens" <jik@@GZA.COM>
+ "David J. MacKenzie" <djm@@eng.umd.edu>
+ jum@@helios.de (Jens-Uwe Mager)
+ peter@@xpoint.ruessel.sub.org (Peter Mandrella)
+ david nugent <david@@csource.oz.au>
+ Stephen.Page@@prg.oxford.ac.uk
+ joey@@tessi.UUCP (Joey Pruett)
+ James Revell <revell@@uunet.uu.net>
+ Larry Rosenman <ler@@lerami.lerctr.org>
+ Rich Salz <rsalz@@bbn.com>
+ evesg@@etlrips.etl.go.jp (Gjoen Stein)
+ kls@@ditka.Chicago.COM (Karl Swartz)
+ Dima Volodin <dvv@@hq.demos.su>
+ John.Woods@@proteon.com (John Woods)
+ jon@@console.ais.org (Jon Zeeff)
+ Eric Ziegast <ziegast@@uunet.uu.net>
+
+------------------------------
+
+End of UUCP Internals Frequently Asked Questions
+******************************
+@end format
+@end ifset
+@c END-OF-FAQ
@node Hacking, Acknowledgements, Protocols, Top
@chapter Hacking Taylor UUCP
@@ -3627,8 +7927,8 @@ code itself.
The code is carefully segregated into a system independent portion and a
system dependent portion. The system dependent code is in the
-@file{unix} subdirectory, and also in the files @file{tcp.c},
-@file{tli.c} and @file{sysh.unx} (also known as @file{sysdep.h}).
+@file{unix} subdirectory, and also in the file @file{sysh.unx} (also
+known as @file{sysdep.h}).
With the right configuration parameters, the system independent code
calls only ANSI C functions. Some of the less common ANSI C functions
@@ -3646,9 +7946,9 @@ dependent code. I think that this code can conform to POSIX 1003.1,
given the right compilation parameters. I'm a bit less certain about
this, though.
-The code is in use on a 16 bit segmented system with no function
-prototypes, so I'm certain that all casts to long and pointers are done
-when necessary.
+The code has been used on a 16 bit segmented system with no function
+prototypes, so I'm fairly certain that all casts to long and pointers
+are done when necessary.
@node Naming Conventions, Patches, System Dependence, Hacking
@section Naming Conventions
@@ -3701,10 +8001,10 @@ string). If this array were passed to a function, the function
parameter would be named @code{paz} (pointer to array of string).
Note that the variable name prefixes do not necessarily indicate the
-type of the variable. For example, a variable prefixed with i may be
-int, long or short. Similarly, a variable prefixed with b may be a char
-or an int; for example, the return value of getchar would be caught in
-an int variable prefixed with b.
+type of the variable. For example, a variable prefixed with @kbd{i} may
+be int, long or short. Similarly, a variable prefixed with @kbd{b} may
+be a char or an int; for example, the return value of @code{getchar}
+would be caught in an int variable prefixed with @kbd{b}.
For a non-local variable (extern or file static), the first character
after the type prefix is capitalized.
@@ -3766,43 +8066,31 @@ comments were criticisms. I've probably left some people off, and I
apologize for any oversight; it does not mean your contribution was
unappreciated.
-@ifinfo
First of all, I would like to thank the people at Infinity Development
-Systems (formerly AIRS, which lives on in the domain name, at least for
-now) for permitting me to use their computers and @file{uunet} access.
-I would also like to thank Richard Stallman @code{<rms@@gnu.ai.mit.edu>}
-for founding the Free Software Foundation and John Gilmore
+Systems (formerly AIRS, which lives on in the domain name) for
+permitting me to use their computers and @file{uunet} access. I would
+also like to thank Richard Stallman @code{<rms@@gnu.ai.mit.edu>} for
+founding the Free Software Foundation, and John Gilmore
@code{<gnu@@cygnus.com>} for writing the initial version of gnuucp which
was a direct inspiration for this somewhat larger project. Chip
Salzenberg @code{<chip@@tct.com>} has contributed many patches.
-Franc,ois Pinard @code{<pinard@@iro.umontreal.ca>} tirelessly tested the
-code and suggested many improvements. He also put together the initial
-version of this document. Doug Evans contributed the zmodem protocol.
-Marc Boucher @code{<marc@@CAM.ORG>} contributed the code supporting the
-pipe port type. Finally, Verbus M. Counts @code{<verbus@@westmark.com>}
-and Centel Federal Systems, Inc. deserve special thanks, since they
-actually paid me money to port this code to System III.
+@ifinfo
+Franc,ois
@end ifinfo
@iftex
-First of all, I would like to thank the people at Infinity Development
-Systems (formerly AIRS, which lives on in the domain name, at least for
-now) for permitting me to use their computers and @file{uunet} access.
-I would also like to thank Richard Stallman @code{<rms@@gnu.ai.mit.edu>}
-for founding the Free Software Foundation and John Gilmore
-@code{<gnu@@cygnus.com>} for writing the initial version of gnuucp which
-was a direct inspiration for this somewhat larger project. Chip
-Salzenberg @code{<chip@@tct.com>} has contributed many patches.
@tex
-Fran\c cois Pinard
+Fran\c cois
@end tex
-@code{<pinard@@iro.umontreal.ca>} tirelessly tested the code and
+@end iftex
+Pinard @code{<pinard@@iro.umontreal.ca>} tirelessly tested the code and
suggested many improvements. He also put together the initial version
-of this document. Doug Evans contributed the zmodem protocol. Marc
+of this manual. Doug Evans contributed the zmodem protocol. Marc
Boucher @code{<marc@@CAM.ORG>} contributed the code supporting the pipe
-port type. Finally, Verbus M. Counts @code{<verbus@@westmark.com>} and
-Centel Federal Systems, Inc. deserve special thanks, since they actually
-paid me money to port this code to System III.
-@end iftex
+port type. Jorge Cwik @code{jorge@@laser.satlink.net} contributed the
+@samp{y} protocol code. Finally, Verbus M. Counts
+@code{<verbus@@westmark.com>} and Centel Federal Systems, Inc., deserve
+special thanks, since they actually paid me money to port this code to
+System III.
In alphabetical order:
@@ -3813,6 +8101,7 @@ In alphabetical order:
Brian W. Antoine @code{<briana@@tau-ceti.isc-br.com>}
@code{jantypas@@soft21.s21.com} (John Antypas)
@code{james@@bigtex.cactus.org} (James Van Artsdalen)
+@code{jima@@netcom.com} (Jim Avera)
@code{nba@@sysware.DK} (Niels Baggesen)
@code{uunet!hotmomma!sdb} (Scott Ballantyne)
Zacharias Beckman @code{<zac@@dolphin.com>}
@@ -3823,6 +8112,7 @@ Zacharias Beckman @code{<zac@@dolphin.com>}
@code{spider@@Orb.Nashua.NH.US} (Spider Boardman)
Gregory Bond @code{<gnb@@bby.com.au>}
Marc Boucher @code{<marc@@CAM.ORG>}
+Ard van Breemen @code{<ard@@cstmel.hobby.nl>}
@code{dean@@coplex.com} (Dean Brooks)
@code{jbrow@@radical.com} (Jim Brownfield)
@code{dave@@dlb.com} (Dave Buck)
@@ -3831,32 +8121,41 @@ Marc Boucher @code{<marc@@CAM.ORG>}
@code{mib@@gnu.ai.mit.edu} (Michael I Bushnell)
Brian Campbell @code{<brianc@@quantum.on.ca>}
Andrew A. Chernov @code{<ache@@astral.msk.su>}
+@code{jhc@@iscp.bellcore.com} (Jonathan Clark)
@code{mafc!frank@@bach.helios.de} (Frank Conrad)
Ed Carp @code{<erc@@apple.com>}
@code{mpc@@mbs.linet.org} (Mark Clements)
@code{verbus@@westmark.westmark.com} (Verbus M. Counts)
@code{cbmvax!snark.thyrsus.com!cowan} (John Cowan)
Bob Cunningham @code{<bob@@soest.hawaii.edu>}
+@code{jorge@@laser.satlink.net} (Jorge Cwik)
@code{kdburg@@incoahe.hanse.de} (Klaus Dahlenburg)
Damon @code{<d@@exnet.co.uk>}
+@code{celit!billd@@UCSD.EDU} (Bill Davidson)
@code{hubert@@arakis.fdn.org} (Hubert Delahaye)
@code{markd@@bushwire.apana.org.au} (Mark Delany)
Allen Delaney @code{<allen@@brc.ubc.ca>}
+Gerriet M. Denkmann @code{gerriet@@hazel.north.de}
@code{denny@@dakota.alisa.com} (Bob Denny)
+Drew Derbyshire @code{<ahd@@kew.com>}
@code{ssd@@nevets.oau.org} (Steven S. Dick)
@code{gert@@greenie.gold.sub.org} (Gert Doering)
@code{gemini@@geminix.in-berlin.de} (Uwe Doering)
Hans-Dieter Doll @code{<hd2@@Insel.DE>}
+@code{deane@@deane.teleride.on.ca} (Dean Edmonds)
Mark W. Eichin @code{<eichin@@cygnus.com>}
+@code{erik@@pdnfido.fidonet.org}
Andrew Evans @code{<andrew@@airs.com>}
@code{dje@@cygnus.com} (Doug Evans)
Marc Evans @code{<marc@@synergytics.com>}
Dan Everhart @code{<dan@@dyndata.com>}
@code{kksys!kegworks!lfahnoe@@cs.umn.edu} (Larry Fahnoe)
+Matthew Farwell @code{<dylan@@ibmpcug.co.uk>}
@code{fenner@@jazz.psu.edu} (Bill Fenner)
@code{jaf@@inference.com} (Jose A. Fernandez)
"David J. Fiander" @code{<golem!david@@news.lsuc.on.ca>}
Thomas Fischer @code{<batman@@olorin.dark.sub.org>}
+Mister Flash @code{<flash@@sam.imash.ras.ru>}
@code{louis@@marco.de} (Ju"rgen Fluk)
@code{erik@@eab.retix.com} (Erik Forsberg)
@code{andy@@scp.caltech.edu} (Andy Fyfe)
@@ -3864,6 +8163,7 @@ Lele Gaifax @code{<piggy@@idea.sublink.org>}
@code{Peter.Galbavy@@micromuse.co.uk}
@code{hunter@@phoenix.pub.uu.oz.au} (James Gardiner [hunter])
Terry Gardner @code{<cphpcom!tjg01>}
+@code{dgilbert@@gamiga.guelphnet.dweomer.org} (David Gilbert)
@code{ol@@infopro.spb.su} (Oleg Girko)
@code{jimmy@@tokyo07.info.com} (Jim Gottlieb)
Benoit Grange @code{<ben@@fizz.fdn.org>}
@@ -3871,33 +8171,44 @@ Benoit Grange @code{<ben@@fizz.fdn.org>}
@code{ryan@@cs.umb.edu} (Daniel R. Guilderson)
@code{greg@@gagme.chi.il.us} (Gregory Gulik)
Richard H. Gumpertz @code{<rhg@@cps.com>}
+Scott Guthridge @code{<scooter@@cube.rain.com>}
Michael Haberler @code{<mah@@parrot.prv.univie.ac.at>}
Daniel Hagerty @code{<hag@@eddie.mit.edu>}
@code{jh@@moon.nbn.com} (John Harkin)
@code{guy@@auspex.auspex.com} (Guy Harris)
+@code{hsw1@@papa.attmail.com} (Stephen Harris)
Petri Helenius @code{<pete@@fidata.fi>}
@code{gabe@@edi.com} (B. Gabriel Helou)
Bob Hemedinger @code{<bob@@dalek.mwc.com>}
Andrew Herbert @code{<andrew@@werple.pub.uu.oz.au>}
+@code{kherron@@ms.uky.edu} (Kenneth Herron)
Peter Honeyman @code{<honey@@citi.umich.edu>}
@code{jhood@@smoke.marlboro.vt.us} (John Hood)
+Mike Ipatow @code{<mip@@fido.itc.e-burg.su>}
Bill Irwin @code{<bill@@twg.bc.ca>}
@code{pmcgw!personal-media.co.jp!ishikawa} (Chiaki Ishikawa)
+@code{ai@@easy.in-chemnitz.de} (Andreas Israel)
+@code{iverson@@lionheart.com} (Tim Iverson)
@code{bei@@dogface.austin.tx.us} (Bob Izenberg)
@code{djamiga!djjames@@fsd.com} (D.J.James)
Rob Janssen @code{<cmgit!rob@@relay.nluug.nl>}
@code{harvee!esj} (Eric S Johansson)
Kevin Johnson @code{<kjj@@pondscum.phx.mcd.mot.com>}
+@code{rj@@rainbow.in-berlin.de} (Robert Joop)
Alan Judge @code{<aj@@dec4ie.IEunet.ie>}
@code{chris@@cj_net.in-berlin.de} (Christof Junge)
+Romain Kang @code{<romain@@pyramid.com>}
@code{tron@@Veritas.COM} (Ronald S. Karr)
Brendan Kehoe @code{<brendan@@cs.widener.edu>}
@code{warlock@@csuchico.edu} (John Kennedy)
@code{kersing@@nlmug.nl.mugnet.org} (Jac Kersing)
+@code{ok@@daveg.PFM-Mainz.de} (Olaf Kirch)
Gabor Kiss @code{<kissg@@sztaki.hu>}
@code{gero@@gkminix.han.de} (Gero Kuhlmann)
@code{rob@@pact.nl} (Rob Kurver)
+"C.A. Lademann" @code{<cal@@zls.gtn.com>}
@code{kent@@sparky.IMD.Sterling.COM} (Kent Landfield)
+Tin Le @code{<tin@@saigon.com>}
@code{lebaron@@inrs-telecom.uquebec.ca} (Gregory LeBaron)
@code{karl@@sugar.NeoSoft.Com} (Karl Lehenbauer)
@code{alex@@hal.rhein-main.de} (Alexander Lehmann)
@@ -3906,12 +8217,14 @@ Gabor Kiss @code{<kissg@@sztaki.hu>}
@code{gdonl@@ssi1.com} (Don Lewis)
@code{libove@@libove.det.dec.com} (Jay Vassos-Libove)
@code{bruce%blilly@@Broadcast.Sony.COM} (Bruce Lilly)
+Godfrey van der Linden @code{<Godfrey_van_der_Linden@@NeXT.COM>}
Ted Lindgreen @code{<tlindgreen@@encore.nl>}
@code{andrew@@cubetech.com} (Andrew Loewenstern)
"Arne Ludwig" @code{<arne@@rrzbu.hanse.de>}
Matthew Lyle @code{<matt@@mips.mitek.com>}
@code{djm@@eng.umd.edu} (David J. MacKenzie)
John R MacMillan @code{<chance!john@@sq.sq.com>}
+@code{jum@@helios.de} (Jens-Uwe Mager)
Giles D Malet @code{<shrdlu!gdm@@provar.kwnet.on.ca>}
@code{mem@@mv.MV.COM} (Mark E. Mallett)
@code{pepe@@dit.upm.es} (Jose A. Manas)
@@ -3919,14 +8232,17 @@ Giles D Malet @code{<shrdlu!gdm@@provar.kwnet.on.ca>}
@code{martelli@@cadlab.sublink.org} (Alex Martelli)
W Christopher Martin @code{<wcm@@geek.ca.geac.com>}
Yanek Martinson @code{<yanek@@mthvax.cs.miami.edu>}
+@code{thomasm@@mechti.wupper.de} (Thomas Mechtersheimer)
@code{jm@@aristote.univ-paris8.fr} (Jean Mehat)
@code{me@@halfab.freiburg.sub.org} (Udo Meyer)
@code{les@@chinet.chi.il.us} (Leslie Mikesell)
+@code{bug@@cyberdex.cuug.ab.ca} (Trever Miller)
@code{mmitchel@@digi.lonestar.org} (Mitch Mitchell)
Emmanuel Mogenet @code{<mgix@@krainte.jpn.thomson-di.fr>}
@code{rmohr@@infoac.rmi.de} (Rupert Mohr)
Jason Molenda @code{<molenda@@sequent.com>}
@code{ianm@@icsbelf.co.uk} (Ian Moran)
+@code{jmorriso@@bogomips.ee.ubc.ca} (John Paul Morrison)
@code{brian@@ilinx.wimsey.bc.ca} (Brian J. Murrell)
@code{service@@infohh.rmi.de} (Dirk Musstopf)
@code{lyndon@@cs.athabascau.ca} (Lyndon Nerenberg)
@@ -3938,8 +8254,10 @@ Richard E. Nickle @code{<trystro!rick@@Think.COM>}
@code{nolan@@helios.unl.edu} (Michael Nolan)
david nugent @code{<david@@csource.oz.au>}
Jim O'Connor @code{<jim@@bahamut.fsc.com>}
+@code{kevin%kosman.uucp@@nrc.com} (Kevin O'Gorman)
Petri Ojala @code{<ojala@@funet.fi>}
@code{oneill@@cs.ulowell.edu} (Brian 'Doc' O'Neill)
+@code{Stephen.Page@@prg.oxford.ac.uk}
@code{abekas!dragoman!mikep@@decwrl.dec.com} (Mike Park)
Tim Peiffer @code{peiffer@@cs.umn.edu}
@code{don@@blkhole.resun.com} (Don Phillips)
@@ -3949,14 +8267,18 @@ John Plate @code{<plate@@infotek.dk>}
@code{eldorado@@tharr.UUCP} (Mark Powell)
Mark Powell @code{<mark@@inet-uk.co.uk>}
@code{pozar@@kumr.lns.com} (Tim Pozar)
+@code{joey@@tessi.UUCP} (Joey Pruett)
+Paul Pryor @code{ptp@@fallschurch-acirs2.army.mil}
@code{putsch@@uicc.com} (Jeff Putsch)
@code{ar@@nvmr.robin.de} (Andreas Raab)
Jarmo Raiha @code{<jarmo@@ksvltd.FI>}
+James Revell @code{<revell@@uunet.uu.net>}
Scott Reynolds @code{<scott@@clmqt.marquette.Mi.US>}
@code{mcr@@Sandelman.OCUnix.On.Ca} (Michael Richardson)
Kenji Rikitake @code{<kenji@@rcac.astem.or.jp>}
@code{arnold@@cc.gatech.edu} (Arnold Robbins)
@code{steve@@Nyongwa.cam.org} (Steve M. Robbins)
+Ollivier Robert @code{<Ollivier.Robert@@keltia.frmug.fr.net>}
Serge Robyns @code{<sr@@denkart.be>}
Lawrence E. Rosenman @code{<ler@@lerami.lerctr.org>}
Jeff Ross @code{<jeff@@wisdom.bubble.org>}
@@ -3977,12 +8299,14 @@ Christopher Sawtell @code{<chris@@gerty.equinox.gen.nz>}
@code{schuler@@bds.sub.org} (Bernd Schuler)
@code{uunet!gold.sub.org!root} (Christian Seyb)
@code{s4mjs!mjs@@nirvo.nirvonics.com} (M. J. Shannon Jr.)
+@code{shields@@tembel.org} (Michael Shields)
@code{peter@@ficc.ferranti.com} (Peter da Silva)
@code{vince@@victrola.sea.wa.us} (Vince Skahan)
@code{frumious!pat} (Patrick Smith)
@code{roscom!monty@@bu.edu} (Monty Solomon)
@code{sommerfeld@@orchard.medford.ma.us} (Bill Sommerfeld)
Julian Stacey @code{<stacey@@guug.de>}
+@code{evesg@@etlrips.etl.go.jp} (Gjoen Stein)
Harlan Stenn @code{<harlan@@mumps.pfcs.com>}
Ralf Stephan @code{<ralf@@ark.abg.sub.org>}
@code{johannes@@titan.westfalen.de} (Johannes Stille)
@@ -3990,8 +8314,10 @@ Ralf Stephan @code{<ralf@@ark.abg.sub.org>}
@code{ralf@@reswi.ruhr.de} (Ralf E. Stranzenbach)
@code{sullivan@@Mathcom.com} (S. Sullivan)
Shigeya Suzuki @code{<shigeya@@dink.foretune.co.jp>}
+@code{kls@@ditka.Chicago.COM} (Karl Swartz)
@code{swiers@@plains.NoDak.edu}
Oleg Tabarovsky @code{<olg@@olghome.pccentre.msk.su>}
+@code{ikeda@@honey.misystems.co.jp} (Takatoshi Ikeda)
John Theus @code{<john@@theus.rain.com>}
@code{rd@@aii.com} (Bob Thrush)
ppKarsten Thygesen @code{<karthy@@dannug.dk>}
@@ -4001,9 +8327,12 @@ Martin Tomes @code{<mt00@@controls.eurotherm.co.uk>}
Len Tower @code{<tower-prep@@ai.mit.edu>}
Mark Towfiq @code{<justice!towfiq@@Eingedi.Newton.MA.US>}
@code{mju@@mudos.ann-arbor.mi.us} (Marc Unangst)
+Matthias Urlichs @code{<urlichs@@smurf.noris.de>}
Tomi Vainio @code{<tomppa@@fidata.fi>}
+@code{a3@@a3.xs4all.nl} (Adri Verhoef)
Andrew Vignaux @code{<ajv@@ferrari.datamark.co.nz>}
@code{vogel@@omega.ssw.de} (Andreas Vogel)
+Dima Volodin @code{<dvv@@hq.demos.su>}
@code{jos@@bull.nl} (Jos Vos)
@code{jv@@nl.net} (Johan Vromans)
David Vrona @code{<dave@@sashimi.wwa.com>}
@@ -4015,6 +8344,7 @@ David Vrona @code{<dave@@sashimi.wwa.com>}
@code{frnkmth!twwells.com!bill} (T. William Wells)
Peter Wemm @code{<Peter_Wemm@@zeus.dialix.oz.au>}
@code{mauxci!eci386!woods@@apple.com} (Greg A. Woods)
+@code{John.Woods@@proteon.com} (John Woods)
Michael Yu.Yaroslavtsev @code{<mike@@yaranga.ipmce.su>}
Alexei K. Yushin @code{<root@@july.elis.crimea.ua>}
@code{jon@@console.ais.org} (Jon Zeeff)
diff --git a/gnu/libexec/uucp/libunix/MANIFEST b/gnu/libexec/uucp/libunix/MANIFEST
index c57f466..342650a 100644
--- a/gnu/libexec/uucp/libunix/MANIFEST
+++ b/gnu/libexec/uucp/libunix/MANIFEST
@@ -17,6 +17,7 @@ dup2.c
efopen.c
epopen.c
exists.c
+failed.c
filnam.c
fsusg.c
fsusg.h
@@ -64,11 +65,15 @@ srmdir.c
statsb.c
status.c
strerr.c
+sync.c
+tcp.c
time.c
+tli.c
tmpfil.c
trunc.c
uacces.c
ufopen.c
+uid.c
ultspl.c
unknwn.c
uuto.c
diff --git a/gnu/libexec/uucp/libunix/Makefile b/gnu/libexec/uucp/libunix/Makefile
index a13b685..f4cc4a6 100644
--- a/gnu/libexec/uucp/libunix/Makefile
+++ b/gnu/libexec/uucp/libunix/Makefile
@@ -1,17 +1,17 @@
# This subdirectory contains Unix specific support functions.
-# $Id: Makefile,v 1.2 1994/05/07 18:10:03 ache Exp $
+# $Id: Makefile,v 1.3 1995/05/13 12:57:23 ache Exp $
LIB= unix
SRCS = access.c addbas.c app3.c app4.c basnam.c bytfre.c corrup.c \
chmod.c cohtty.c cusub.c cwd.c detach.c efopen.c epopen.c \
- exists.c filnam.c fsusg.c indir.c init.c isdir.c isfork.c \
- iswait.c jobid.c lcksys.c link.c locfil.c lock.c loctim.c \
- mail.c mkdirs.c mode.c move.c opensr.c pause.c picksb.c pipe.c \
- portnm.c priv.c proctm.c recep.c run.c seq.c serial.c signal.c \
- sindir.c size.c sleep.c spawn.c splcmd.c splnam.c spool.c \
- srmdir.c statsb.c status.c time.c tmpfil.c trunc.c uacces.c \
- ufopen.c ultspl.c unknwn.c uuto.c walk.c wldcrd.c work.c \
- xqtfil.c xqtsub.c ftw.c
+ exists.c failed.c filnam.c fsusg.c indir.c init.c isdir.c \
+ isfork.c iswait.c jobid.c lcksys.c link.c locfil.c lock.c \
+ loctim.c mail.c mkdirs.c mode.c move.c opensr.c pause.c \
+ picksb.c pipe.c portnm.c priv.c proctm.c recep.c run.c seq.c \
+ serial.c signal.c sindir.c size.c sleep.c spawn.c splcmd.c \
+ splnam.c spool.c srmdir.c statsb.c status.c sync.c tcp.c \
+ time.c tli.c tmpfil.c trunc.c uacces.c ufopen.c uid.c ultspl.c \
+ unknwn.c uuto.c walk.c wldcrd.c work.c xqtfil.c xqtsub.c ftw.c
CFLAGS+= -I$(.CURDIR)/../common_sources \
-DOWNER=\"$(owner)\" -DSBINDIR=\"$(libxdir)\"
diff --git a/gnu/libexec/uucp/libunix/bytfre.c b/gnu/libexec/uucp/libunix/bytfre.c
index 568eebe..3091e7a 100644
--- a/gnu/libexec/uucp/libunix/bytfre.c
+++ b/gnu/libexec/uucp/libunix/bytfre.c
@@ -7,6 +7,12 @@
#include "sysdep.h"
#include "fsusg.h"
+#if HAVE_LIMITS_H
+#include <limits.h>
+#else
+#define LONG_MAX 2147483647
+#endif
+
long
csysdep_bytes_free (zfile)
const char *zfile;
@@ -15,5 +21,7 @@ csysdep_bytes_free (zfile)
if (get_fs_usage ((char *) zfile, (char *) NULL, &s) < 0)
return -1;
+ if (s.fsu_bavail >= LONG_MAX / (long) 512)
+ return LONG_MAX;
return s.fsu_bavail * (long) 512;
}
diff --git a/gnu/libexec/uucp/libunix/cohtty.c b/gnu/libexec/uucp/libunix/cohtty.c
index 5db3fe7..5a52df9 100644
--- a/gnu/libexec/uucp/libunix/cohtty.c
+++ b/gnu/libexec/uucp/libunix/cohtty.c
@@ -3,7 +3,7 @@
lightly edited by Ian Lance Taylor. */
/* The bottom part of this file is lock.c.
- * This is a hacked lock.c. A full lock.c can be found in the libmisc sources
+ * This is a hacked lock.c. A full lock.c can be found in the libmisc sources
* under /usr/src/misc.tar.Z.
*
* These are for checking for the existence of locks:
@@ -146,7 +146,7 @@ char enable_device[16]; /* this will hold our device name
return TRUE;
}else{
/* device not enabled */
- return TRUE;
+ return TRUE;
}
}
}
@@ -192,7 +192,7 @@ char *buff;
{
struct stat sbuf;
int status;
-
+
if (0 != (status = stat(path, &sbuf))) {
/* Can't stat the file. */
return (NULL);
diff --git a/gnu/libexec/uucp/libunix/cusub.c b/gnu/libexec/uucp/libunix/cusub.c
index 3486c71..b1bce90 100644
--- a/gnu/libexec/uucp/libunix/cusub.c
+++ b/gnu/libexec/uucp/libunix/cusub.c
@@ -1,7 +1,7 @@
/* cusub.c
System dependent routines for cu.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char cusub_rcsid[] = "$Id: cusub.c,v 1.2 1994/05/07 18:10:14 ache Exp $";
+const char cusub_rcsid[] = "$Id: cusub.c,v 1.24 1995/06/21 19:18:53 ian Rel $";
#endif
#include "uudefs.h"
@@ -330,7 +330,7 @@ fsysdep_cu (qconn, pbcmd, zlocalname)
if (c <= 0)
break;
- if (fstart && b == *zCuvar_escape)
+ if (fstart && b == *zCuvar_escape && b != '\0')
{
c = cscu_escape (pbcmd, zlocalname);
if (c <= 0)
@@ -410,7 +410,7 @@ cscu_escape (pbcmd, zlocalname)
usysdep_start_catch ();
alarm (1);
}
-
+
c = 0;
while (TRUE)
@@ -426,7 +426,7 @@ cscu_escape (pbcmd, zlocalname)
b = ']';
write (1, &b, 1);
}
-
+
if (c <= 0)
c = read (0, pbcmd, 1);
if (c >= 0 || errno != EINTR)
@@ -437,7 +437,7 @@ cscu_escape (pbcmd, zlocalname)
return c;
}
}
-}
+}
/* A SIGALRM handler which does nothing but send a signal to the child
process and schedule another alarm. POSIX.1 permits kill and alarm
@@ -715,7 +715,7 @@ uscu_child (qconn, opipe)
cwrite -= c;
zbuf += c;
}
- }
+ }
else
{
/* On some systems apparently read will return 0 until
@@ -788,7 +788,7 @@ fsysdep_terminal_raw (flocalecho)
}
fSterm = TRUE;
-
+
sSterm_new = sSterm_orig;
#if HAVE_BSD_TTY
@@ -1114,7 +1114,14 @@ fsysdep_shell (qconn, zcmd, tcmd)
int aidescs[3];
pid_t ipid;
- azargs[0] = "/bin/sh";
+ if (tcmd != SHELL_NORMAL)
+ azargs[0] = "/bin/sh";
+ else
+ {
+ azargs[0] = getenv ("SHELL");
+ if (azargs[0] == NULL)
+ azargs[0] = "/bin/sh";
+ }
if (zcmd == NULL || *zcmd == '\0')
azargs[1] = NULL;
else
@@ -1158,7 +1165,7 @@ fsysdep_shell (qconn, zcmd, tcmd)
aidescs[0] = oread;
if (tcmd == SHELL_STDOUT_TO_PORT || tcmd == SHELL_STDIO_ON_PORT)
aidescs[1] = owrite;
-
+
ipid = ixsspawn (azargs, aidescs, FALSE, TRUE, (const char *) NULL,
FALSE, FALSE, (const char *) NULL,
(const char *) NULL, (const char *) NULL);
diff --git a/gnu/libexec/uucp/libunix/cwd.c b/gnu/libexec/uucp/libunix/cwd.c
index 486105a..71d05d1 100644
--- a/gnu/libexec/uucp/libunix/cwd.c
+++ b/gnu/libexec/uucp/libunix/cwd.c
@@ -37,7 +37,7 @@ zsysdep_local_file_cwd (zfile, zpubdir, pfbadname)
return zsysdep_local_file (zfile, zpubdir, pfbadname);
else
return zsysdep_add_cwd (zfile);
-}
+}
/* Add the current working directory to a remote file name. */
diff --git a/gnu/libexec/uucp/libunix/detach.c b/gnu/libexec/uucp/libunix/detach.c
index 3a21b8a..88becf1 100644
--- a/gnu/libexec/uucp/libunix/detach.c
+++ b/gnu/libexec/uucp/libunix/detach.c
@@ -1,7 +1,7 @@
/* detach.c
Detach from the controlling terminal.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -38,7 +38,7 @@
#ifdef TIOCNOTTY
#define HAVE_TIOCNOTTY 1
#else
-#define HAVE_TIOCNOTTY 0
+#define HAVE_TIOCNOTTY 0
#endif
#if HAVE_FCNTL_H
@@ -71,6 +71,11 @@ usysdep_detach ()
{
pid_t igrp;
+ /* Make sure that we can open the log file. We do this now so that,
+ if we can't, a message will be written to stderr. After we leave
+ this routine, stderr will be closed. */
+ ulog (LOG_NORMAL, (const char *) NULL);
+
/* Make sure we are not a process group leader. */
#if HAVE_BSD_PGRP
igrp = getpgrp (0);
@@ -107,17 +112,24 @@ usysdep_detach ()
if (! fignored)
usset_signal (SIGHUP, ussignal, TRUE, (boolean *) NULL);
- DEBUG_MESSAGE2 (DEBUG_PORT, "Forked; old PID %ld, new pid %ld",
+ DEBUG_MESSAGE2 (DEBUG_PORT,
+ "usysdep_detach: Forked; old PID %ld, new pid %ld",
(long) igrp, (long) ipid);
}
#if ! HAVE_SETSID && HAVE_TIOCNOTTY
/* Lose the original controlling terminal as well as our process
- group. If standard input has been reopened to /dev/null, this
- will do no harm. If another port has been opened to become the
- controlling terminal, it should have been detached when it was
- closed. */
- (void) ioctl (0, TIOCNOTTY, (char *) NULL);
+ group. */
+ {
+ int o;
+
+ o = open ((char *) "/dev/tty", O_RDONLY);
+ if (o >= 0)
+ {
+ (void) ioctl (o, TIOCNOTTY, (char *) NULL);
+ (void) close (o);
+ }
+ }
#endif /* ! HAVE_SETSID && HAVE_TIOCNOTTY */
/* Close stdin, stdout and stderr and reopen them on /dev/null, to
diff --git a/gnu/libexec/uucp/libunix/dirent.c b/gnu/libexec/uucp/libunix/dirent.c
index c7e467e..7ad0ec6 100644
--- a/gnu/libexec/uucp/libunix/dirent.c
+++ b/gnu/libexec/uucp/libunix/dirent.c
@@ -18,10 +18,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/dup2.c b/gnu/libexec/uucp/libunix/dup2.c
index 8446163..a3fcea5 100644
--- a/gnu/libexec/uucp/libunix/dup2.c
+++ b/gnu/libexec/uucp/libunix/dup2.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -47,7 +47,7 @@ dup2 (oold, onew)
if (oold == onew)
return onew;
(void) close (onew);
-
+
#ifdef F_DUPFD
return fcntl (oold, F_DUPFD, onew);
#else
diff --git a/gnu/libexec/uucp/libunix/epopen.c b/gnu/libexec/uucp/libunix/epopen.c
index 0ab9725..1873c5c 100644
--- a/gnu/libexec/uucp/libunix/epopen.c
+++ b/gnu/libexec/uucp/libunix/epopen.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -78,7 +78,7 @@ espopen (pazargs, frd, pipid)
errno = ierr;
return NULL;
}
-
+
*pipid = ipid;
return eret;
diff --git a/gnu/libexec/uucp/libunix/failed.c b/gnu/libexec/uucp/libunix/failed.c
new file mode 100644
index 0000000..66c98a8
--- /dev/null
+++ b/gnu/libexec/uucp/libunix/failed.c
@@ -0,0 +1,26 @@
+/* failed.c
+ Save a file in the .Failed directory. */
+
+#include "uucp.h"
+
+#include "sysdep.h"
+#include "uudefs.h"
+#include "system.h"
+
+char *
+zsysdep_save_failed_file (zfile)
+ const char *zfile;
+{
+ char *zto;
+
+ zto = zsappend3 (zSspooldir, FAILEDDIR, zfile);
+
+ if (! fsysdep_move_file (zfile, zto, TRUE, FALSE, FALSE,
+ (const char *) NULL))
+ {
+ ubuffree (zto);
+ return NULL;
+ }
+
+ return zto;
+}
diff --git a/gnu/libexec/uucp/libunix/filnam.c b/gnu/libexec/uucp/libunix/filnam.c
index 7dd6626..6f804bb 100644
--- a/gnu/libexec/uucp/libunix/filnam.c
+++ b/gnu/libexec/uucp/libunix/filnam.c
@@ -1,7 +1,7 @@
/* filnam.c
Get names to use for UUCP files.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -56,6 +56,23 @@
#define SEEK_SET 0
#endif
+/* We use POSIX style fcntl locks if they are available, unless
+ O_CREAT is not defined. We could use them in the latter case, but
+ the code would have to become more complex to avoid races
+ concerning the use of creat. It is very unlikely that there is any
+ system which does have POSIX style locking but does not have
+ O_CREAT. */
+#if ! HAVE_BROKEN_SETLKW
+#ifdef F_SETLKW
+#ifdef O_CREAT
+#define USE_POSIX_LOCKS 1
+#endif
+#endif
+#endif
+#ifndef USE_POSIX_LOCKS
+#define USE_POSIX_LOCKS 0
+#endif
+
/* External functions. */
#ifndef lseek
extern off_t lseek ();
@@ -83,21 +100,31 @@ fscmd_seq (zsystem, zseq)
const char *zsystem;
char *zseq;
{
- boolean ferr;
+ int cdelay;
char *zfree;
const char *zfile;
int o;
+ boolean flockfile;
int i;
+ boolean fret;
- /* Lock the sequence file. This may not be correct for all systems,
- but it only matters if the system UUCP and this UUCP are running
- at the same time. */
- while (! fsdo_lock ("LCK..SEQ", TRUE, &ferr))
- {
- if (ferr || FGOT_SIGNAL ())
- return FALSE;
- sleep (5);
- }
+ cdelay = 5;
+
+#if ! USE_POSIX_LOCKS
+ {
+ boolean ferr;
+
+ /* Lock the sequence file. */
+ while (! fsdo_lock ("LCK..SEQ", TRUE, &ferr))
+ {
+ if (ferr || FGOT_SIGNAL ())
+ return FALSE;
+ sleep (cdelay);
+ if (cdelay < 60)
+ ++cdelay;
+ }
+ }
+#endif
zfree = NULL;
@@ -123,12 +150,12 @@ fscmd_seq (zsystem, zseq)
#endif /* SPOOLDIR_TAYLOR */
#ifdef O_CREAT
- o = open ((char *) zfile, O_RDWR | O_CREAT | O_NOCTTY, IPUBLIC_FILE_MODE);
+ o = open ((char *) zfile, O_RDWR | O_CREAT | O_NOCTTY, IPRIVATE_FILE_MODE);
#else
o = open ((char *) zfile, O_RDWR | O_NOCTTY);
if (o < 0 && errno == ENOENT)
{
- o = creat ((char *) zfile, IPUBLIC_FILE_MODE);
+ o = creat ((char *) zfile, IPRIVATE_FILE_MODE);
if (o >= 0)
{
(void) close (o);
@@ -143,15 +170,17 @@ fscmd_seq (zsystem, zseq)
{
if (! fsysdep_make_dirs (zfile, FALSE))
{
+#if ! USE_POSIX_LOCKS
(void) fsdo_unlock ("LCK..SEQ", TRUE);
+#endif
return FALSE;
}
#ifdef O_CREAT
o = open ((char *) zfile,
O_RDWR | O_CREAT | O_NOCTTY,
- IPUBLIC_FILE_MODE);
+ IPRIVATE_FILE_MODE);
#else
- o = creat ((char *) zfile, IPUBLIC_FILE_MODE);
+ o = creat ((char *) zfile, IPRIVATE_FILE_MODE);
if (o >= 0)
{
(void) close (o);
@@ -162,11 +191,79 @@ fscmd_seq (zsystem, zseq)
if (o < 0)
{
ulog (LOG_ERROR, "open (%s): %s", zfile, strerror (errno));
+#if ! USE_POSIX_LOCKS
(void) fsdo_unlock ("LCK..SEQ", TRUE);
+#endif
return FALSE;
}
}
+#if ! USE_POSIX_LOCKS
+ flockfile = TRUE;
+#else
+ {
+ struct flock slock;
+
+ flockfile = FALSE;
+
+ slock.l_type = F_WRLCK;
+ slock.l_whence = SEEK_SET;
+ slock.l_start = 0;
+ slock.l_len = 0;
+ while (fcntl (o, F_SETLKW, &slock) == -1)
+ {
+ boolean fagain;
+
+ /* Some systems define F_SETLKW, but it does not work. We try
+ to catch those systems at runtime, and revert to using a
+ lock file. */
+ if (errno == EINVAL)
+ {
+ boolean ferr;
+
+ /* Lock the sequence file. */
+ while (! fsdo_lock ("LCK..SEQ", TRUE, &ferr))
+ {
+ if (ferr || FGOT_SIGNAL ())
+ {
+ (void) close (o);
+ return FALSE;
+ }
+ sleep (cdelay);
+ if (cdelay < 60)
+ ++cdelay;
+ }
+
+ flockfile = TRUE;
+
+ break;
+ }
+
+ fagain = FALSE;
+ if (errno == ENOMEM)
+ fagain = TRUE;
+#ifdef ENOLCK
+ if (errno == ENOLCK)
+ fagain = TRUE;
+#endif
+#ifdef ENOSPC
+ if (errno == ENOSPC)
+ fagain = TRUE;
+#endif
+ if (fagain)
+ {
+ sleep (cdelay);
+ if (cdelay < 60)
+ ++cdelay;
+ continue;
+ }
+ ulog (LOG_ERROR, "Locking %s: %s", zfile, strerror (errno));
+ (void) close (o);
+ return FALSE;
+ }
+ }
+#endif
+
if (read (o, zseq, CSEQLEN) != CSEQLEN)
strcpy (zseq, "0000");
zseq[CSEQLEN] = '\0';
@@ -199,19 +296,24 @@ fscmd_seq (zsystem, zseq)
}
#endif /* SPOOLDIR_ULTRIX || SPOOLDIR_TAYLOR */
+ fret = TRUE;
+
if (lseek (o, (off_t) 0, SEEK_SET) < 0
|| write (o, zseq, CSEQLEN) != CSEQLEN
|| close (o) < 0)
{
- ulog (LOG_ERROR, "lseek or write or close: %s", strerror (errno));
+ ulog (LOG_ERROR, "lseek or write or close %s: %s",
+ zfile, strerror (errno));
(void) close (o);
- (void) fsdo_unlock ("LCK..SEQ", TRUE);
- return FALSE;
+ fret = FALSE;
}
- (void) fsdo_unlock ("LCK..SEQ", TRUE);
+ if (flockfile)
+ (void) fsdo_unlock ("LCK..SEQ", TRUE);
+
+ ubuffree (zfree);
- return TRUE;
+ return fret;
}
/* Get the name of a command or data file for a remote system. The
@@ -266,9 +368,9 @@ zsfile_name (btype, zsystem, zlocalname, bgrade, fxqt, ztname, zdname, zxname)
our system name so that remote UUCP's running SPOOLDIR_V2
and the like can distinguish while files come from which
systems. */
-#if SPOOLDIR_HDB || SPOOLDIR_SVR4
+#if SPOOLDIR_SVR4
sprintf (absimple, "D.%.7s%c%s", zsystem, bgrade, abseq);
-#else /* ! SPOOLDIR_HDB && ! SPOOLDIR_SVR4 */
+#else /* ! SPOOLDIR_SVR4 */
#if ! SPOOLDIR_TAYLOR
sprintf (absimple, "D.%.7s%c%s", zlocalname, bgrade, abseq);
#else /* SPOOLDIR_TAYLOR */
@@ -329,10 +431,41 @@ zsysdep_data_file_name (qsys, zlocalname, bgrade, fxqt, ztname, zdname,
char *zdname;
char *zxname;
{
- return zsfile_name ('D', qsys->uuconf_zname, zlocalname, bgrade, fxqt,
+ return zsfile_name ('D', qsys->uuconf_zname, zlocalname, bgrade, fxqt,
ztname, zdname, zxname);
}
+#if SPOOLDIR_TAYLOR
+
+/* Write out a number in base 62 into a given number of characters,
+ right justified with zero fill. This is used by zscmd_file if
+ SPOOLDIR_TAYLOR. */
+
+static void usput62 P((long i, char *, int c));
+
+static void
+usput62 (i, z, c)
+ long i;
+ char *z;
+ int c;
+{
+ for (--c; c >= 0; --c)
+ {
+ int d;
+
+ d = i % 62;
+ i /= 62;
+ if (d < 26)
+ z[c] = 'A' + d;
+ else if (d < 52)
+ z[c] = 'a' + d - 26;
+ else
+ z[c] = '0' + d - 52;
+ }
+}
+
+#endif /* SPOOLDIR_TAYLOR */
+
/* Get a command file name. */
char *
@@ -340,9 +473,84 @@ zscmd_file (qsys, bgrade)
const struct uuconf_system *qsys;
int bgrade;
{
+#if ! SPOOLDIR_TAYLOR
return zsfile_name ('C', qsys->uuconf_zname, (const char *) NULL,
bgrade, FALSE, (char *) NULL, (char *) NULL,
(char *) NULL);
+#else
+ char *zname;
+ long isecs, imicros;
+ pid_t ipid;
+
+ /* This file name is never seen by the remote system, so we don't
+ actually need to get a sequence number for it. We just need to
+ get a file name which is unique for this system. We don't try
+ this optimization for other spool directory formats, mainly due
+ to compatibility concerns. It would be possible for HDB and SVR4
+ spool directory formats.
+
+ We get a unique name by combining the process ID and the current
+ time. The file name must start with C.g, where g is the grade.
+ Note that although it is likely that this name will be unique, it
+ is not guaranteed, so the caller must be careful. */
+
+ isecs = ixsysdep_time (&imicros);
+ ipid = getpid ();
+
+ /* We are going to represent the file name as a series of numbers in
+ base 62 (using the alphanumeric characters). The maximum file
+ name length is 14 characters, so we may use 11. We use 3 for the
+ seconds within the day, 3 for the microseconds, and 5 for the
+ process ID. */
+
+ /* Cut the seconds down to a number within a day (maximum value
+ 86399 < 62 ** 3 == 238328). */
+ isecs %= (long) 24 * (long) 60 * (long) 60;
+ /* Divide the microseconds (max 999999) by 5 to make sure they are
+ less than 62 ** 3. */
+ imicros %= 1000000;
+ imicros /= 5;
+
+ while (TRUE)
+ {
+ char ab[15];
+
+ ab[0] = 'C';
+ ab[1] = '.';
+ ab[2] = bgrade;
+ usput62 (isecs, ab + 3, 3);
+ usput62 (imicros, ab + 6, 3);
+ usput62 ((long) ipid, ab + 9, 5);
+ ab[14] = '\0';
+
+ zname = zsfind_file (ab, qsys->uuconf_zname, bgrade);
+ if (zname == NULL)
+ return NULL;
+
+ if (! fsysdep_file_exists (zname))
+ break;
+
+ ubuffree (zname);
+
+ /* We hit a duplicate. Move backward in time until we find an
+ available name. Note that there is still a theoretical race
+ condition, since 5 base 62 digits might not be enough for the
+ process ID, and some other process might be running these
+ checks at the same time as we are. The caller must deal with
+ this. */
+ if (imicros == 0)
+ {
+ imicros = (long) 62 * (long) 62 * (long) 62;
+ if (isecs == 0)
+ isecs = (long) 62 * (long) 62 * (long) 62;
+ --isecs;
+ }
+ --imicros;
+ }
+
+ return zname;
+
+#endif
}
/* Return a name for an execute file to be created locally. This is
diff --git a/gnu/libexec/uucp/libunix/fsusg.c b/gnu/libexec/uucp/libunix/fsusg.c
index cee1ff0..9189193 100644
--- a/gnu/libexec/uucp/libunix/fsusg.c
+++ b/gnu/libexec/uucp/libunix/fsusg.c
@@ -1,5 +1,5 @@
/* fsusage.c -- return space usage of mounted filesystems
- Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992 Free Software Foundation, Inc.
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
@@ -13,74 +13,70 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This file was modified slightly by Ian Lance Taylor, December 1992,
- for use with Taylor UUCP. */
+ and again July 1995, for use with Taylor UUCP. */
#include "uucp.h"
#include "uudefs.h"
#include "sysdep.h"
#include "fsusg.h"
-#if STAT_STATFS2_BSIZE
-#ifdef __FreeBSD__
+int statfs ();
+
+#if HAVE_SYS_PARAM_H
#include <sys/param.h>
-#include <sys/mount.h>
-#else
-#ifndef _IBMR2 /* 4.3BSD, SunOS 4, HP-UX, AIX PS/2. */
-#include <sys/vfs.h>
-#endif
-#endif
#endif
-#if STAT_STATFS2_FSIZE /* 4.4BSD. */
+#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
-#if STAT_STATFS2_FS_DATA /* Ultrix. */
-#include <sys/param.h>
-#include <sys/mount.h>
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
#endif
-#if STAT_USTAT /* SVR2 and others. */
-#include <ustat.h>
+#if HAVE_SYS_FILSYS_H
+#include <sys/filsys.h> /* SVR2. */
#endif
-#if STAT_STATFS4 /* SVR3, Dynix, Irix. */
-#include <sys/statfs.h>
+#if HAVE_FCNTL_H
+#include <fcntl.h>
#endif
-#ifdef _AIX
-#ifdef _IBMR2 /* AIX RS6000. */
+
+#if HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#endif
-#endif
-#if STAT_DUSTAT /* AIX PS/2. */
-#include <sys/stat.h>
+#if HAVE_SYS_DUSTAT_H /* AIX PS/2. */
#include <sys/dustat.h>
#endif
-#if STAT_STATVFS /* SVR4. */
+#if HAVE_SYS_STATVFS_H /* SVR4. */
#include <sys/statvfs.h>
+int statvfs ();
+#endif
+
+#if HAVE_USTAT_H /* SVR2 and others. */
+#include <ustat.h>
#endif
#if STAT_DISK_SPACE /* QNX. */
#include <sys/disk.h>
-#include <fcntl.h>
#include <errno.h>
#endif
#define STAT_NONE 0
-#if ! STAT_STATVFS
+#if ! STAT_STATFS3_OSF1
+#if ! STAT_STATFS2_FS_DATA
#if ! STAT_STATFS2_BSIZE
#if ! STAT_STATFS2_FSIZE
-#if ! STAT_STATFS2_FS_DATA
#if ! STAT_STATFS4
-#if ! STAT_DUSTAT
-#if ! STAT_USTAT
+#if ! STAT_STATVFS
#if ! STAT_DISK_SPACE
+#if ! STAT_USTAT
#undef STAT_NONE
#define STAT_NONE 1
#endif
@@ -97,19 +93,25 @@
static long adjust_blocks P((long blocks, int fromsize, int tosize));
/* Return the number of TOSIZE-byte blocks used by
- BLOCKS FROMSIZE-byte blocks, rounding up. */
+ BLOCKS FROMSIZE-byte blocks, rounding away from zero.
+ TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */
static long
adjust_blocks (blocks, fromsize, tosize)
long blocks;
int fromsize, tosize;
{
+ if (tosize <= 0)
+ abort ();
+ if (fromsize <= 0)
+ return -1;
+
if (fromsize == tosize) /* E.g., from 512 to 512. */
return blocks;
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
return blocks * (fromsize / tosize);
else /* E.g., from 256 to 512. */
- return (blocks + 1) / (tosize / fromsize);
+ return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
}
#endif
@@ -129,25 +131,33 @@ get_fs_usage (path, disk, fsp)
return -1;
#endif
+#if STAT_STATFS3_OSF1
+ struct statfs fsd;
+
+ if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
+ return -1;
+#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512)
+#endif /* STAT_STATFS3_OSF1 */
+
#if STAT_STATFS2_FS_DATA /* Ultrix. */
struct fs_data fsd;
if (statfs (path, &fsd) != 1)
return -1;
-#define convert_blocks(b) adjust_blocks ((long) (b), 1024, 512)
- fsp->fsu_blocks = convert_blocks (fsd.fd_req.btot);
- fsp->fsu_bfree = convert_blocks (fsd.fd_req.bfree);
- fsp->fsu_bavail = convert_blocks (fsd.fd_req.bfreen);
+#define CONVERT_BLOCKS(b) adjust_blocks ((long) (b), 1024, 512)
+ fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot);
+ fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree);
+ fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen);
fsp->fsu_files = fsd.fd_req.gtot;
fsp->fsu_ffree = fsd.fd_req.gfree;
#endif
-#if STAT_STATFS2_BSIZE || STAT_DUSTAT /* 4.3BSD, SunOS 4, HP-UX, AIX. */
+#if STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX. */
struct statfs fsd;
if (statfs (path, &fsd) < 0)
return -1;
-#define convert_blocks(b) adjust_blocks ((b), fsd.f_bsize, 512)
+#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
#endif
#if STAT_STATFS2_FSIZE /* 4.4BSD. */
@@ -155,7 +165,7 @@ get_fs_usage (path, disk, fsp)
if (statfs (path, &fsd) < 0)
return -1;
-#define convert_blocks(b) adjust_blocks ((b), fsd.f_fsize, 512)
+#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512)
#endif
#if STAT_STATFS4 /* SVR3, Dynix, Irix. */
@@ -166,10 +176,16 @@ get_fs_usage (path, disk, fsp)
/* Empirically, the block counts on most SVR3 and SVR3-derived
systems seem to always be in terms of 512-byte blocks,
no matter what value f_bsize has. */
-#define convert_blocks(b) (b)
-#ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx. */
-#define f_bavail f_bfree
-#endif
+# if _AIX
+# define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
+# else
+# define CONVERT_BLOCKS(b) (b)
+# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx. */
+# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */
+# define f_bavail f_bfree
+# endif
+# endif
+# endif
#endif
#if STAT_STATVFS /* SVR4. */
@@ -178,7 +194,7 @@ get_fs_usage (path, disk, fsp)
if (statvfs (path, &fsd) < 0)
return -1;
/* f_frsize isn't guaranteed to be supported. */
-#define convert_blocks(b) \
+#define CONVERT_BLOCKS(b) \
adjust_blocks ((b), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512)
#endif
@@ -188,7 +204,7 @@ get_fs_usage (path, disk, fsp)
long cfree_blocks, ctotal_blocks;
char *zpath;
char *zslash;
-
+
zpath = zbufcpy (path);
while ((o = open (zpath, O_RDONLY, 0)) == -1
&& errno == ENOENT)
@@ -247,7 +263,7 @@ get_fs_usage (path, disk, fsp)
fsp->fsu_blocks = ctotal_blocks;
fsp->fsu_bfree = cfree_blocks;
fsp->fsu_bavail = cfree_blocks;
-
+
/* QNX has no limit on the number of inodes. Most inodes are stored
directly in the directory entry. */
fsp->fsu_files = -1;
@@ -272,9 +288,9 @@ get_fs_usage (path, disk, fsp)
#if ! STAT_DISK_SPACE
#if ! STAT_USTAT
#if ! STAT_NONE
- fsp->fsu_blocks = convert_blocks (fsd.f_blocks);
- fsp->fsu_bfree = convert_blocks (fsd.f_bfree);
- fsp->fsu_bavail = convert_blocks (fsd.f_bavail);
+ fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
+ fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
+ fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
fsp->fsu_files = fsd.f_files;
fsp->fsu_ffree = fsd.f_ffree;
#endif
@@ -285,7 +301,8 @@ get_fs_usage (path, disk, fsp)
return 0;
}
-#if STAT_DUSTAT
+#ifdef _AIX
+#ifdef _I386
/* AIX PS/2 does not supply statfs. */
int
@@ -311,4 +328,5 @@ statfs (path, fsb)
fsb->f_fsid.val[1] = fsd.du_pckno;
return 0;
}
-#endif /* STAT_DUSTAT */
+#endif /* _I386 */
+#endif /* _AIX */
diff --git a/gnu/libexec/uucp/libunix/fsusg.h b/gnu/libexec/uucp/libunix/fsusg.h
index 8d4d054..2b9ddd5 100644
--- a/gnu/libexec/uucp/libunix/fsusg.h
+++ b/gnu/libexec/uucp/libunix/fsusg.h
@@ -13,7 +13,7 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This files was modified slightly by Ian Lance Taylor for use with
Taylor UUCP. */
diff --git a/gnu/libexec/uucp/libunix/ftw.c b/gnu/libexec/uucp/libunix/ftw.c
index c7af06e..f7af66f 100644
--- a/gnu/libexec/uucp/libunix/ftw.c
+++ b/gnu/libexec/uucp/libunix/ftw.c
@@ -14,8 +14,8 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.
+not, write to the Free Software Foundation, Inc., 59 Temple Place -
+Suite 330, Boston, MA 02111-1307, USA.
Modified by Ian Lance Taylor for Taylor UUCP, June 1992, and October 1993. */
@@ -76,7 +76,7 @@ ftw_dir (dirs, level, descriptors, dir, len, func)
{
size_t namlen;
struct stat s;
- int flag, ret, newlev;
+ int flag, ret, newlev = 0;
++got;
diff --git a/gnu/libexec/uucp/libunix/getcwd.c b/gnu/libexec/uucp/libunix/getcwd.c
index da53b56..d3623bd 100644
--- a/gnu/libexec/uucp/libunix/getcwd.c
+++ b/gnu/libexec/uucp/libunix/getcwd.c
@@ -48,7 +48,7 @@ getcwd (zbuf, cbuf)
cread = 0;
}
}
-
+
if (cread == 0)
{
errno = ierr;
diff --git a/gnu/libexec/uucp/libunix/indir.c b/gnu/libexec/uucp/libunix/indir.c
index de1df70..88cdb0e 100644
--- a/gnu/libexec/uucp/libunix/indir.c
+++ b/gnu/libexec/uucp/libunix/indir.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/init.c b/gnu/libexec/uucp/libunix/init.c
index 95822db..8a3c416 100644
--- a/gnu/libexec/uucp/libunix/init.c
+++ b/gnu/libexec/uucp/libunix/init.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/isfork.c b/gnu/libexec/uucp/libunix/isfork.c
index f28d65f..f067d07 100644
--- a/gnu/libexec/uucp/libunix/isfork.c
+++ b/gnu/libexec/uucp/libunix/isfork.c
@@ -1,4 +1,4 @@
-/* isfork.c
+/* isfork.c
Retry fork several times before giving up. */
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/iswait.c b/gnu/libexec/uucp/libunix/iswait.c
index 361443a..d13db6e 100644
--- a/gnu/libexec/uucp/libunix/iswait.c
+++ b/gnu/libexec/uucp/libunix/iswait.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -134,7 +134,7 @@ ixswait (ipid, zreport)
}
}
#endif /* ! HAVE_WAIT4 */
-#endif /* ! HAVE_WAITPID */
+#endif /* ! HAVE_WAITPID */
DEBUG_MESSAGE2 (DEBUG_EXECUTE, "%s %d",
WIFEXITED (istat) ? "Exit status" : "Signal",
diff --git a/gnu/libexec/uucp/libunix/jobid.c b/gnu/libexec/uucp/libunix/jobid.c
index c8b21cb..b7f9145 100644
--- a/gnu/libexec/uucp/libunix/jobid.c
+++ b/gnu/libexec/uucp/libunix/jobid.c
@@ -1,7 +1,7 @@
/* jobid.c
Convert file names to jobids and vice versa.
- Copyright (C) 1991, 1992 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -31,10 +31,7 @@
#include "system.h"
/* Translate a file name and an associated system into a job id.
- These job ids are used by uustat. We use the system name attached
- to the grade and sequence number. This won't work correctly if the
- file name was actually created by some other version of uucp that
- uses a different length for the sequence number. Too bad. */
+ These job ids are used by uustat. */
char *
zsfile_to_jobid (qsys, zfile, bgrade)
@@ -46,10 +43,50 @@ zsfile_to_jobid (qsys, zfile, bgrade)
char *zret;
clen = strlen (qsys->uuconf_zname);
+
+#if ! SPOOLDIR_TAYLOR
+
+ /* We use the system name attached to the grade and sequence number.
+ This won't work correctly if the file name was actually created
+ by some other version of uucp that uses a different length for
+ the sequence number. Too bad. */
+
zret = zbufalc (clen + CSEQLEN + 2);
memcpy (zret, qsys->uuconf_zname, clen);
zret[clen] = bgrade;
memcpy (zret + clen + 1, zfile + strlen (zfile) - CSEQLEN, CSEQLEN + 1);
+
+#else
+
+ /* We use the system name followed by a dot, the grade, and the
+ sequence number. In this case, the sequence number is a long
+ string. */
+
+ {
+ size_t cseqlen;
+
+ /* zfile is SYS/C./C.gseq. */
+ zfile = strrchr (zfile, '/');
+
+#if DEBUG > 0
+ if (zfile == NULL
+ || zfile[1] != 'C'
+ || zfile[2] != '.'
+ || zfile[3] == '\0')
+ ulog (LOG_FATAL, "zsfile_to_jobid: Can't happen");
+#endif
+
+ /* Make zfile point at .gseq. */
+ zfile += 2;
+
+ cseqlen = strlen (zfile);
+ zret = zbufalc (clen + cseqlen + 1);
+ memcpy (zret, qsys->uuconf_zname, clen);
+ memcpy (zret + clen, zfile, cseqlen + 1);
+ }
+
+#endif
+
return zret;
}
@@ -61,6 +98,7 @@ zsjobid_to_file (zid, pzsystem, pbgrade)
char **pzsystem;
char *pbgrade;
{
+#if ! SPOOLDIR_TAYLOR
size_t clen;
const char *zend;
char *zsys;
@@ -81,11 +119,7 @@ zsjobid_to_file (zid, pzsystem, pbgrade)
zsys[clen - CSEQLEN - 1] = '\0';
/* This must correspond to zsfile_name. */
-#if ! SPOOLDIR_TAYLOR
sprintf (abname, "C.%.7s%s", zsys, zend);
-#else
- sprintf (abname, "C.%s", zend);
-#endif
zret = zsfind_file (abname, zsys, *zend);
@@ -98,4 +132,38 @@ zsjobid_to_file (zid, pzsystem, pbgrade)
*pbgrade = *zend;
return zret;
+#else /* SPOOLDIR_TAYLOR */
+ char *zdot;
+ size_t csyslen;
+ char *zsys;
+ char ab[15];
+ char *zret;
+
+ zdot = strrchr (zid, '.');
+ if (zdot == NULL)
+ {
+ ulog (LOG_ERROR, "%s: Bad job id", zid);
+ return NULL;
+ }
+
+ csyslen = zdot - zid;
+ zsys = zbufalc (csyslen + 1);
+ memcpy (zsys, zid, csyslen);
+ zsys[csyslen] = '\0';
+
+ ab[0] = 'C';
+ strcpy (ab + 1, zdot);
+
+ zret = zsfind_file (ab, zsys, zdot[1]);
+
+ if (zret != NULL && pzsystem != NULL)
+ *pzsystem = zsys;
+ else
+ ubuffree (zsys);
+
+ if (pbgrade != NULL)
+ *pbgrade = zdot[1];
+
+ return zret;
+#endif /* SPOOLDIR_TAYLOR */
}
diff --git a/gnu/libexec/uucp/libunix/lcksys.c b/gnu/libexec/uucp/libunix/lcksys.c
index c1b0efa..ab2e2c8 100644
--- a/gnu/libexec/uucp/libunix/lcksys.c
+++ b/gnu/libexec/uucp/libunix/lcksys.c
@@ -8,21 +8,39 @@
#include "sysdep.h"
#include "system.h"
-/* Get the name of a system lock file. */
+/* Do the actual lock or unlock. */
-static char *zssys_lock_name P((const struct uuconf_system *qsys, char *z));
+static boolean fslock_sys P((boolean, const char *));
-#define LOCKNAMELEN (sizeof "LCK..12345678")
-
-static char *
-zssys_lock_name (qsys, z)
- const struct uuconf_system *qsys;
- char *z;
+static boolean
+fslock_sys (flock, zname)
+ boolean flock;
+ const char *zname;
{
- strcpy (z, "LCK..");
- strncpy (z + sizeof "LCK.." - 1, qsys->uuconf_zname, 8);
- z[sizeof "LCK.." - 1 + 8] = '\0';
- return z;
+ size_t clen;
+ char *z;
+ boolean fret;
+
+ clen = strlen (zname);
+
+#if ! HAVE_LONG_FILE_NAMES
+ if (clen > 8)
+ clen = 8;
+#endif
+
+ z = zbufalc (sizeof "LCK.." + clen);
+ memcpy (z, "LCK..", sizeof "LCK.." - 1);
+ memcpy (z + sizeof "LCK.." - 1, zname, clen);
+ z[sizeof "LCK.." - 1 + clen] = '\0';
+
+ if (flock)
+ fret = fsdo_lock (z, FALSE, (boolean *) NULL);
+ else
+ fret = fsdo_unlock (z, FALSE);
+
+ ubuffree (z);
+
+ return fret;
}
/* Lock a remote system. */
@@ -31,9 +49,7 @@ boolean
fsysdep_lock_system (qsys)
const struct uuconf_system *qsys;
{
- char ab[LOCKNAMELEN];
-
- return fsdo_lock (zssys_lock_name (qsys, ab), FALSE, (boolean *) NULL);
+ return fslock_sys (TRUE, qsys->uuconf_zname);
}
/* Unlock a remote system. */
@@ -42,7 +58,5 @@ boolean
fsysdep_unlock_system (qsys)
const struct uuconf_system *qsys;
{
- char ab[LOCKNAMELEN];
-
- return fsdo_unlock (zssys_lock_name (qsys, ab), FALSE);
+ return fslock_sys (FALSE, qsys->uuconf_zname);
}
diff --git a/gnu/libexec/uucp/libunix/locfil.c b/gnu/libexec/uucp/libunix/locfil.c
index 4e0a5f9..47581cf 100644
--- a/gnu/libexec/uucp/libunix/locfil.c
+++ b/gnu/libexec/uucp/libunix/locfil.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -77,7 +77,7 @@ zsysdep_local_file (zfile, zpubdir, pfbadname)
zcopy = zbufalc (cuserlen + 1);
memcpy (zcopy, zfile, cuserlen);
zcopy[cuserlen] = '\0';
-
+
q = getpwnam (zcopy);
if (q == NULL)
{
diff --git a/gnu/libexec/uucp/libunix/lock.c b/gnu/libexec/uucp/libunix/lock.c
index ad52af8..1be6fbc 100644
--- a/gnu/libexec/uucp/libunix/lock.c
+++ b/gnu/libexec/uucp/libunix/lock.c
@@ -1,7 +1,7 @@
/* lock.c
Lock and unlock a file name.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char lock_rcsid[] = "$Id: lock.c,v 1.2 1994/05/07 18:10:40 ache Exp $";
+const char lock_rcsid[] = "$Id: lock.c,v 1.20 1995/06/21 19:19:38 ian Rel $";
#endif
#include "uudefs.h"
@@ -34,6 +34,7 @@ const char lock_rcsid[] = "$Id: lock.c,v 1.2 1994/05/07 18:10:40 ache Exp $";
#include "system.h"
#include <errno.h>
+#include <ctype.h>
#if HAVE_FCNTL_H
#include <fcntl.h>
@@ -178,7 +179,7 @@ fsdo_lock (zlock, fspooldir, pferr)
}
#if HAVE_QNX_LOCKFILES
- sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inid);
+ sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inme);
cwrote = write (o, ab, strlen (ab));
#else
#if HAVE_V2_LOCKFILES
@@ -274,6 +275,25 @@ fsdo_lock (zlock, fspooldir, pferr)
break;
}
+#if DEBUG > 0
+#if HAVE_V2_LOCKFILES
+ {
+ char ab[10];
+
+ if (read (o, ab, sizeof ab) > 4
+ && isdigit (BUCHAR (ab[0])))
+ ulog (LOG_ERROR,
+ "Lock file %s may be HDB format; check LOCKFILES in policy.h",
+ zpath);
+ }
+#else
+ if (cgot == 4)
+ ulog (LOG_ERROR,
+ "Lock file %s may be V2 format; check LOCKFILES in policy.h",
+ zpath);
+#endif
+#endif /* DEBUG > 0 */
+
#if HAVE_QNX_LOCKFILES
ab[cgot] = '\0';
ipid = (pid_t) strtol (ab, &zend, 10);
@@ -308,17 +328,23 @@ fsdo_lock (zlock, fspooldir, pferr)
}
}
+ /* If the lock file is empty (cgot == 0), we assume that it is
+ stale. This can happen if the system crashed after the lock
+ file was created but before the process ID was written out. */
+ if (cgot > 0)
+ {
#if HAVE_QNX_LOCKFILES
- if (! fsqnx_stale ((unsigned long) ipid, (unsigned long) inme,
- (unsigned long) inid, pferr))
- break;
+ if (! fsqnx_stale ((unsigned long) ipid, (unsigned long) inme,
+ (unsigned long) inid, pferr))
+ break;
#else
- /* If the process still exists, we will get EPERM rather than
- ESRCH. We then return FALSE to indicate that we cannot make
- the lock. */
- if (kill (ipid, 0) == 0 || errno == EPERM)
- break;
+ /* If the process still exists, we will get EPERM rather
+ than ESRCH. We then return FALSE to indicate that we
+ cannot make the lock. */
+ if (kill (ipid, 0) == 0 || errno == EPERM)
+ break;
#endif
+ }
if (fstat (o, &st) < 0)
strcpy (abtime, "unknown");
@@ -411,7 +437,7 @@ fsdo_lock (zlock, fspooldir, pferr)
}
#if HAVE_QNX_LOCKFILES
- sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inid);
+ sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inme);
cwrote = write (o, ab, strlen (ab));
#else
#if HAVE_V2_LOCKFILES
@@ -620,7 +646,7 @@ fsqnx_stale (ipid, inme, inid, pferr)
/* Use the local pid of the local process manager. */
ivid = PROC_PID;
}
-
+
/* Request the process information. */
ifound_pid = qnx_psinfo (ivid /* process manager handling request */,
ipid /* get info on this process */,
@@ -636,7 +662,7 @@ fsqnx_stale (ipid, inme, inid, pferr)
strerror (errno));
errno = isaved_errno;
}
-
+
/* If the returned pid matches then the process still holds the lock. */
if ((ifound_pid == ipid) && (spsdata.pid == ipid))
return FALSE;
diff --git a/gnu/libexec/uucp/libunix/mail.c b/gnu/libexec/uucp/libunix/mail.c
index e1fbaa9..634a593 100644
--- a/gnu/libexec/uucp/libunix/mail.c
+++ b/gnu/libexec/uucp/libunix/mail.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/mkdirs.c b/gnu/libexec/uucp/libunix/mkdirs.c
index 9b5b23f..df4f987 100644
--- a/gnu/libexec/uucp/libunix/mkdirs.c
+++ b/gnu/libexec/uucp/libunix/mkdirs.c
@@ -28,9 +28,18 @@ fsysdep_make_dirs (zfile, fpublic)
{
if (*z == '/' && z != zcopy)
{
+ /* Some versions of uuto will send a double slash. Some
+ systems will fail to create a directory ending in a
+ slash. */
+ if (z[-1] == '/')
+ continue;
*z = '\0';
if (mkdir (zcopy, imode) != 0
&& errno != EEXIST
+ && errno != EISDIR
+#ifdef EROFS
+ && errno != EROFS
+#endif
&& (errno != EACCES || ! fsysdep_directory (zcopy)))
{
ulog (LOG_ERROR, "mkdir (%s): %s", zcopy,
@@ -38,10 +47,7 @@ fsysdep_make_dirs (zfile, fpublic)
ubuffree (zcopy);
return FALSE;
}
- *z = '/'; /* replace '/' in its place */
- /* now skips over multiple '/' in name */
- while ( (*(z + 1)) && (*(z + 1)) == '/')
- z++;
+ *z = '/';
}
}
diff --git a/gnu/libexec/uucp/libunix/move.c b/gnu/libexec/uucp/libunix/move.c
index 3345bbf..19828c2 100644
--- a/gnu/libexec/uucp/libunix/move.c
+++ b/gnu/libexec/uucp/libunix/move.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -152,7 +152,7 @@ fsysdep_move_file (zorig, zto, fmkdirs, fpublic, fcheck, zuser)
}
(void) close (o);
- if (! fcopy_file (zorig, zto, fpublic, fmkdirs))
+ if (! fcopy_file (zorig, zto, fpublic, fmkdirs, FALSE))
return FALSE;
if (remove (zorig) != 0)
diff --git a/gnu/libexec/uucp/libunix/opensr.c b/gnu/libexec/uucp/libunix/opensr.c
index c9e531a..5217741 100644
--- a/gnu/libexec/uucp/libunix/opensr.c
+++ b/gnu/libexec/uucp/libunix/opensr.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -75,7 +75,7 @@ esysdep_open_send (qsys, zfile, fcheck, zuser)
struct stat s;
openfile_t e;
int o;
-
+
if (fsysdep_directory (zfile))
{
ulog (LOG_ERROR, "%s: is a directory", zfile);
@@ -148,7 +148,7 @@ zsysdep_receive_temp (qsys, zto, ztemp, frestart)
return zsappend3 (".Temp", qsys->uuconf_zname, ztemp);
else
return zstemp_file (qsys);
-}
+}
/* The number of seconds in one week. We must cast to long for this
to be calculated correctly on a machine with 16 bit ints. */
diff --git a/gnu/libexec/uucp/libunix/pause.c b/gnu/libexec/uucp/libunix/pause.c
index 8155db3..8b2b698 100644
--- a/gnu/libexec/uucp/libunix/pause.c
+++ b/gnu/libexec/uucp/libunix/pause.c
@@ -7,27 +7,29 @@
#include "system.h"
/* Pick a timing routine to use. I somewhat arbitrarily picked usleep
- above nap above napms above poll above select. */
-#if HAVE_USLEEP || HAVE_NAP || HAVE_NAPMS || HAVE_POLL
+ above napms above poll above select above nap. The nap function is
+ last because on different systems the argument has different
+ meanings. */
+#if HAVE_USLEEP || HAVE_NAPMS || HAVE_POLL || HAVE_SELECT
+#undef HAVE_NAP
+#define HAVE_NAP 0
+#endif
+
+#if HAVE_USLEEP || HAVE_NAPMS || HAVE_POLL
#undef HAVE_SELECT
#define HAVE_SELECT 0
#endif
-#if HAVE_USLEEP || HAVE_NAP || HAVE_NAPMS
+#if HAVE_USLEEP || HAVE_NAPMS
#undef HAVE_POLL
#define HAVE_POLL 0
#endif
-#if HAVE_USLEEP || HAVE_NAP
+#if HAVE_USLEEP
#undef HAVE_NAPMS
#define HAVE_NAPMS 0
#endif
-#if HAVE_USLEEP
-#undef HAVE_NAP
-#define HAVE_NAP 0
-#endif
-
#if HAVE_SELECT
#if HAVE_SYS_TIME_H
#include <sys/time.h>
@@ -81,6 +83,7 @@ usysdep_pause ()
/* We need to pass an unused pollfd structure because poll checks
the address before checking the number of elements. */
+ memset (&sdummy, 0, sizeof sdummy);
poll (&sdummy, 0, 500);
#endif /* HAVE_POLL */
#if HAVE_SELECT
diff --git a/gnu/libexec/uucp/libunix/picksb.c b/gnu/libexec/uucp/libunix/picksb.c
index 25b1c4e..43a0b2a 100644
--- a/gnu/libexec/uucp/libunix/picksb.c
+++ b/gnu/libexec/uucp/libunix/picksb.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char picksb_rcsid[] = "$Id: picksb.c,v 1.2 1994/05/07 18:10:54 ache Exp $";
+const char picksb_rcsid[] = "$Id: picksb.c,v 1.10 1995/06/21 19:19:54 ian Rel $";
#endif
#include "uudefs.h"
@@ -219,7 +219,7 @@ zsysdep_uupick_local_file (zfile, pfbadname)
if (zfile[0] != '~'
|| (zfile[1] != '/' && zfile[1] != '\0'))
return zsysdep_local_file_cwd (zfile, (const char *) NULL, pfbadname);
-
+
q = getpwuid (getuid ());
if (q == NULL)
{
diff --git a/gnu/libexec/uucp/libunix/pipe.c b/gnu/libexec/uucp/libunix/pipe.c
index 69763f6..7f69040 100644
--- a/gnu/libexec/uucp/libunix/pipe.c
+++ b/gnu/libexec/uucp/libunix/pipe.c
@@ -18,16 +18,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char pipe_rcsid[] = "$Id: pipe.c,v 1.4 1994/03/25 04:09:30 ian Rel $";
+const char pipe_rcsid[] = "$Id: pipe.c,v 1.6 1995/06/21 19:19:57 ian Rel $";
#endif
#include "uudefs.h"
diff --git a/gnu/libexec/uucp/libunix/proctm.c b/gnu/libexec/uucp/libunix/proctm.c
index b9b6eb9..912b11b 100644
--- a/gnu/libexec/uucp/libunix/proctm.c
+++ b/gnu/libexec/uucp/libunix/proctm.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/recep.c b/gnu/libexec/uucp/libunix/recep.c
index 152fd0d..a1f893d 100644
--- a/gnu/libexec/uucp/libunix/recep.c
+++ b/gnu/libexec/uucp/libunix/recep.c
@@ -1,7 +1,7 @@
/* recep.c
See whether a file has already been received.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -50,7 +50,7 @@ static char *zsreceived_name P((const struct uuconf_system *qsys,
/* These routines are used to see whether we have already received a
file in a previous UUCP connection. It is possible for the
acknowledgement of a received file to be lost. The sending system
- will then now know that the file was correctly received, and will
+ will then not know that the file was correctly received, and will
send it again. This can be a problem particularly with protocols
which support channels, since they may send several small files in
a single window, all of which may be received correctly although
diff --git a/gnu/libexec/uucp/libunix/run.c b/gnu/libexec/uucp/libunix/run.c
index af9b078..d789d37 100644
--- a/gnu/libexec/uucp/libunix/run.c
+++ b/gnu/libexec/uucp/libunix/run.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/seq.c b/gnu/libexec/uucp/libunix/seq.c
index bd2cef8..321ed74 100644
--- a/gnu/libexec/uucp/libunix/seq.c
+++ b/gnu/libexec/uucp/libunix/seq.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -68,7 +68,7 @@ ixsysdep_get_sequence (qsys)
ubuffree (zname);
return -1;
}
-
+
e = fopen (zname, "r+");
if (e == NULL)
{
diff --git a/gnu/libexec/uucp/libunix/serial.c b/gnu/libexec/uucp/libunix/serial.c
index ae0a943..a38e28c 100644
--- a/gnu/libexec/uucp/libunix/serial.c
+++ b/gnu/libexec/uucp/libunix/serial.c
@@ -1,7 +1,7 @@
/* serial.c
The serial port communication routines for Unix.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char serial_rcsid[] = "$Id: serial.c,v 1.4 1994/05/07 18:11:09 ache Exp $";
+const char serial_rcsid[] = "$Id: serial.c,v 1.65 1995/08/10 00:53:54 ian Rel $";
#endif
#include "uudefs.h"
@@ -82,7 +82,7 @@ const char serial_rcsid[] = "$Id: serial.c,v 1.4 1994/05/07 18:11:09 ache Exp $"
#include <sys/ioctl.h>
#endif
-#if HAVE_BSD_TTY
+#if HAVE_SELECT
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -92,7 +92,7 @@ const char serial_rcsid[] = "$Id: serial.c,v 1.4 1994/05/07 18:11:09 ache Exp $"
#endif
#if HAVE_TIME_H
-#if ! HAVE_SYS_TIME_H || ! HAVE_BSD_TTY || TIME_WITH_SYS_TIME
+#if ! HAVE_SYS_TIME_H || ! HAVE_SELECT || TIME_WITH_SYS_TIME
#include <time.h>
#endif
#endif
@@ -517,6 +517,9 @@ boolean
fsysdep_stdin_init (qconn)
struct sconnection *qconn;
{
+ /* chmod /dev/tty to prevent other users from writing messages to
+ it. This is essentially `mesg n'. */
+ (void) chmod ("/dev/tty", S_IRUSR | S_IWUSR);
return fsserial_init (qconn, &sstdincmds, (const char *) NULL);
}
@@ -647,7 +650,7 @@ fsserial_lockfile (flok, qconn)
strerror (errno));
return FALSE;
}
- zalc = zbufalc (sizeof "LK.123.123.123");
+ zalc = zbufalc (sizeof "LK.1234567890.1234567890.1234567890");
sprintf (zalc, "LK.%03d.%03d.%03d", major (s.st_dev),
major (s.st_rdev), minor (s.st_rdev));
z = zalc;
@@ -860,7 +863,7 @@ fsserial_unlock (qconn)
}
qsysdep->o = -1;
}
-
+
if (! fsserial_lockfile (FALSE, qconn))
fret = FALSE;
@@ -1748,7 +1751,7 @@ fsmodem_carrier (qconn, fcarrier)
return FALSE;
#ifdef TIOCNCAR
- /* Tell the modem to ignore carrier. */
+ /* Tell the modem to ignore carrier. */
if (ioctl (q->o, TIOCNCAR, 0) < 0)
{
ulog (LOG_ERROR, "ioctl (TIOCNCAR): %s", strerror (errno));
@@ -1782,19 +1785,19 @@ fsmodem_carrier (qconn, fcarrier)
ulog (LOG_ERROR, "Can't set CLOCAL: %s", strerror (errno));
return FALSE;
}
-
+
#if HAVE_CLOCAL_BUG
/* On SCO and AT&T UNIX PC you have to reopen the port. */
{
int onew;
-
+
onew = open (q->zdevice, O_RDWR);
if (onew < 0)
{
ulog (LOG_ERROR, "open (%s): %s", q->zdevice, strerror (errno));
return FALSE;
}
-
+
if (fcntl (onew, F_SETFD,
fcntl (onew, F_GETFD, 0) | FD_CLOEXEC) < 0)
{
@@ -1817,8 +1820,9 @@ fsmodem_carrier (qconn, fcarrier)
/* Tell the port to use hardware flow control. There is no standard
mechanism for controlling this. This implementation supports
CRTSCTS on SunOS, RTS/CTSFLOW on 386(ish) unix, CTSCD on the 3b1,
- and TXADDCD/TXDELCD on AIX. If you know how to do it on other
- systems, please implement it and send me the patches. */
+ CCTS_OFLOW/CRTS_IFLOW on BSDI, TXADDCD/TXDELCD on AIX, and IRTS on
+ NCR Tower. If you know how to do it on other systems, please
+ implement it and send me the patches. */
static boolean
fsserial_hardflow (qconn, fhardflow)
@@ -1841,12 +1845,16 @@ fsserial_hardflow (qconn, fhardflow)
#ifndef CRTSFL
#ifndef CRTSCTS
#ifndef CTSCD
+#ifndef CCTS_OFLOW
+#ifndef IRTS
#define HAVE_HARDFLOW 0
#endif
#endif
#endif
#endif
#endif
+#endif
+#endif
#ifndef HAVE_HARDFLOW
#define HAVE_HARDFLOW 1
@@ -1871,6 +1879,12 @@ fsserial_hardflow (qconn, fhardflow)
#ifdef CTSCD
q->snew.c_cflag |= CTSCD;
#endif /* defined (CTSCD) */
+#ifdef CCTS_OFLOW
+ q->snew.c_cflag |= CCTS_OFLOW | CRTS_IFLOW;
+#endif
+#ifdef IRTS
+ q->snew.c_iflag |= IRTS;
+#endif
#endif /* HAVE_SYSV_TERMIO || HAVE_POSIX_TERMIOS */
if (! fsetterminfo (q->o, &q->snew))
{
@@ -1898,6 +1912,12 @@ fsserial_hardflow (qconn, fhardflow)
#ifdef CTSCD
q->snew.c_cflag &=~ CTSCD;
#endif /* defined (CTSCD) */
+#ifdef CCTS_OFLOW
+ q->snew.c_cflag &=~ (CCTS_OFLOW | CRTS_IFLOW);
+#endif
+#ifdef IRTS
+ q->snew.c_iflag &=~ IRTS;
+#endif
#endif /* HAVE_SYSV_TERMIO || HAVE_POSIX_TERMIOS */
if (! fsetterminfo (q->o, &q->snew))
{
@@ -2001,7 +2021,7 @@ fsysdep_modem_end_dial (qconn, qdial)
errors. */
{
int onew;
-
+
onew = open (q->zdevice, O_RDWR);
if (onew >= 0)
{
@@ -2039,7 +2059,7 @@ fsysdep_modem_end_dial (qconn, qdial)
#endif /* ! defined (TIOCWONLINE) */
}
- return TRUE;
+ return TRUE;
}
/* Read data from a connection, with a timeout. This routine handles
@@ -2562,7 +2582,10 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
write up to SINGLE_WRITE bytes
if all data written, return
if no data written
- blocked write of up to SINGLE_WRITE bytes
+ if select works
+ select on the write descriptor with a ten second timeout
+ else
+ blocked write of one byte with a ten second alarm
This algorithm should work whether the system supports
unblocked writes on terminals or not. If the system supports
@@ -2572,7 +2595,28 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
then the write may hang so long that incoming data is lost.
This is actually possible at high baud rates on any system
when a blocking write is done; there is no solution, except
- hardware handshaking. */
+ hardware handshaking.
+
+ If we were not able to write any data, then we need to block
+ until we can write something. The code used to simply do a
+ blocking write. However, that fails when a bidirectional
+ protocol is permitted to push out enough bytes to fill the
+ entire pipe between the two communicating uucico processes.
+ They can both block on writing, because neither is reading.
+
+ In this case, we use select. We could select on both the
+ read and write descriptor, but on some systems that would
+ lead to calling read on each byte, which would be very
+ inefficient. Instead, we select only on the write
+ descriptor. After the select succeeds or times out, we retry
+ the read.
+
+ Of course, some systems don't have select, and on some
+ systems that have it it doesn't work on terminal devices. If
+ we can't use select, then we do a blocked write of a single
+ byte after setting an alarm. We only write a single byte to
+ avoid any confusion as to whether or not the byte was
+ actually written. */
/* If we are running on standard input, we switch the file
descriptors by hand. */
@@ -2717,38 +2761,105 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
}
else
{
- /* We didn't write any data. Do a blocking write. */
-
- if (q->ord >= 0)
- q->o = q->ord;
+#if HAVE_SELECT
+ struct timeval stime;
+ int imask;
+ int c;
+
+ /* We didn't write any data. Call select. We use a timeout
+ long enough for 1024 bytes to be sent.
+ secs/kbyte == (1024 bytes/kbyte * 10 bits/byte) / baud bits/sec
+ usecs/kbyte == (((1024 bytes/kbyte * 1000000 usecs/sec)
+ / baud bits/sec)
+ * 10 bits/byte)
+ */
+ stime.tv_sec = (long) 10240 / q->ibaud;
+ stime.tv_usec = ((((long) 1024000000 / q->ibaud) * (long) 10)
+ % (long) 1000000);
+
+ imask = 1 << q->o;
+ if (imask == 0)
+ ulog (LOG_FATAL, "fsysdep_conn_io: File descriptors too large");
- if (! fsblock (q, TRUE))
+ /* If we've received a signal, don't continue. */
+ if (FGOT_QUIT_SIGNAL ())
return FALSE;
- cdo = cwrite;
- if (cdo > SINGLE_WRITE)
- cdo = SINGLE_WRITE;
+ DEBUG_MESSAGE0 (DEBUG_PORT, "fsysdep_conn_io: Calling select");
- DEBUG_MESSAGE1 (DEBUG_PORT,
- "fsysdep_conn_io: Blocking write of %lu",
- (unsigned long) cdo);
+ /* We don't bother to loop on EINTR. If we get a signal, we
+ just loop around and try the read and write again. */
+ c = select (q->o + 1, (pointer) NULL, (pointer) &imask,
+ (pointer) NULL, &stime);
+ if (c < 0 && errno == EINTR)
+ {
+ /* We got interrupted by a signal. Log it. */
+ ulog (LOG_ERROR, (const char *) NULL);
+ }
+ else if (c >= 0)
+ {
+ /* The select either discovered that we could write
+ something, or it timed out. Either way, we go around
+ the main read/write loop again. */
+ }
+ else
+#endif /* HAVE_SELECT */
+ {
+ int ierr;
- if (q->owr >= 0)
- q->o = q->owr;
+ /* Either the select failed for some reason other than
+ EINTR, or the system does not support select at all.
+ Fall back on a timed write. We don't worry about why
+ the select might have failed, we just assume that it
+ will not succeed on this descriptor. */
+
+#if HAVE_RESTARTABLE_SYSCALLS
+ /* If HAVE_RESTARTABLE_SYSCALLS, then receiving an alarm
+ signal in the middle of a write will not cause the
+ write to return EINTR, and the only way to interrupt
+ the write is to longjmp out of it (see sysh.unx).
+ That is unreliable, because it means that we won't
+ know whether the byte was actually written or not.
+ However, I believe that the only system on which we
+ need to do this longjmp is BSD 4.2, and that system
+ supports select, so we should never execute this
+ case. */
+ ulog (LOG_FATAL, "fsysdep_conn_io: Unsupported case; see code");
+#endif
+
+ if (q->ord >= 0)
+ q->o = q->ord;
+
+ if (! fsblock (q, TRUE))
+ return FALSE;
+
+ DEBUG_MESSAGE0 (DEBUG_PORT, "fsysdep_conn_io: Blocking write");
+
+ if (q->owr >= 0)
+ q->o = q->owr;
- /* Loop until we get something besides EINTR. */
- while (TRUE)
- {
/* If we've received a signal, don't continue. */
if (FGOT_QUIT_SIGNAL ())
return FALSE;
+ /* Start up an alarm to interrupt the write. Note that
+ we don't need to use the catch stuff, since we know
+ that HAVE_RESTARTABLE_SYSCALLS is 0. */
+ usset_signal (SIGALRM, usalarm, TRUE, (boolean *) NULL);
+ alarm ((int) ((long) 10240 / q->ibaud) + 1);
+
+ /* There is a race condition here: on a severely loaded
+ system, we could get the alarm before we start the
+ write call. This would not be a disaster; often the
+ write will succeed anyhow. */
#if HAVE_TLI
if (q->ftli)
{
- cdid = t_snd (q->o, (char *) zwrite, cdo, 0);
+ cdid = t_snd (q->o, (char *) zwrite, 1, 0);
if (cdid < 0 && t_errno != TSYSERR)
{
+ usset_signal (SIGALRM, SIG_IGN, TRUE, (boolean *) NULL);
+ alarm (0);
ulog (LOG_ERROR, "t_snd: %s",
(t_errno >= 0 && t_errno < t_nerr
? t_errlist[t_errno]
@@ -2758,44 +2869,54 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
}
else
#endif
- cdid = write (q->o, zwrite, cdo);
+ cdid = write (q->o, zwrite, 1);
- if (cdid >= 0)
- break;
- if (errno != EINTR)
- break;
+ ierr = errno;
- /* We got interrupted by a signal. Log it. */
- ulog (LOG_ERROR, (const char *) NULL);
- }
+ /* Note that we don't really care whether the write
+ finished because the byte was written out or whether
+ it finished because the alarm was triggered. Either
+ way, we are going to loop around and try another
+ read. */
- if (cdid < 0)
- {
- ulog (LOG_ERROR, "write: %s", strerror (errno));
- return FALSE;
- }
+ usset_signal (SIGALRM, SIG_IGN, TRUE, (boolean *) NULL);
+ alarm (0);
- if (cdid == 0)
- {
- /* On some systems write will return 0 if carrier is
- lost. If we fail to write anything ten times in a
- row, we assume that this has happened. This is
- hacked in like this because there seems to be no
- reliable way to tell exactly why the write returned
- 0. */
- ++czero;
- if (czero >= 10)
+ if (cdid < 0)
{
- ulog (LOG_ERROR, "Line disconnected");
- return FALSE;
+ if (ierr == EINTR)
+ {
+ /* We got interrupted by a signal. Log it. */
+ ulog (LOG_ERROR, (const char *) NULL);
+ }
+ else
+ {
+ ulog (LOG_ERROR, "write: %s", strerror (ierr));
+ return FALSE;
+ }
+ }
+ else if (cdid == 0)
+ {
+ /* On some systems write will return 0 if carrier is
+ lost. If we fail to write anything ten times in
+ a row, we assume that this has happened. This is
+ hacked in like this because there seems to be no
+ reliable way to tell exactly why the write
+ returned 0. */
+ ++czero;
+ if (czero >= 10)
+ {
+ ulog (LOG_ERROR, "Line disconnected");
+ return FALSE;
+ }
+ }
+ else
+ {
+ cwrite -= cdid;
+ zwrite += cdid;
+ *pcwrite += cdid;
+ czero = 0;
}
- }
- else
- {
- cwrite -= cdid;
- zwrite += cdid;
- *pcwrite += cdid;
- czero = 0;
}
}
}
@@ -2937,7 +3058,7 @@ fsserial_set (qconn, tparity, tstrip, txonxoff)
/* Not supported. */
break;
}
-
+
if (fdo)
{
if ((q->snew.c_cflag & iset) != iset
@@ -2973,7 +3094,7 @@ fsserial_set (qconn, tparity, tstrip, txonxoff)
}
#endif
-#else /* ! HAVE_BSD_TTY */
+#else /* ! HAVE_BSD_TTY */
fdo = FALSE;
switch (tstrip)
diff --git a/gnu/libexec/uucp/libunix/signal.c b/gnu/libexec/uucp/libunix/signal.c
index 75016c3..6aa899b 100644
--- a/gnu/libexec/uucp/libunix/signal.c
+++ b/gnu/libexec/uucp/libunix/signal.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/spawn.c b/gnu/libexec/uucp/libunix/spawn.c
index a56fd84..d39e2ba 100644
--- a/gnu/libexec/uucp/libunix/spawn.c
+++ b/gnu/libexec/uucp/libunix/spawn.c
@@ -1,7 +1,7 @@
/* spawn.c
Spawn a program securely.
- Copyright (C) 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -147,7 +147,7 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
zspace = azenv[0] + sizeof "PATH=" - 1;
while ((zspace = strchr (zspace, ' ')) != NULL)
*zspace = ':';
-
+
azenv[1] = zbufalc (sizeof "HOME=" + strlen (zSspooldir));
sprintf (azenv[1], "HOME=%s", zSspooldir);
@@ -158,7 +158,7 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
sprintf (azenv[2], "TERM=%s", zterm);
azenv[3] = zbufcpy ("SHELL=/bin/sh");
-
+
azenv[4] = zbufalc (sizeof "USER=" + strlen (OWNER));
sprintf (azenv[4], "USER=%s", OWNER);
@@ -275,7 +275,7 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
ierr = errno;
ferr = TRUE;
break;
- }
+ }
}
}
@@ -360,12 +360,22 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
{
/* Try to force the UUCP uid to be both real and effective user
ID, in order to present a consistent environment regardless
- of the invoking user. This won't work on System V based
- systems, but it will do no harm. It would be possible to use
- a setuid root program to force the UID setting, but I don't
- think the efficiency loss is worth it. */
+ of the invoking user. This won't work on older System V
+ based systems, where it can cause trouble if ordinary users
+ wind up executing uuxqt, perhaps via uucico; any program
+ which uuxqt executes will have an arbitrary real user ID, so
+ if the program is itself a setuid program, any security
+ checks it does based on the real user ID will be incorrect.
+ Fixing this problem would seem to require a special setuid
+ root program; I have not used this approach because
+ modern systems should not suffer from it. */
+#if HAVE_SETREUID
+ (void) setreuid (geteuid (), -1);
+ (void) setregid (getegid (), -1);
+#else
(void) setuid (geteuid ());
(void) setgid (getegid ());
+#endif
}
if (zchdir != NULL)
@@ -406,7 +416,7 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
{
char *zto;
const char *azshargs[4];
-
+
pazargs[0] = zcmd;
zto = zshcmd;
for (i = 0; pazargs[i] != NULL; i++)
diff --git a/gnu/libexec/uucp/libunix/splcmd.c b/gnu/libexec/uucp/libunix/splcmd.c
index 7740661..d085cee 100644
--- a/gnu/libexec/uucp/libunix/splcmd.c
+++ b/gnu/libexec/uucp/libunix/splcmd.c
@@ -1,7 +1,7 @@
/* splcmd.c
Spool a command.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -104,31 +104,53 @@ zsysdep_spool_commands (qsys, bgrade, ccmds, pascmds)
}
}
- if (fclose (e) != 0)
+ if (! fstdiosync (e, ztemp))
{
- ulog (LOG_ERROR, "fclose: %s", strerror (errno));
+ (void) fclose (e);
(void) remove (ztemp);
ubuffree (ztemp);
return NULL;
}
- z = zscmd_file (qsys, bgrade);
- if (z == NULL)
+ if (fclose (e) != 0)
{
+ ulog (LOG_ERROR, "fclose: %s", strerror (errno));
(void) remove (ztemp);
ubuffree (ztemp);
return NULL;
}
- if (! fsysdep_move_file (ztemp, z, FALSE, FALSE, FALSE,
- (const char *) NULL))
+ /* The filename returned by zscmd_file is subject to some unlikely
+ race conditions, so keep trying the link until the destination
+ file does not already exist. Each call to zscmd_file should
+ return a file name which does not already exist, so we don't have
+ to do anything special before calling it again. */
+ while (TRUE)
{
- (void) remove (ztemp);
- ubuffree (ztemp);
+ z = zscmd_file (qsys, bgrade);
+ if (z == NULL)
+ {
+ (void) remove (ztemp);
+ ubuffree (ztemp);
+ return NULL;
+ }
+
+ if (link (ztemp, z) >= 0)
+ break;
+
+ if (errno != EEXIST)
+ {
+ ulog (LOG_ERROR, "link (%s, %s): %s", ztemp, z, strerror (errno));
+ (void) remove (ztemp);
+ ubuffree (ztemp);
+ ubuffree (z);
+ return NULL;
+ }
+
ubuffree (z);
- return NULL;
}
+ (void) remove (ztemp);
ubuffree (ztemp);
zjobid = zsfile_to_jobid (qsys, z, bgrade);
diff --git a/gnu/libexec/uucp/libunix/spool.c b/gnu/libexec/uucp/libunix/spool.c
index 4eb3702..8c0a82f 100644
--- a/gnu/libexec/uucp/libunix/spool.c
+++ b/gnu/libexec/uucp/libunix/spool.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char spool_rcsid[] = "$Id: spool.c,v 1.2 1994/05/07 18:11:24 ache Exp $";
+const char spool_rcsid[] = "$Id: spool.c,v 1.11 1995/06/30 21:22:54 ian Rel $";
#endif
#include "uudefs.h"
@@ -41,7 +41,7 @@ const char spool_rcsid[] = "$Id: spool.c,v 1.2 1994/05/07 18:11:24 ache Exp $";
Command files
These contain instructions for uucico indicating what files to transfer
to and from what systems. Each line of a work file is a command
- beginning with S, R or X.
+ beginning with S, R, X, or E.
#if ! SPOOLDIR_TAYLOR
They are named C.ssssssgqqqq, where ssssss is the system name to
transfer to or from, g is the grade and qqqq is the sequence number.
@@ -55,15 +55,17 @@ const char spool_rcsid[] = "$Id: spool.c,v 1.2 1994/05/07 18:11:24 ache Exp $";
#elif SPOOLDIR_ULTRIX
If the directory sys/ssssss exists, they are put in the directory
sys/ssssss/C; otherwise, they are put in the directory sys/DEFAULT/C.
- #endif
#elif SPOOLDIR_SVR4
They are put in the directory sys/g, where sys is the system name
and g is the grade.
#endif
#else SPOOLDIR_TAYLOR
- They are named C.gqqqq, where g is the grade and qqqq is the sequence
- number, and are placed in the directory ssssss/C. where ssssss is
- the system name to transfer to or from.
+ They are named C.gqqqq, where g is the grade and qqqq is the
+ sequence number, and are placed in the directory ssssss/C. where
+ ssssss is the system name to transfer to or from. The sequence
+ number for a C. file is actually a long string; it is not based on
+ the sequence number file, but is generated via a process which
+ attempts to produce a unique string each time it is run.
#endif
Data files
@@ -287,7 +289,7 @@ zsfind_file (zsimple, zsystem, bgrade)
{
size_t c;
boolean ftruncated;
-
+
/* D.LOCAL in D.LOCAL/, others in D./. If BSD43, D.LOCALX in
D.LOCALX/. */
ftruncated = TRUE;
@@ -336,7 +338,7 @@ zsfind_file (zsimple, zsystem, bgrade)
char *zfree;
const char *zdir;
char *zret;
-
+
/* D.LOCALX in D.LOCALX/, D.LOCAL in D.LOCAL/, others in D./. */
ftruncated = TRUE;
if (strncmp (zsimple + 2, zSlocalname, strlen (zSlocalname)) == 0)
@@ -380,7 +382,7 @@ zsfind_file (zsimple, zsystem, bgrade)
zfree = NULL;
zdir = "D.";
}
-
+
zret = zsappend4 ("sys",
(fsultrix_has_spool (zsystem)
? zsystem
diff --git a/gnu/libexec/uucp/libunix/srmdir.c b/gnu/libexec/uucp/libunix/srmdir.c
index 7dcaa07..e143cdf 100644
--- a/gnu/libexec/uucp/libunix/srmdir.c
+++ b/gnu/libexec/uucp/libunix/srmdir.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -69,7 +69,7 @@ fsysdep_rmdir (zdir)
while (q != NULL)
{
struct sdirlist *qnext;
-
+
if (rmdir (q->zdir) != 0)
{
ulog (LOG_ERROR, "rmdir (%s): %s", q->zdir, strerror (errno));
diff --git a/gnu/libexec/uucp/libunix/statsb.c b/gnu/libexec/uucp/libunix/statsb.c
index a57d2a3..4fed437 100644
--- a/gnu/libexec/uucp/libunix/statsb.c
+++ b/gnu/libexec/uucp/libunix/statsb.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char statsb_rcsid[] = "$Id: statsb.c,v 1.17 1994/04/10 22:06:10 ian Rel $";
+const char statsb_rcsid[] = "$Id: statsb.c,v 1.19 1995/06/21 19:20:39 ian Rel $";
#endif
#include "uudefs.h"
diff --git a/gnu/libexec/uucp/libunix/status.c b/gnu/libexec/uucp/libunix/status.c
index a967085..66e1d385 100644
--- a/gnu/libexec/uucp/libunix/status.c
+++ b/gnu/libexec/uucp/libunix/status.c
@@ -1,7 +1,7 @@
/* status.c
Routines to get and set the status for a system.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -31,6 +31,7 @@
#include "system.h"
#include <errno.h>
+#include <ctype.h>
#if SPOOLDIR_HDB || SPOOLDIR_SVR4
@@ -104,6 +105,7 @@ fsysdep_get_status (qsys, qret, pfnone)
qret->cretries = 0;
qret->ilast = 0;
qret->cwait = 0;
+ qret->zstring = NULL;
if (pfnone != NULL)
*pfnone = TRUE;
ubuffree (zname);
@@ -157,6 +159,33 @@ fsysdep_get_status (qsys, qret, pfnone)
if (zend == znext)
fbad = TRUE;
+ if (! fbad)
+ {
+ znext = zend;
+ while (isspace (BUCHAR (*znext)))
+ ++znext;
+ if (*znext == '\0')
+ qret->zstring = NULL;
+ else
+ {
+ if (*znext == '"')
+ ++znext;
+ qret->zstring = zbufcpy (znext);
+ zend = qret->zstring + strlen (qret->zstring);
+ while (zend != qret->zstring && *zend != ' ')
+ --zend;
+ if (*zend == '"' && zend != qret->zstring)
+ --zend;
+ if (zend != qret->zstring)
+ *zend = '\0';
+ else
+ {
+ ubuffree (qret->zstring);
+ qret->zstring = NULL;
+ }
+ }
+ }
+
xfree ((pointer) zline);
if (fbad)
@@ -199,9 +228,16 @@ fsysdep_set_status (qsys, qset)
istat = aiMapstatus[istat];
#endif /* MAP_STATUS */
- fprintf (e, "%d %d %ld %d %s %s\n", istat, qset->cretries,
- qset->ilast, qset->cwait, azStatus[(int) qset->ttype],
- qsys->uuconf_zname);
+ fprintf (e, "%d %d %ld %d ", istat, qset->cretries, qset->ilast,
+ qset->cwait);
+
+#if SPOOLDIR_SVR4
+ fprintf (e, "\"%s\"", azStatus[(int) qset->ttype]);
+#else
+ fprintf (e, "%s", azStatus[(int) qset->ttype]);
+#endif
+
+ fprintf (e, " %s\n", qsys->uuconf_zname);
if (fclose (e) != 0)
{
ulog (LOG_ERROR, "fclose: %s", strerror (errno));
diff --git a/gnu/libexec/uucp/libunix/sync.c b/gnu/libexec/uucp/libunix/sync.c
new file mode 100644
index 0000000..c346c58
--- /dev/null
+++ b/gnu/libexec/uucp/libunix/sync.c
@@ -0,0 +1,42 @@
+/* sync.c
+ Sync a file to disk, if FSYNC_ON_CLOSE is set. */
+
+#include "uucp.h"
+
+#include "uudefs.h"
+#include "sysdep.h"
+#include "system.h"
+
+#include <errno.h>
+
+boolean
+fsysdep_sync (e, zmsg)
+ openfile_t e;
+ const char *zmsg;
+{
+ int o;
+
+#if USE_STDIO
+ if (fflush (e) == EOF)
+ {
+ ulog (LOG_ERROR, "%s: fflush: %s", zmsg, strerror (errno));
+ return FALSE;
+ }
+#endif
+
+#if USE_STDIO
+ o = fileno (e);
+#else
+ o = e;
+#endif
+
+#if FSYNC_ON_CLOSE
+ if (fsync (o) < 0)
+ {
+ ulog (LOG_ERROR, "%s: fsync: %s", zmsg, strerror (errno));
+ return FALSE;
+ }
+#endif
+
+ return TRUE;
+}
diff --git a/gnu/libexec/uucp/libunix/tcp.c b/gnu/libexec/uucp/libunix/tcp.c
new file mode 100644
index 0000000..6ec39f2
--- /dev/null
+++ b/gnu/libexec/uucp/libunix/tcp.c
@@ -0,0 +1,444 @@
+/* tcp.c
+ Code to handle TCP connections.
+
+ Copyright (C) 1991, 1992, 1993, 1995 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The author of the program may be contacted at ian@airs.com or
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
+ */
+
+#include "uucp.h"
+
+#if USE_RCS_ID
+const char tcp_rcsid[] = "$Id: tcp.c,v 1.5 1995/06/21 19:20:46 ian Rel $";
+#endif
+
+#if HAVE_TCP
+
+#include "uudefs.h"
+#include "uuconf.h"
+#include "sysdep.h"
+#include "conn.h"
+#include "system.h"
+
+#include <errno.h>
+
+#if HAVE_SYS_TYPES_TCP_H
+#include <sys/types.tcp.h>
+#endif
+#include <sys/socket.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#else
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+#endif
+
+#ifndef FD_CLOEXEC
+#define FD_CLOEXEC 1
+#endif
+
+/* This code handles TCP connections. It assumes a Berkeley socket
+ interface. */
+
+/* The normal "uucp" port number. */
+#define IUUCP_PORT (540)
+
+/* Local functions. */
+static void utcp_free P((struct sconnection *qconn));
+static boolean ftcp_open P((struct sconnection *qconn, long ibaud,
+ boolean fwait));
+static boolean ftcp_close P((struct sconnection *qconn,
+ pointer puuconf,
+ struct uuconf_dialer *qdialer,
+ boolean fsuccess));
+static boolean ftcp_dial P((struct sconnection *qconn, pointer puuconf,
+ const struct uuconf_system *qsys,
+ const char *zphone,
+ struct uuconf_dialer *qdialer,
+ enum tdialerfound *ptdialer));
+static int itcp_port_number P((const char *zport));
+
+/* The command table for a TCP connection. */
+static const struct sconncmds stcpcmds =
+{
+ utcp_free,
+ NULL, /* pflock */
+ NULL, /* pfunlock */
+ ftcp_open,
+ ftcp_close,
+ ftcp_dial,
+ fsysdep_conn_read,
+ fsysdep_conn_write,
+ fsysdep_conn_io,
+ NULL, /* pfbreak */
+ NULL, /* pfset */
+ NULL, /* pfcarrier */
+ fsysdep_conn_chat,
+ NULL /* pibaud */
+};
+
+/* Initialize a TCP connection. */
+
+boolean
+fsysdep_tcp_init (qconn)
+ struct sconnection *qconn;
+{
+ struct ssysdep_conn *q;
+
+ q = (struct ssysdep_conn *) xmalloc (sizeof (struct ssysdep_conn));
+ q->o = -1;
+ q->ord = -1;
+ q->owr = -1;
+ q->zdevice = NULL;
+ q->iflags = -1;
+ q->iwr_flags = -1;
+ q->fterminal = FALSE;
+ q->ftli = FALSE;
+ q->ibaud = 0;
+
+ qconn->psysdep = (pointer) q;
+ qconn->qcmds = &stcpcmds;
+ return TRUE;
+}
+
+/* Free a TCP connection. */
+
+static void
+utcp_free (qconn)
+ struct sconnection *qconn;
+{
+ xfree (qconn->psysdep);
+}
+
+/* Open a TCP connection. If the fwait argument is TRUE, we are
+ running as a server. Otherwise we are just trying to reach another
+ system. */
+
+static boolean
+ftcp_open (qconn, ibaud, fwait)
+ struct sconnection *qconn;
+ long ibaud;
+ boolean fwait;
+{
+ struct ssysdep_conn *qsysdep;
+ struct sockaddr_in s;
+ const char *zport;
+ uid_t ieuid;
+ boolean fswap;
+
+ ulog_device ("TCP");
+
+ qsysdep = (struct ssysdep_conn *) qconn->psysdep;
+
+ qsysdep->o = socket (AF_INET, SOCK_STREAM, 0);
+ if (qsysdep->o < 0)
+ {
+ ulog (LOG_ERROR, "socket: %s", strerror (errno));
+ return FALSE;
+ }
+
+ if (fcntl (qsysdep->o, F_SETFD,
+ fcntl (qsysdep->o, F_GETFD, 0) | FD_CLOEXEC) < 0)
+ {
+ ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
+ (void) close (qsysdep->o);
+ qsysdep->o = -1;
+ return FALSE;
+ }
+
+ qsysdep->iflags = fcntl (qsysdep->o, F_GETFL, 0);
+ if (qsysdep->iflags < 0)
+ {
+ ulog (LOG_ERROR, "fcntl: %s", strerror (errno));
+ (void) close (qsysdep->o);
+ qsysdep->o = -1;
+ return FALSE;
+ }
+
+ /* We save our process ID in the qconn structure. This is checked
+ in ftcp_close. */
+ qsysdep->ipid = getpid ();
+
+ /* If we aren't waiting for a connection, we're done. */
+ if (! fwait)
+ return TRUE;
+
+ /* Run as a server and wait for a new connection. The code in
+ uucico.c has already detached us from our controlling terminal.
+ From this point on if the server gets an error we exit; we only
+ return if we have received a connection. It would be more robust
+ to respawn the server if it fails; someday. */
+ bzero ((pointer) &s, sizeof s);
+ s.sin_family = AF_INET;
+ zport = qconn->qport->uuconf_u.uuconf_stcp.uuconf_zport;
+ s.sin_port = itcp_port_number (zport);
+ s.sin_addr.s_addr = htonl (INADDR_ANY);
+
+ /* Swap to our real user ID when doing the bind call. This will
+ permit the server to use privileged TCP ports when invoked by
+ root. We only swap if our effective user ID is not root, so that
+ the program can also be made suid root in order to get privileged
+ ports when invoked by anybody. */
+ fswap = geteuid () != 0;
+ if (fswap)
+ {
+ if (! fsuser_perms (&ieuid))
+ {
+ (void) close (qsysdep->o);
+ qsysdep->o = -1;
+ return FALSE;
+ }
+ }
+
+ if (bind (qsysdep->o, (struct sockaddr *) &s, sizeof s) < 0)
+ {
+ if (fswap)
+ (void) fsuucp_perms ((long) ieuid);
+ ulog (LOG_FATAL, "bind: %s", strerror (errno));
+ }
+
+ /* Now swap back to the uucp user ID. */
+ if (fswap)
+ {
+ if (! fsuucp_perms ((long) ieuid))
+ ulog (LOG_FATAL, "Could not swap back to UUCP user permissions");
+ }
+
+ if (listen (qsysdep->o, 5) < 0)
+ ulog (LOG_FATAL, "listen: %s", strerror (errno));
+
+ while (! FGOT_SIGNAL ())
+ {
+ size_t clen;
+ int onew;
+ pid_t ipid;
+
+ DEBUG_MESSAGE0 (DEBUG_PORT,
+ "ftcp_open: Waiting for connections");
+
+ clen = sizeof s;
+ onew = accept (qsysdep->o, (struct sockaddr *) &s, &clen);
+ if (onew < 0)
+ ulog (LOG_FATAL, "accept: %s", strerror (errno));
+
+ DEBUG_MESSAGE0 (DEBUG_PORT,
+ "ftcp_open: Got connection; forking");
+
+ ipid = ixsfork ();
+ if (ipid < 0)
+ ulog (LOG_FATAL, "fork: %s", strerror (errno));
+ if (ipid == 0)
+ {
+ (void) close (qsysdep->o);
+ qsysdep->o = onew;
+
+ /* Now we fork and let our parent die, so that we become
+ a child of init. This lets the main server code wait
+ for its child and then continue without accumulating
+ zombie children. */
+ ipid = ixsfork ();
+ if (ipid < 0)
+ {
+ ulog (LOG_ERROR, "fork: %s", strerror (errno));
+ _exit (EXIT_FAILURE);
+ }
+
+ if (ipid != 0)
+ _exit (EXIT_SUCCESS);
+
+ ulog_id (getpid ());
+
+ return TRUE;
+ }
+
+ (void) close (onew);
+
+ /* Now wait for the child. */
+ (void) ixswait ((unsigned long) ipid, (const char *) NULL);
+ }
+
+ /* We got a signal. */
+ usysdep_exit (FALSE);
+
+ /* Avoid compiler warnings. */
+ return FALSE;
+}
+
+/* Close the port. */
+
+/*ARGSUSED*/
+static boolean
+ftcp_close (qconn, puuconf, qdialer, fsuccess)
+ struct sconnection *qconn;
+ pointer puuconf;
+ struct uuconf_dialer *qdialer;
+ boolean fsuccess;
+{
+ struct ssysdep_conn *qsysdep;
+ boolean fret;
+
+ qsysdep = (struct ssysdep_conn *) qconn->psysdep;
+ fret = TRUE;
+ if (qsysdep->o >= 0 && close (qsysdep->o) < 0)
+ {
+ ulog (LOG_ERROR, "close: %s", strerror (errno));
+ fret = FALSE;
+ }
+ qsysdep->o = -1;
+
+ /* If the current pid is not the one we used to open the port, then
+ we must have forked up above and we are now the child. In this
+ case, we are being called from within the fendless loop in
+ uucico.c. We return FALSE to force the loop to end and the child
+ to exit. This should be handled in a cleaner fashion. */
+ if (qsysdep->ipid != getpid ())
+ fret = FALSE;
+
+ return fret;
+}
+
+/* Dial out on a TCP port, so to speak: connect to a remote computer. */
+
+/*ARGSUSED*/
+static boolean
+ftcp_dial (qconn, puuconf, qsys, zphone, qdialer, ptdialer)
+ struct sconnection *qconn;
+ pointer puuconf;
+ const struct uuconf_system *qsys;
+ const char *zphone;
+ struct uuconf_dialer *qdialer;
+ enum tdialerfound *ptdialer;
+{
+ struct ssysdep_conn *qsysdep;
+ const char *zhost;
+ struct hostent *q;
+ struct sockaddr_in s;
+ const char *zport;
+ char **pzdialer;
+
+ qsysdep = (struct ssysdep_conn *) qconn->psysdep;
+
+ *ptdialer = DIALERFOUND_FALSE;
+
+ zhost = zphone;
+ if (zhost == NULL)
+ {
+ if (qsys == NULL)
+ {
+ ulog (LOG_ERROR, "No address for TCP connection");
+ return FALSE;
+ }
+ zhost = qsys->uuconf_zname;
+ }
+
+ errno = 0;
+ q = gethostbyname ((char *) zhost);
+ if (q != NULL)
+ {
+ s.sin_family = q->h_addrtype;
+ memcpy (&s.sin_addr.s_addr, q->h_addr, (size_t) q->h_length);
+ }
+ else
+ {
+ if (errno != 0)
+ {
+ ulog (LOG_ERROR, "gethostbyname (%s): %s", zhost, strerror (errno));
+ return FALSE;
+ }
+
+ s.sin_family = AF_INET;
+ s.sin_addr.s_addr = inet_addr ((char *) zhost);
+ if ((long) s.sin_addr.s_addr == (long) -1)
+ {
+ ulog (LOG_ERROR, "%s: unknown host name", zhost);
+ return FALSE;
+ }
+ }
+
+ zport = qconn->qport->uuconf_u.uuconf_stcp.uuconf_zport;
+ s.sin_port = itcp_port_number (zport);
+
+ if (connect (qsysdep->o, (struct sockaddr *) &s, sizeof s) < 0)
+ {
+ ulog (LOG_ERROR, "connect: %s", strerror (errno));
+ return FALSE;
+ }
+
+ /* Handle the dialer sequence, if any. */
+ pzdialer = qconn->qport->uuconf_u.uuconf_stcp.uuconf_pzdialer;
+ if (pzdialer != NULL && *pzdialer != NULL)
+ {
+ if (! fconn_dial_sequence (qconn, puuconf, pzdialer, qsys, zphone,
+ qdialer, ptdialer))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* Get the port number given a name. The argument will almost always
+ be "uucp" so we cache that value. The return value is always in
+ network byte order. This returns -1 on error. */
+
+static int
+itcp_port_number (zname)
+ const char *zname;
+{
+ boolean fuucp;
+ static int iuucp;
+ int i;
+ char *zend;
+ struct servent *q;
+
+ fuucp = strcmp (zname, "uucp") == 0;
+ if (fuucp && iuucp != 0)
+ return iuucp;
+
+ /* Try it as a number first. */
+ i = strtol ((char *) zname, &zend, 10);
+ if (i != 0 && *zend == '\0')
+ return htons (i);
+
+ q = getservbyname ((char *) zname, (char *) "tcp");
+ if (q == NULL)
+ {
+ /* We know that the "uucp" service should be 540, even if isn't
+ in /etc/services. */
+ if (fuucp)
+ {
+ iuucp = htons (IUUCP_PORT);
+ return iuucp;
+ }
+ ulog (LOG_ERROR, "getservbyname (%s): %s", zname, strerror (errno));
+ return -1;
+ }
+
+ if (fuucp)
+ iuucp = q->s_port;
+
+ return q->s_port;
+}
+
+#endif /* HAVE_TCP */
diff --git a/gnu/libexec/uucp/libunix/tli.c b/gnu/libexec/uucp/libunix/tli.c
new file mode 100644
index 0000000..3e546c8
--- /dev/null
+++ b/gnu/libexec/uucp/libunix/tli.c
@@ -0,0 +1,628 @@
+/* tli.c
+ Code to handle TLI connections.
+
+ Copyright (C) 1992, 1993, 1994 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The author of the program may be contacted at ian@airs.com or
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
+ */
+
+#include "uucp.h"
+
+#if USE_RCS_ID
+const char tli_rcsid[] = "$Id: tli.c,v 1.4 1995/06/21 19:20:50 ian Rel $";
+#endif
+
+#if HAVE_TLI
+
+#include "sysdep.h"
+#include "uudefs.h"
+#include "uuconf.h"
+#include "conn.h"
+#include "system.h"
+
+#include <errno.h>
+
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#if HAVE_TIUSER_H
+#include <tiuser.h>
+#else
+#if HAVE_XTI_H
+#include <xti.h>
+#else
+#if HAVE_SYS_TLI_H
+#include <sys/tli.h>
+#endif
+#endif
+#endif
+
+#if HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#else
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+#endif
+
+#ifndef O_RDONLY
+#define O_RDONLY 0
+#define O_WRONLY 1
+#define O_RDWR 2
+#endif
+
+#ifndef FD_CLOEXEC
+#define FD_CLOEXEC 1
+#endif
+
+/* The arguments to t_alloca have two different names. I want the
+ SVID ones, not the XPG3 ones. */
+#ifndef T_BIND
+#define T_BIND T_BIND_STR
+#endif
+#ifndef T_CALL
+#define T_CALL T_CALL_STR
+#endif
+
+/* Hopefully these externs will not cause any trouble. This is how
+ they are shown in the SVID. */
+extern int t_errno;
+extern char *t_errlist[];
+extern int t_nerr;
+
+#ifndef HAVE_TIUSER_H
+#ifndef t_alloc
+extern pointer t_alloc ();
+#endif
+#endif
+
+/* This code handles TLI connections. It's Unix specific. It's
+ largely based on code from Unix Network Programming, by W. Richard
+ Stevens. */
+
+/* Local functions. */
+static const char *ztlierror P((void));
+static void utli_free P((struct sconnection *qconn));
+static boolean ftli_push P((struct sconnection *qconn));
+static boolean ftli_open P((struct sconnection *qconn, long ibaud,
+ boolean fwait));
+static boolean ftli_close P((struct sconnection *qconn,
+ pointer puuconf,
+ struct uuconf_dialer *qdialer,
+ boolean fsuccess));
+static boolean ftli_dial P((struct sconnection *qconn, pointer puuconf,
+ const struct uuconf_system *qsys,
+ const char *zphone,
+ struct uuconf_dialer *qdialer,
+ enum tdialerfound *ptdialer));
+
+/* The command table for a TLI connection. */
+static const struct sconncmds stlicmds =
+{
+ utli_free,
+ NULL, /* pflock */
+ NULL, /* pfunlock */
+ ftli_open,
+ ftli_close,
+ ftli_dial,
+ fsysdep_conn_read,
+ fsysdep_conn_write,
+ fsysdep_conn_io,
+ NULL, /* pfbreak */
+ NULL, /* pfset */
+ NULL, /* pfcarrier */
+ fsysdep_conn_chat,
+ NULL /* pibaud */
+};
+
+/* Get a TLI error string. */
+
+static const char *
+ztlierror ()
+{
+ if (t_errno == TSYSERR)
+ return strerror (errno);
+ if (t_errno < 0 || t_errno >= t_nerr)
+ return "Unknown TLI error";
+ return t_errlist[t_errno];
+}
+
+/* Initialize a TLI connection. This may be called with qconn->qport
+ NULL, when opening standard input as a TLI connection. */
+
+boolean
+fsysdep_tli_init (qconn)
+ struct sconnection *qconn;
+{
+ struct ssysdep_conn *q;
+
+ q = (struct ssysdep_conn *) xmalloc (sizeof (struct ssysdep_conn));
+ q->o = -1;
+ q->ord = -1;
+ q->owr = -1;
+ q->zdevice = NULL;
+ q->iflags = -1;
+ q->iwr_flags = -1;
+ q->fterminal = FALSE;
+ q->ftli = TRUE;
+ q->ibaud = 0;
+
+ qconn->psysdep = (pointer) q;
+ qconn->qcmds = &stlicmds;
+ return TRUE;
+}
+
+/* Free a TLI connection. */
+
+static void
+utli_free (qconn)
+ struct sconnection *qconn;
+{
+ xfree (qconn->psysdep);
+}
+
+/* Push all desired modules onto a TLI stream. If the user requests a
+ STREAMS connection without giving a list of modules, we just push
+ tirdwr. If the I_PUSH ioctl is not defined on this system, we just
+ ignore any list of modules. */
+
+static boolean
+ftli_push (qconn)
+ struct sconnection *qconn;
+{
+#ifdef I_PUSH
+
+ struct ssysdep_conn *qsysdep;
+
+ qsysdep = (struct ssysdep_conn *) qconn->psysdep;
+
+ if (qconn->qport->uuconf_u.uuconf_stli.uuconf_pzpush != NULL)
+ {
+ char **pz;
+
+ for (pz = qconn->qport->uuconf_u.uuconf_stli.uuconf_pzpush;
+ *pz != NULL;
+ pz++)
+ {
+ if (ioctl (qsysdep->o, I_PUSH, *pz) < 0)
+ {
+ ulog (LOG_ERROR, "ioctl (I_PUSH, %s): %s", *pz,
+ strerror (errno));
+ return FALSE;
+ }
+ }
+ }
+ else if (qconn->qport->uuconf_u.uuconf_stli.uuconf_fstream)
+ {
+ if (ioctl (qsysdep->o, I_PUSH, "tirdwr") < 0)
+ {
+ ulog (LOG_ERROR, "ioctl (I_PUSH, tirdwr): %s",
+ strerror (errno));
+ return FALSE;
+ }
+ }
+
+ /* If we have just put the connection into stream mode, we must turn
+ off the TLI flag to avoid using TLI calls on it. */
+ if (qconn->qport->uuconf_u.uuconf_stli.uuconf_fstream)
+ qsysdep->ftli = FALSE;
+
+#endif /* defined (I_PUSH) */
+
+ return TRUE;
+}
+
+/* Open a TLI connection. If the fwait argument is TRUE, we are
+ running as a server. Otherwise we are just trying to reach another
+ system. */
+
+static boolean
+ftli_open (qconn, ibaud, fwait)
+ struct sconnection *qconn;
+ long ibaud;
+ boolean fwait;
+{
+ struct ssysdep_conn *qsysdep;
+ const char *zdevice;
+ char *zfreedev;
+ const char *zservaddr;
+ char *zfreeaddr;
+ uid_t ieuid;
+ boolean fswap;
+ struct t_bind *qtbind;
+ struct t_call *qtcall;
+
+ /* Unlike most other device types, we don't bother to call
+ ulog_device here, because fconn_open calls it with the name of
+ the port anyhow. */
+
+ qsysdep = (struct ssysdep_conn *) qconn->psysdep;
+
+ zdevice = qconn->qport->uuconf_u.uuconf_stli.uuconf_zdevice;
+ if (zdevice == NULL)
+ zdevice = qconn->qport->uuconf_zname;
+
+ zfreedev = NULL;
+ if (*zdevice != '/')
+ {
+ zfreedev = zbufalc (sizeof "/dev/" + strlen (zdevice));
+ sprintf (zfreedev, "/dev/%s", zdevice);
+ zdevice = zfreedev;
+ }
+
+ /* If we are acting as a server, swap to our real user ID before
+ calling t_open. This will permit the server to use privileged
+ TCP ports when invoked by root. We only swap if our effective
+ user ID is not root, so that the program can also be made suid
+ root in order to get privileged ports when invoked by anybody. */
+ fswap = fwait && geteuid () != 0;
+ if (fswap)
+ {
+ if (! fsuser_perms (&ieuid))
+ {
+ ubuffree (zfreedev);
+ return FALSE;
+ }
+ }
+
+ qsysdep->o = t_open (zdevice, O_RDWR, (struct t_info *) NULL);
+ if (qsysdep->o < 0)
+ {
+ if (fswap)
+ (void) fsuucp_perms ((long) ieuid);
+ ulog (LOG_ERROR, "t_open (%s): %s", zdevice, ztlierror ());
+ ubuffree (zfreedev);
+ return FALSE;
+ }
+
+ if (fcntl (qsysdep->o, F_SETFD,
+ fcntl (qsysdep->o, F_GETFD, 0) | FD_CLOEXEC) < 0)
+ {
+ if (fswap)
+ (void) fsuucp_perms ((long) ieuid);
+ ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
+ ubuffree (zfreedev);
+ (void) t_close (qsysdep->o);
+ qsysdep->o = -1;
+ return FALSE;
+ }
+
+ qsysdep->iflags = fcntl (qsysdep->o, F_GETFL, 0);
+ if (qsysdep->iflags < 0)
+ {
+ if (fswap)
+ (void) fsuucp_perms ((long) ieuid);
+ ulog (LOG_ERROR, "fcntl: %s", strerror (errno));
+ ubuffree (zfreedev);
+ (void) t_close (qsysdep->o);
+ qsysdep->o = -1;
+ return FALSE;
+ }
+
+ /* We save our process ID in the qconn structure. This is checked
+ in ftli_close. */
+ qsysdep->ipid = getpid ();
+
+ /* If we aren't waiting for a connection, we can bind to any local
+ address, and then we're finished. */
+ if (! fwait)
+ {
+ /* fswap is known to be FALSE here. */
+ ubuffree (zfreedev);
+ if (t_bind (qsysdep->o, (struct t_bind *) NULL,
+ (struct t_bind *) NULL) < 0)
+ {
+ ulog (LOG_ERROR, "t_bind: %s", ztlierror ());
+ (void) t_close (qsysdep->o);
+ qsysdep->o = -1;
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ /* Run as a server and wait for a new connection. The code in
+ uucico.c has already detached us from our controlling terminal.
+ From this point on if the server gets an error we exit; we only
+ return if we have received a connection. It would be more robust
+ to respawn the server if it fails; someday. */
+ qtbind = (struct t_bind *) t_alloc (qsysdep->o, T_BIND, T_ALL);
+ if (qtbind == NULL)
+ {
+ if (fswap)
+ (void) fsuucp_perms ((long) ieuid);
+ ulog (LOG_FATAL, "t_alloc (T_BIND): %s", ztlierror ());
+ }
+
+ zservaddr = qconn->qport->uuconf_u.uuconf_stli.uuconf_zservaddr;
+ if (zservaddr == NULL)
+ {
+ if (fswap)
+ (void) fsuucp_perms ((long) ieuid);
+ ulog (LOG_FATAL, "Can't run as TLI server; no server address");
+ }
+
+ zfreeaddr = zbufcpy (zservaddr);
+ qtbind->addr.len = cescape (zfreeaddr);
+ if (qtbind->addr.len > qtbind->addr.maxlen)
+ {
+ if (fswap)
+ (void) fsuucp_perms ((long) ieuid);
+ ulog (LOG_FATAL, "%s: TLI server address too long (max %d)",
+ zservaddr, qtbind->addr.maxlen);
+ }
+ memcpy (qtbind->addr.buf, zfreeaddr, qtbind->addr.len);
+ ubuffree (zfreeaddr);
+
+ qtbind->qlen = 5;
+
+ if (t_bind (qsysdep->o, qtbind, (struct t_bind *) NULL) < 0)
+ {
+ if (fswap)
+ (void) fsuucp_perms ((long) ieuid);
+ ulog (LOG_FATAL, "t_bind (%s): %s", zservaddr, ztlierror ());
+ }
+
+ if (fswap)
+ {
+ if (! fsuucp_perms ((long) ieuid))
+ ulog (LOG_FATAL, "Could not swap back to UUCP user permissions");
+ }
+
+ (void) t_free ((pointer) qtbind, T_BIND);
+
+ qtcall = (struct t_call *) t_alloc (qsysdep->o, T_CALL, T_ALL);
+ if (qtcall == NULL)
+ ulog (LOG_FATAL, "t_alloc (T_CALL): %s", ztlierror ());
+
+ while (! FGOT_SIGNAL ())
+ {
+ int onew;
+ pid_t ipid;
+
+ DEBUG_MESSAGE0 (DEBUG_PORT,
+ "ftli_open: Waiting for connections");
+
+ if (t_listen (qsysdep->o, qtcall) < 0)
+ ulog (LOG_FATAL, "t_listen: %s", ztlierror ());
+
+ onew = t_open (zdevice, O_RDWR, (struct t_info *) NULL);
+ if (onew < 0)
+ ulog (LOG_FATAL, "t_open (%s): %s", zdevice, ztlierror ());
+
+ if (fcntl (onew, F_SETFD,
+ fcntl (onew, F_GETFD, 0) | FD_CLOEXEC) < 0)
+ ulog (LOG_FATAL, "fcntl (FD_CLOEXEC): %s", strerror (errno));
+
+ if (t_bind (onew, (struct t_bind *) NULL, (struct t_bind *) NULL) < 0)
+ ulog (LOG_FATAL, "t_bind: %s", ztlierror ());
+
+ if (t_accept (qsysdep->o, onew, qtcall) < 0)
+ {
+ /* We may have received a disconnect. */
+ if (t_errno != TLOOK)
+ ulog (LOG_FATAL, "t_accept: %s", ztlierror ());
+ if (t_rcvdis (qsysdep->o, (struct t_discon *) NULL) < 0)
+ ulog (LOG_FATAL, "t_rcvdis: %s", ztlierror ());
+ (void) t_close (onew);
+ continue;
+ }
+
+ DEBUG_MESSAGE0 (DEBUG_PORT,
+ "ftli_open: Got connection; forking");
+
+ ipid = ixsfork ();
+ if (ipid < 0)
+ ulog (LOG_FATAL, "fork: %s", strerror (errno));
+ if (ipid == 0)
+ {
+ ulog_close ();
+
+ (void) t_close (qsysdep->o);
+ qsysdep->o = onew;
+
+ /* Push any desired modules. */
+ if (! ftli_push (qconn))
+ _exit (EXIT_FAILURE);
+
+ /* Now we fork and let our parent die, so that we become
+ a child of init. This lets the main server code wait
+ for its child and then continue without accumulating
+ zombie children. */
+ ipid = ixsfork ();
+ if (ipid < 0)
+ {
+ ulog (LOG_ERROR, "fork: %s", strerror (errno));
+ _exit (EXIT_FAILURE);
+ }
+
+ if (ipid != 0)
+ _exit (EXIT_SUCCESS);
+
+ ulog_id (getpid ());
+
+ return TRUE;
+ }
+
+ (void) t_close (onew);
+
+ /* Now wait for the child. */
+ (void) ixswait ((unsigned long) ipid, (const char *) NULL);
+ }
+
+ /* We got a signal. */
+ usysdep_exit (FALSE);
+
+ /* Avoid compiler warnings. */
+ return FALSE;
+}
+
+/* Close the port. */
+
+/*ARGSUSED*/
+static boolean
+ftli_close (qconn, puuconf, qdialer, fsuccess)
+ struct sconnection *qconn;
+ pointer puuconf;
+ struct uuconf_dialer *qdialer;
+ boolean fsuccess;
+{
+ struct ssysdep_conn *qsysdep;
+ boolean fret;
+
+ qsysdep = (struct ssysdep_conn *) qconn->psysdep;
+
+ fret = TRUE;
+ if (qsysdep->o >= 0)
+ {
+ if (qsysdep->ftli)
+ {
+ if (t_close (qsysdep->o) < 0)
+ {
+ ulog (LOG_ERROR, "t_close: %s", ztlierror ());
+ fret = FALSE;
+ }
+ }
+ else
+ {
+ if (close (qsysdep->o) < 0)
+ {
+ ulog (LOG_ERROR, "close: %s", strerror (errno));
+ fret = FALSE;
+ }
+ }
+
+ qsysdep->o = -1;
+ }
+
+ /* If the current pid is not the one we used to open the port, then
+ we must have forked up above and we are now the child. In this
+ case, we are being called from within the fendless loop in
+ uucico.c. We return FALSE to force the loop to end and the child
+ to exit. This should be handled in a cleaner fashion. */
+ if (qsysdep->ipid != getpid ())
+ fret = FALSE;
+
+ return fret;
+}
+
+/* Dial out on a TLI port, so to speak: connect to a remote computer. */
+
+/*ARGSUSED*/
+static boolean
+ftli_dial (qconn, puuconf, qsys, zphone, qdialer, ptdialerfound)
+ struct sconnection *qconn;
+ pointer puuconf;
+ const struct uuconf_system *qsys;
+ const char *zphone;
+ struct uuconf_dialer *qdialer;
+ enum tdialerfound *ptdialerfound;
+{
+ struct ssysdep_conn *qsysdep;
+ char **pzdialer;
+ const char *zaddr;
+ struct t_call *qtcall;
+ char *zescape;
+
+ qsysdep = (struct ssysdep_conn *) qconn->psysdep;
+
+ *ptdialerfound = DIALERFOUND_FALSE;
+
+ pzdialer = qconn->qport->uuconf_u.uuconf_stli.uuconf_pzdialer;
+ if (*pzdialer == NULL)
+ pzdialer = NULL;
+
+ /* If the first dialer is "TLI" or "TLIS", we use the first token
+ (pzdialer[1]) as the address to connect to. */
+ zaddr = zphone;
+ if (pzdialer != NULL
+ && (strcmp (pzdialer[0], "TLI") == 0
+ || strcmp (pzdialer[0], "TLIS") == 0))
+ {
+ if (pzdialer[1] == NULL)
+ ++pzdialer;
+ else
+ {
+ if (strcmp (pzdialer[1], "\\D") != 0
+ && strcmp (pzdialer[1], "\\T") != 0)
+ zaddr = pzdialer[1];
+ pzdialer += 2;
+ }
+ }
+
+ if (zaddr == NULL)
+ {
+ ulog (LOG_ERROR, "No address for TLI connection");
+ return FALSE;
+ }
+
+ qtcall = (struct t_call *) t_alloc (qsysdep->o, T_CALL, T_ADDR);
+ if (qtcall == NULL)
+ {
+ ulog (LOG_ERROR, "t_alloc (T_CALL): %s", ztlierror ());
+ return FALSE;
+ }
+
+ zescape = zbufcpy (zaddr);
+ qtcall->addr.len = cescape (zescape);
+ if (qtcall->addr.len > qtcall->addr.maxlen)
+ {
+ ulog (LOG_ERROR, "%s: TLI address too long (max %d)", zaddr,
+ qtcall->addr.maxlen);
+ ubuffree (zescape);
+ return FALSE;
+ }
+ memcpy (qtcall->addr.buf, zescape, qtcall->addr.len);
+ ubuffree (zescape);
+
+ if (t_connect (qsysdep->o, qtcall, (struct t_call *) NULL) < 0)
+ {
+ if (t_errno != TLOOK)
+ ulog (LOG_ERROR, "t_connect: %s", ztlierror ());
+ else
+ {
+ if (t_rcvdis (qsysdep->o, (struct t_discon *) NULL) < 0)
+ ulog (LOG_ERROR, "t_rcvdis: %s", ztlierror ());
+ else
+ ulog (LOG_ERROR, "Connection refused");
+ }
+ return FALSE;
+ }
+
+ /* We've connected to the remote. Push any desired modules. */
+ if (! ftli_push (qconn))
+ return FALSE;
+
+ /* Handle the rest of the dialer sequence. */
+ if (pzdialer != NULL && *pzdialer != NULL)
+ {
+ if (! fconn_dial_sequence (qconn, puuconf, pzdialer, qsys, zphone,
+ qdialer, ptdialerfound))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+#endif /* HAVE_TLI */
diff --git a/gnu/libexec/uucp/libunix/tmpfil.c b/gnu/libexec/uucp/libunix/tmpfil.c
index b10e809..f2f5ba8 100644
--- a/gnu/libexec/uucp/libunix/tmpfil.c
+++ b/gnu/libexec/uucp/libunix/tmpfil.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/uacces.c b/gnu/libexec/uucp/libunix/uacces.c
index d99ead3..8f37a8e 100644
--- a/gnu/libexec/uucp/libunix/uacces.c
+++ b/gnu/libexec/uucp/libunix/uacces.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libunix/ufopen.c b/gnu/libexec/uucp/libunix/ufopen.c
index 76ee1d1..d79d9a0 100644
--- a/gnu/libexec/uucp/libunix/ufopen.c
+++ b/gnu/libexec/uucp/libunix/ufopen.c
@@ -1,7 +1,7 @@
/* ufopen.c
Open a file with the permissions of the invoking user.
- Copyright (C) 1992 Ian Lance Taylor
+ Copyright (C) 1992, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -53,89 +53,6 @@
#define FD_CLOEXEC 1
#endif
-/* Local functions. */
-
-static boolean fsuser_perms P((uid_t *pieuid));
-static boolean fsuucp_perms P((long ieuid));
-
-/* Switch to permissions of the invoking user. */
-
-static boolean
-fsuser_perms (pieuid)
- uid_t *pieuid;
-{
- uid_t ieuid, iuid;
-
- ieuid = geteuid ();
- iuid = getuid ();
- if (pieuid != NULL)
- *pieuid = ieuid;
-
-#if HAVE_SETREUID
- /* Swap the effective user id and the real user id. We can then
- swap them back again when we want to return to the uucp user's
- permissions. */
- if (setreuid (ieuid, iuid) < 0)
- {
- ulog (LOG_ERROR, "setreuid (%ld, %ld): %s",
- (long) ieuid, (long) iuid, strerror (errno));
- return FALSE;
- }
-#else /* ! HAVE_SETREUID */
-#if HAVE_SAVED_SETUID
- /* Set the effective user id to the real user id. Since the
- effective user id is saved (it's the saved setuid) we will able
- to set back to it later. If the real user id is root we will not
- be able to switch back and forth, so don't even try. */
- if (iuid != 0)
- {
- if (setuid (iuid) < 0)
- {
- ulog (LOG_ERROR, "setuid (%ld): %s", (long) iuid, strerror (errno));
- return FALSE;
- }
- }
-#else /* ! HAVE_SAVED_SETUID */
- /* There's no way to switch between real permissions and effective
- permissions. Just try to open the file with the uucp
- permissions. */
-#endif /* ! HAVE_SAVED_SETUID */
-#endif /* ! HAVE_SETREUID */
-
- return TRUE;
-}
-
-/* Restore the uucp permissions. */
-
-/*ARGSUSED*/
-static boolean
-fsuucp_perms (ieuid)
- long ieuid;
-{
-#if HAVE_SETREUID
- /* Swap effective and real user id's back to what they were. */
- if (! fsuser_perms ((uid_t *) NULL))
- return FALSE;
-#else /* ! HAVE_SETREUID */
-#if HAVE_SAVED_SETUID
- /* Set ourselves back to our original effective user id. */
- if (setuid ((uid_t) ieuid) < 0)
- {
- ulog (LOG_ERROR, "setuid (%ld): %s", (long) ieuid, strerror (errno));
- /* Is this error message helpful or confusing? */
- if (errno == EPERM)
- ulog (LOG_ERROR,
- "Probably HAVE_SAVED_SETUID in policy.h should be set to 0");
- return FALSE;
- }
-#else /* ! HAVE_SAVED_SETUID */
- /* We didn't switch, no need to switch back. */
-#endif /* ! HAVE_SAVED_SETUID */
-#endif /* ! HAVE_SETREUID */
-
- return TRUE;
-}
-
/* Open a file with the permissions of the invoking user. Ignore the
fbinary argument since Unix has no distinction between text and
binary files. */
diff --git a/gnu/libexec/uucp/libunix/uid.c b/gnu/libexec/uucp/libunix/uid.c
new file mode 100644
index 0000000..b93e2a9
--- /dev/null
+++ b/gnu/libexec/uucp/libunix/uid.c
@@ -0,0 +1,109 @@
+/* uid.c
+ Switch back and forth between UUCP and user permissions.
+
+ Copyright (C) 1992, 1995 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The author of the program may be contacted at ian@airs.com or
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
+ */
+
+#include "uucp.h"
+
+#include "uudefs.h"
+#include "sysdep.h"
+
+#include <errno.h>
+
+/* Switch to permissions of the invoking user. */
+
+boolean
+fsuser_perms (pieuid)
+ uid_t *pieuid;
+{
+ uid_t ieuid, iuid;
+
+ ieuid = geteuid ();
+ iuid = getuid ();
+ if (pieuid != NULL)
+ *pieuid = ieuid;
+
+#if HAVE_SETREUID
+ /* Swap the effective user id and the real user id. We can then
+ swap them back again when we want to return to the uucp user's
+ permissions. */
+ if (setreuid (ieuid, iuid) < 0)
+ {
+ ulog (LOG_ERROR, "setreuid (%ld, %ld): %s",
+ (long) ieuid, (long) iuid, strerror (errno));
+ return FALSE;
+ }
+#else /* ! HAVE_SETREUID */
+#if HAVE_SAVED_SETUID
+ /* Set the effective user id to the real user id. Since the
+ effective user id is saved (it's the saved setuid) we will able
+ to set back to it later. If the real user id is root we will not
+ be able to switch back and forth, so don't even try. */
+ if (iuid != 0)
+ {
+ if (setuid (iuid) < 0)
+ {
+ ulog (LOG_ERROR, "setuid (%ld): %s", (long) iuid, strerror (errno));
+ return FALSE;
+ }
+ }
+#else /* ! HAVE_SAVED_SETUID */
+ /* There's no way to switch between real permissions and effective
+ permissions. Just try to open the file with the uucp
+ permissions. */
+#endif /* ! HAVE_SAVED_SETUID */
+#endif /* ! HAVE_SETREUID */
+
+ return TRUE;
+}
+
+/* Restore the uucp permissions. */
+
+/*ARGSUSED*/
+boolean
+fsuucp_perms (ieuid)
+ long ieuid;
+{
+#if HAVE_SETREUID
+ /* Swap effective and real user id's back to what they were. */
+ if (! fsuser_perms ((uid_t *) NULL))
+ return FALSE;
+#else /* ! HAVE_SETREUID */
+#if HAVE_SAVED_SETUID
+ /* Set ourselves back to our original effective user id. */
+ if (setuid ((uid_t) ieuid) < 0)
+ {
+ ulog (LOG_ERROR, "setuid (%ld): %s", (long) ieuid, strerror (errno));
+ /* Is this error message helpful or confusing? */
+ if (errno == EPERM)
+ ulog (LOG_ERROR,
+ "Probably HAVE_SAVED_SETUID in policy.h should be set to 0");
+ return FALSE;
+ }
+#else /* ! HAVE_SAVED_SETUID */
+ /* We didn't switch, no need to switch back. */
+#endif /* ! HAVE_SAVED_SETUID */
+#endif /* ! HAVE_SETREUID */
+
+ return TRUE;
+}
diff --git a/gnu/libexec/uucp/libunix/wldcrd.c b/gnu/libexec/uucp/libunix/wldcrd.c
index 961ea31..1aa17fa 100644
--- a/gnu/libexec/uucp/libunix/wldcrd.c
+++ b/gnu/libexec/uucp/libunix/wldcrd.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -167,7 +167,7 @@ zsysdep_wildcard (zfile)
zret = zbufcpy (sSglob.gl_pathv[iSglob]);
++iSglob;
return zret;
-
+
#else /* ! HAVE_GLOB */
char *zret;
diff --git a/gnu/libexec/uucp/libunix/work.c b/gnu/libexec/uucp/libunix/work.c
index 04a036c..4f380fb 100644
--- a/gnu/libexec/uucp/libunix/work.c
+++ b/gnu/libexec/uucp/libunix/work.c
@@ -1,7 +1,7 @@
/* work.c
Routines to read command files.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char work_rcsid[] = "$Id: work.c,v 1.2 1994/05/07 18:11:41 ache Exp $";
+const char work_rcsid[] = "$Id: work.c,v 1.20 1995/06/30 21:35:14 ian Rel $";
#endif
#include "uudefs.h"
@@ -189,7 +189,7 @@ fswork_file (zsystem, zfile, pbgrade)
*pbgrade = zfile[2];
return (zfile[0] == 'C'
&& zfile[1] == '.'
- && strlen (zfile) == 7);
+ && zfile[2] != '\0');
#endif /* SPOOLDIR_TAYLOR */
}
@@ -426,13 +426,12 @@ fsysdep_get_work_init (qsys, bgrade)
/* Get the next work entry for a system. This must parse the next
line in the next work file. The type of command is set into
- qcmd->bcmd; if there are no more commands we call
- fsysdep_get_work_init to rescan, in case any came in since the last
- call. If there are still no commands, qcmd->bcmd is set to 'H'.
+ qcmd->bcmd If there are no more commands, qcmd->bcmd is set to 'H'.
Each field in the structure is set to point to a spot in an
- malloced string. The only time we use the grade here is when
- calling fsysdep_get_work_init to rescan. */
+ malloced string. The grade argument is never used; it has been
+ used by fsysdep_get_work_init. */
+/*ARGSUSED*/
boolean
fsysdep_get_work (qsys, bgrade, qcmd)
const struct uuconf_system *qsys;
@@ -471,18 +470,9 @@ fsysdep_get_work (qsys, bgrade, qcmd)
{
if (iSwork_file >= cSwork_files)
{
- /* Rescan the work directory. */
- if (! fsysdep_get_work_init (qsys, bgrade))
- {
- ubuffree (zdir);
- return FALSE;
- }
- if (iSwork_file >= cSwork_files)
- {
- qcmd->bcmd = 'H';
- ubuffree (zdir);
- return TRUE;
- }
+ qcmd->bcmd = 'H';
+ ubuffree (zdir);
+ return TRUE;
}
if (zdir == NULL)
@@ -506,7 +496,7 @@ fsysdep_get_work (qsys, bgrade, qcmd)
}
}
while (e == NULL);
-
+
qfile = (struct ssfile *) xmalloc (sizeof (struct ssfile));
callocated = CFILELINES;
iline = 0;
@@ -561,7 +551,7 @@ fsysdep_get_work (qsys, bgrade, qcmd)
while (TRUE)
{
int iline;
-
+
if (qSwork_file->cdid >= qSwork_file->clines)
{
/* We don't want to free qSwork_file here, since it must
@@ -628,7 +618,7 @@ fsysdep_did_work (pseq)
struct ssfile *qfile;
struct ssline *qline;
int i;
-
+
qline = (struct ssline *) pseq;
ubuffree (qline->zline);
@@ -745,7 +735,7 @@ zsysdep_save_temp_file (pseq)
ubuffree (zto);
return "Could not move file to preservation directory";
}
-
+
cwant = sizeof "File saved as\n\t/" + strlen (zSspooldir) + strlen (zto);
if (cwant > cbuf)
{
@@ -787,11 +777,15 @@ bsgrade (pseq)
zfile = ((struct ssline *) pseq)->qfile->zfile;
+#if SPOOLDIR_TAYLOR
+ bgrade = *(strrchr (zfile, '/') + 3);
+#else
#if ! SPOOLDIR_SVR4
bgrade = zfile[strlen (zfile) - CSEQLEN - 1];
#else
bgrade = *(strchr (zfile, '/') + 1);
#endif
+#endif
return bgrade;
}
diff --git a/gnu/libexec/uucp/libunix/xqtfil.c b/gnu/libexec/uucp/libunix/xqtfil.c
index 69e70db..7b1b141 100644
--- a/gnu/libexec/uucp/libunix/xqtfil.c
+++ b/gnu/libexec/uucp/libunix/xqtfil.c
@@ -1,7 +1,7 @@
/* xqtfil.c
Routines to read execute files.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char xqtfil_rcsid[] = "$Id: xqtfil.c,v 1.2 1994/05/07 18:11:42 ache Exp $";
+const char xqtfil_rcsid[] = "$Id: xqtfil.c,v 1.10 1995/07/19 04:18:37 ian Rel $";
#endif
#include "uudefs.h"
@@ -78,6 +78,7 @@ static DIR *qSxqt_topdir;
#if ! SUBDIRS
static const char *zSdir;
#else /* SUBDIRS */
+static boolean fSone_dir;
static char *zSdir;
static DIR *qSxqt_dir;
static char *zSsystem;
@@ -89,9 +90,36 @@ static char *zSsystem;
/*ARGSUSED*/
boolean
-fsysdep_get_xqt_init ()
+fsysdep_get_xqt_init (zsystem)
+ const char *zsystem;
{
- usysdep_get_xqt_free ();
+ usysdep_get_xqt_free ((const char *) NULL);
+
+#if SUBDIRS
+ if (zsystem != NULL)
+ {
+#if SPOOLDIR_HDB || SPOOLDIR_SVR4
+ zSdir = zbufcpy (zsystem);
+#endif
+#if SPOOLDIR_ULTRIX
+ zSdir = zsappend3 ("sys", zsystem, "X.");
+#endif
+#if SPOOLDIR_TAYLOR
+ zSdir = zsysdep_in_dir (zsystem, "X.");
+#endif
+
+ qSxqt_dir = opendir ((char *) zSdir);
+ if (qSxqt_dir != NULL)
+ {
+ qSxqt_topdir = qSxqt_dir;
+ fSone_dir = TRUE;
+ zSsystem = zbufcpy (zsystem);
+ return TRUE;
+ }
+ }
+
+ fSone_dir = FALSE;
+#endif
qSxqt_topdir = opendir ((char *) ZDIR);
if (qSxqt_topdir == NULL)
@@ -111,8 +139,10 @@ fsysdep_get_xqt_init ()
*pzsystem will be set to the system for which the execute file was
created. */
+/*ARGSUSED*/
char *
-zsysdep_get_xqt (pzsystem, pferr)
+zsysdep_get_xqt (zsystem, pzsystem, pferr)
+ const char *zsystem;
char **pzsystem;
boolean *pferr;
{
@@ -220,20 +250,22 @@ zsysdep_get_xqt (pzsystem, pferr)
#endif
return zret;
}
-
+
/* If we've reached the end of the directory, then if we are
using subdirectories loop around to read the next one,
otherwise we are finished. */
if (q == NULL)
{
(void) closedir (qdir);
+
#if SUBDIRS
qSxqt_dir = NULL;
- continue;
-#else
+ if (! fSone_dir)
+ continue;
+#endif
+
qSxqt_topdir = NULL;
return NULL;
-#endif
}
}
}
@@ -243,7 +275,8 @@ zsysdep_get_xqt (pzsystem, pferr)
/*ARGSUSED*/
void
-usysdep_get_xqt_free ()
+usysdep_get_xqt_free (zsystem)
+ const char *zsystem;
{
if (qSxqt_topdir != NULL)
{
@@ -260,5 +293,6 @@ usysdep_get_xqt_free ()
zSdir = NULL;
ubuffree (zSsystem);
zSsystem = NULL;
+ fSone_dir = FALSE;
#endif
}
diff --git a/gnu/libexec/uucp/libunix/xqtsub.c b/gnu/libexec/uucp/libunix/xqtsub.c
index df84654..a2fd50a 100644
--- a/gnu/libexec/uucp/libunix/xqtsub.c
+++ b/gnu/libexec/uucp/libunix/xqtsub.c
@@ -1,7 +1,7 @@
/* xqtsub.c
System dependent functions used only by uuxqt.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char xqtsub_rcsid[] = "$Id: xqtsub.c,v 1.2 1994/05/07 18:11:43 ache Exp $";
+const char xqtsub_rcsid[] = "$Id: xqtsub.c,v 1.18 1995/06/21 20:21:14 ian Rel $";
#endif
#include "uudefs.h"
@@ -263,9 +263,9 @@ fsysdep_execute (qsys, zuser, pazargs, zfullcmd, zinput, zoutput,
{
ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
ferr = TRUE;
- }
+ }
}
-
+
if (! ferr && zoutput != NULL)
{
aidescs[1] = creat ((char *) zoutput, IPRIVATE_FILE_MODE);
@@ -280,7 +280,7 @@ fsysdep_execute (qsys, zuser, pazargs, zfullcmd, zinput, zoutput,
{
ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
ferr = TRUE;
- }
+ }
}
if (! ferr)
@@ -312,7 +312,7 @@ fsysdep_execute (qsys, zuser, pazargs, zfullcmd, zinput, zoutput,
{
ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
ferr = TRUE;
- }
+ }
}
if (iseq == 0)
@@ -545,7 +545,8 @@ fsysdep_lock_uuxqt_dir (iseq)
}
if (mkdir (zxqtdir, S_IRWXU) < 0
- && errno != EEXIST)
+ && errno != EEXIST
+ && errno != EISDIR)
{
ulog (LOG_ERROR, "mkdir (%s): %s", zxqtdir, strerror (errno));
return FALSE;
@@ -658,7 +659,7 @@ fsysdep_move_uuxqt_files (cfiles, pzfrom, pzto, fto, iseq, pzinput)
if (! fto)
{
const char *ztemp;
-
+
ztemp = zfrom;
zfrom = zto;
zto = ztemp;
@@ -682,7 +683,7 @@ fsysdep_move_uuxqt_files (cfiles, pzfrom, pzto, fto, iseq, pzinput)
break;
}
- if (! fcopy_file (zfrom, zto, FALSE, FALSE))
+ if (! fcopy_file (zfrom, zto, FALSE, FALSE, FALSE))
{
ubuffree (zfree);
break;
diff --git a/gnu/libexec/uucp/libuuconf/MANIFEST b/gnu/libexec/uucp/libuuconf/MANIFEST
index 98787b5..d4ca25e 100644
--- a/gnu/libexec/uucp/libuuconf/MANIFEST
+++ b/gnu/libexec/uucp/libuuconf/MANIFEST
@@ -67,6 +67,7 @@ snams.c
split.c
spool.c
stafil.c
+strip.c
syssub.c
tcalou.c
tdial.c
diff --git a/gnu/libexec/uucp/libuuconf/Makefile b/gnu/libexec/uucp/libuuconf/Makefile
index 7b7f3ec..060214a 100644
--- a/gnu/libexec/uucp/libuuconf/Makefile
+++ b/gnu/libexec/uucp/libuuconf/Makefile
@@ -1,5 +1,5 @@
# This is the Makefile for the Taylor UUCP uuconf library
-# $Id: Makefile,v 1.1 1993/08/05 18:24:52 conklin Exp $
+# $Id: Makefile,v 1.2 1994/05/07 18:11:49 ache Exp $
LIB= uuconf
SRCS = addblk.c addstr.c allblk.c alloc.c base.c bool.c callin.c \
@@ -10,10 +10,11 @@ SRCS = addblk.c addstr.c allblk.c alloc.c base.c bool.c callin.c \
hsys.c hunk.c iniglb.c init.c int.c lckdir.c lineno.c llocnm.c \
local.c locnm.c logfil.c maxuxq.c mrgblk.c paramc.c port.c \
prtsub.c pubdir.c rdlocs.c rdperm.c reliab.c remunk.c runuxq.c \
- sinfo.c snams.c split.c spool.c stafil.c syssub.c tcalou.c \
- tdial.c tdialc.c tdnams.c tgcmp.c thread.c time.c tinit.c \
- tlocnm.c tport.c tportc.c tsinfo.c tsnams.c tsys.c tval.c \
- ugtlin.c unk.c val.c vinit.c vport.c vsinfo.c vsnams.c vsys.c
+ sinfo.c snams.c split.c spool.c stafil.c strip.c syssub.c \
+ tcalou.c tdial.c tdialc.c tdnams.c tgcmp.c thread.c time.c \
+ tinit.c tlocnm.c tport.c tportc.c tsinfo.c tsnams.c tsys.c \
+ tval.c ugtlin.c unk.c val.c vinit.c vport.c vsinfo.c vsnams.c \
+ vsys.c
CFLAGS+= -I$(.CURDIR)/../common_sources \
-DNEWCONFIGLIB=\"$(newconfigdir)\"\
-DOLDCONFIGLIB=\"$(oldconfigdir)\"
diff --git a/gnu/libexec/uucp/libuuconf/README b/gnu/libexec/uucp/libuuconf/README
index b9a2156..cc022ad 100644
--- a/gnu/libexec/uucp/libuuconf/README
+++ b/gnu/libexec/uucp/libuuconf/README
@@ -1,8 +1,8 @@
This is the README file for the beta release of the uuconf library.
It was written by Ian Lance Taylor. I can be reached at ian@airs.com,
-or, equivalently, uunet!cygint!airs!ian, or c/o Cygnus Support, 4th
-Floor, Building 200, 1 Kendall Square, Cambridge MA, 02139, USA.
+or, equivalently, uunet!cygint!airs!ian, or c/o Cygnus Support,
+48 Grove Street, Somerville, MA, 02144, USA.
This package is covered by the Gnu Library General Public License.
See the file COPYING.LIB for details. If you would like to do
diff --git a/gnu/libexec/uucp/libuuconf/addblk.c b/gnu/libexec/uucp/libuuconf/addblk.c
index 66ed095..30cb07e 100644
--- a/gnu/libexec/uucp/libuuconf/addblk.c
+++ b/gnu/libexec/uucp/libuuconf/addblk.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_addblk_rcsid[] = "$Id: addblk.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_addblk_rcsid[] = "$Id: addblk.c,v 1.5 1995/06/21 19:21:23 ian Rel $";
#endif
#include "alloc.h"
diff --git a/gnu/libexec/uucp/libuuconf/addstr.c b/gnu/libexec/uucp/libuuconf/addstr.c
index be372b2..dfc479b 100644
--- a/gnu/libexec/uucp/libuuconf/addstr.c
+++ b/gnu/libexec/uucp/libuuconf/addstr.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_addstr_rcsid[] = "$Id: addstr.c,v 1.5 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_addstr_rcsid[] = "$Id: addstr.c,v 1.7 1995/06/21 19:21:26 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/allblk.c b/gnu/libexec/uucp/libuuconf/allblk.c
index 54d80b0..91bbe31 100644
--- a/gnu/libexec/uucp/libuuconf/allblk.c
+++ b/gnu/libexec/uucp/libuuconf/allblk.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_allblk_rcsid[] = "$Id: allblk.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_allblk_rcsid[] = "$Id: allblk.c,v 1.5 1995/06/21 19:21:28 ian Rel $";
#endif
#include "alloc.h"
diff --git a/gnu/libexec/uucp/libuuconf/alloc.c b/gnu/libexec/uucp/libuuconf/alloc.c
index 8bd86dc..5a08b76 100644
--- a/gnu/libexec/uucp/libuuconf/alloc.c
+++ b/gnu/libexec/uucp/libuuconf/alloc.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_alloc_rcsid[] = "$Id: alloc.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_alloc_rcsid[] = "$Id: alloc.c,v 1.5 1995/06/21 19:21:31 ian Rel $";
#endif
#include "alloc.h"
diff --git a/gnu/libexec/uucp/libuuconf/alloc.h b/gnu/libexec/uucp/libuuconf/alloc.h
index d6949ab..d35e0fb 100644
--- a/gnu/libexec/uucp/libuuconf/alloc.h
+++ b/gnu/libexec/uucp/libuuconf/alloc.h
@@ -17,10 +17,10 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
/* This header file is private to the uuconf memory allocation
diff --git a/gnu/libexec/uucp/libuuconf/base.c b/gnu/libexec/uucp/libuuconf/base.c
index e48e555..829d965 100644
--- a/gnu/libexec/uucp/libuuconf/base.c
+++ b/gnu/libexec/uucp/libuuconf/base.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_base_rcsid[] = "$Id: base.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_base_rcsid[] = "$Id: base.c,v 1.5 1995/06/21 19:21:36 ian Rel $";
#endif
/* This turns a cmdtab_offset table into a uuconf_cmdtab table. Each
diff --git a/gnu/libexec/uucp/libuuconf/bool.c b/gnu/libexec/uucp/libuuconf/bool.c
index f05c0fa..be56d6a 100644
--- a/gnu/libexec/uucp/libuuconf/bool.c
+++ b/gnu/libexec/uucp/libuuconf/bool.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_bool_rcsid[] = "$Id: bool.c,v 1.2 1994/05/07 18:11:58 ache Exp $";
+const char _uuconf_bool_rcsid[] = "$Id: bool.c,v 1.5 1995/06/21 19:21:39 ian Rel $";
#endif
/* Parse a boolean string into a variable. This is called by
@@ -61,4 +61,4 @@ _uuconf_iboolean (qglobal, zval, pi)
}
return UUCONF_CMDTABRET_CONTINUE;
-}
+}
diff --git a/gnu/libexec/uucp/libuuconf/callin.c b/gnu/libexec/uucp/libuuconf/callin.c
index 017a0bb..4e04707 100644
--- a/gnu/libexec/uucp/libuuconf/callin.c
+++ b/gnu/libexec/uucp/libuuconf/callin.c
@@ -1,7 +1,7 @@
/* callin.c
Check a login name and password against the UUCP password file.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_callin_rcsid[] = "$Id: callin.c,v 1.2 1994/05/07 18:11:58 ache Exp $";
+const char _uuconf_callin_rcsid[] = "$Id: callin.c,v 1.11 1995/06/21 19:21:42 ian Rel $";
#endif
#include <errno.h>
@@ -109,20 +109,31 @@ uuconf_callin (pglobal, pcmpfn, pinfo)
while (getline (&zline, &cline, e) > 0)
{
- char *zcolon;
+ char *z0, *z1;
++qglobal->ilineno;
- /* Turn the first two colon characters into spaces. This is
- a hack to make Unix style passwd files work. */
- zcolon = strchr (zline, ':');
- if (zcolon != NULL)
+ /* We have a few hacks to make Unix style passwd files work.
+ 1) We turn the first two colon characters into spaces.
+ 2) If the colon characters are adjacent, we assume there
+ is no password, and we skip the entry.
+ 3) If the password between colon characters contains a
+ space, we assume that it has been disabled, and we
+ skip the entry. */
+ z0 = strchr (zline, ':');
+ if (z0 != NULL)
{
- *zcolon = ' ';
- zcolon = strchr (zcolon, ':');
- if (zcolon != NULL)
- *zcolon = ' ';
- }
+ *z0 = ' ';
+ z1 = strchr (z0, ':');
+ if (z1 != NULL)
+ {
+ if (z1 - z0 == 1)
+ continue;
+ *z1 = '\0';
+ if (strchr (z0 + 1, ' ') != NULL)
+ continue;
+ }
+ }
iret = uuconf_cmd_line (pglobal, zline, as, (pointer) &s,
ipcheck, 0, (pointer) NULL);
if ((iret & UUCONF_CMDTABRET_EXIT) != 0)
diff --git a/gnu/libexec/uucp/libuuconf/calout.c b/gnu/libexec/uucp/libuuconf/calout.c
index 0cfb302..4b225a9 100644
--- a/gnu/libexec/uucp/libuuconf/calout.c
+++ b/gnu/libexec/uucp/libuuconf/calout.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_calout_rcsid[] = "$Id: calout.c,v 1.2 1994/05/07 18:12:00 ache Exp $";
+const char _uuconf_calout_rcsid[] = "$Id: calout.c,v 1.6 1995/06/21 19:21:45 ian Rel $";
#endif
#include <errno.h>
@@ -61,7 +61,7 @@ uuconf_callout (pglobal, qsys, pzlog, pzpass)
|| (qsys->uuconf_zcall_password != NULL
&& strcmp (qsys->uuconf_zcall_password, "*") == 0))
return UUCONF_NOT_FOUND;
-
+
if (qsys->uuconf_zcall_login != NULL)
{
*pzlog = strdup (qsys->uuconf_zcall_login);
diff --git a/gnu/libexec/uucp/libuuconf/chatc.c b/gnu/libexec/uucp/libuuconf/chatc.c
index 6b5faed..48d0f4f 100644
--- a/gnu/libexec/uucp/libuuconf/chatc.c
+++ b/gnu/libexec/uucp/libuuconf/chatc.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_chatc_rcsid[] = "$Id: chatc.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_chatc_rcsid[] = "$Id: chatc.c,v 1.6 1995/06/21 19:21:48 ian Rel $";
#endif
#include <ctype.h>
diff --git a/gnu/libexec/uucp/libuuconf/cmdarg.c b/gnu/libexec/uucp/libuuconf/cmdarg.c
index ff4a80e..fd7dd40 100644
--- a/gnu/libexec/uucp/libuuconf/cmdarg.c
+++ b/gnu/libexec/uucp/libuuconf/cmdarg.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_cmdarg_rcsid[] = "$Id: cmdarg.c,v 1.2 1994/05/07 18:12:02 ache Exp $";
+const char _uuconf_cmdarg_rcsid[] = "$Id: cmdarg.c,v 1.6 1995/06/21 19:21:50 ian Rel $";
#endif
#include <ctype.h>
@@ -141,7 +141,7 @@ uuconf_cmd_args (pglobal, cargs, pzargs, qtab, pinfo, pfiunknown, iflags,
{
char ***ppz = (char ***) q->uuconf_pvar;
int iret;
-
+
*ppz = NULL;
iret = _uuconf_iadd_string (qglobal, (char *) NULL, FALSE, FALSE,
ppz, pblock);
diff --git a/gnu/libexec/uucp/libuuconf/cmdfil.c b/gnu/libexec/uucp/libuuconf/cmdfil.c
index 6d6dd72..cb8782b 100644
--- a/gnu/libexec/uucp/libuuconf/cmdfil.c
+++ b/gnu/libexec/uucp/libuuconf/cmdfil.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_cmdfil_rcsid[] = "$Id: cmdfil.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_cmdfil_rcsid[] = "$Id: cmdfil.c,v 1.6 1995/06/21 19:21:53 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/cmdlin.c b/gnu/libexec/uucp/libuuconf/cmdlin.c
index 736dd0c..4aaea0b 100644
--- a/gnu/libexec/uucp/libuuconf/cmdlin.c
+++ b/gnu/libexec/uucp/libuuconf/cmdlin.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_cmdlin_rcsid[] = "$Id: cmdlin.c,v 1.2 1994/05/07 18:12:04 ache Exp $";
+const char _uuconf_cmdlin_rcsid[] = "$Id: cmdlin.c,v 1.6 1995/06/21 19:21:55 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/debfil.c b/gnu/libexec/uucp/libuuconf/debfil.c
index b4fd46c..9ce9146 100644
--- a/gnu/libexec/uucp/libuuconf/debfil.c
+++ b/gnu/libexec/uucp/libuuconf/debfil.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_debfil_rcsid[] = "$Id: debfil.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_debfil_rcsid[] = "$Id: debfil.c,v 1.6 1995/06/21 19:21:57 ian Rel $";
#endif
/* Get the name of the UUCP debugging file. */
diff --git a/gnu/libexec/uucp/libuuconf/deblev.c b/gnu/libexec/uucp/libuuconf/deblev.c
index 926ab52..8a52e96 100644
--- a/gnu/libexec/uucp/libuuconf/deblev.c
+++ b/gnu/libexec/uucp/libuuconf/deblev.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_deblev_rcsid[] = "$Id: deblev.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_deblev_rcsid[] = "$Id: deblev.c,v 1.5 1995/06/21 19:22:00 ian Rel $";
#endif
/* Get the UUCP debugging level. */
diff --git a/gnu/libexec/uucp/libuuconf/diacod.c b/gnu/libexec/uucp/libuuconf/diacod.c
index f90568c..8c3cf4f 100644
--- a/gnu/libexec/uucp/libuuconf/diacod.c
+++ b/gnu/libexec/uucp/libuuconf/diacod.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_diacod_rcsid[] = "$Id: diacod.c,v 1.7 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_diacod_rcsid[] = "$Id: diacod.c,v 1.9 1995/06/21 19:22:03 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/dial.c b/gnu/libexec/uucp/libuuconf/dial.c
index 0709d12..1106027 100644
--- a/gnu/libexec/uucp/libuuconf/dial.c
+++ b/gnu/libexec/uucp/libuuconf/dial.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_dial_rcsid[] = "$Id: dial.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_dial_rcsid[] = "$Id: dial.c,v 1.6 1995/06/21 19:22:06 ian Rel $";
#endif
/* Find a dialer by name. */
diff --git a/gnu/libexec/uucp/libuuconf/diasub.c b/gnu/libexec/uucp/libuuconf/diasub.c
index b87bde5..1375199 100644
--- a/gnu/libexec/uucp/libuuconf/diasub.c
+++ b/gnu/libexec/uucp/libuuconf/diasub.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_diasub_rcsid[] = "$Id: diasub.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_diasub_rcsid[] = "$Id: diasub.c,v 1.6 1995/06/21 19:22:08 ian Rel $";
#endif
/* Clear the information in a dialer. */
diff --git a/gnu/libexec/uucp/libuuconf/dnams.c b/gnu/libexec/uucp/libuuconf/dnams.c
index a498534..0848123 100644
--- a/gnu/libexec/uucp/libuuconf/dnams.c
+++ b/gnu/libexec/uucp/libuuconf/dnams.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_dnams_rcsid[] = "$Id: dnams.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_dnams_rcsid[] = "$Id: dnams.c,v 1.5 1995/06/21 19:22:10 ian Rel $";
#endif
/* Get all known dialer names. */
diff --git a/gnu/libexec/uucp/libuuconf/errno.c b/gnu/libexec/uucp/libuuconf/errno.c
index d0e1cac..8b0d0c3 100644
--- a/gnu/libexec/uucp/libuuconf/errno.c
+++ b/gnu/libexec/uucp/libuuconf/errno.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_errno_rcsid[] = "$Id: errno.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_errno_rcsid[] = "$Id: errno.c,v 1.5 1995/06/21 19:22:13 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/errstr.c b/gnu/libexec/uucp/libuuconf/errstr.c
index 94e179e..6a36acc 100644
--- a/gnu/libexec/uucp/libuuconf/errstr.c
+++ b/gnu/libexec/uucp/libuuconf/errstr.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_errstr_rcsid[] = "$Id: errstr.c,v 1.2 1994/05/07 18:12:12 ache Exp $";
+const char _uuconf_errstr_rcsid[] = "$Id: errstr.c,v 1.5 1995/06/21 19:22:17 ian Rel $";
#endif
static char *zeprint_num P((char *zbuf, size_t cbuf, int ival));
@@ -177,7 +177,7 @@ uuconf_error_string (pglobal, ierr, zbuf, cbuf)
--cbuf;
}
}
-
+
if (cbuf > 0 && cfile > 0)
{
*zbuf++ = ' ';
diff --git a/gnu/libexec/uucp/libuuconf/filnam.c b/gnu/libexec/uucp/libuuconf/filnam.c
index 4e126b4..ad9380b 100644
--- a/gnu/libexec/uucp/libuuconf/filnam.c
+++ b/gnu/libexec/uucp/libuuconf/filnam.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_filnam_rcsid[] = "$Id: filnam.c,v 1.4 1994/03/30 04:00:35 ian Rel $";
+const char _uuconf_filnam_rcsid[] = "$Id: filnam.c,v 1.6 1995/06/21 19:22:20 ian Rel $";
#endif
/* Return the saved file name. */
diff --git a/gnu/libexec/uucp/libuuconf/freblk.c b/gnu/libexec/uucp/libuuconf/freblk.c
index 894c26a..bbd0913 100644
--- a/gnu/libexec/uucp/libuuconf/freblk.c
+++ b/gnu/libexec/uucp/libuuconf/freblk.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_freblk_rcsid[] = "$Id: freblk.c,v 1.5 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_freblk_rcsid[] = "$Id: freblk.c,v 1.7 1995/06/21 19:22:23 ian Rel $";
#endif
#include "alloc.h"
diff --git a/gnu/libexec/uucp/libuuconf/fredia.c b/gnu/libexec/uucp/libuuconf/fredia.c
index a2bf8a4..2bc6573 100644
--- a/gnu/libexec/uucp/libuuconf/fredia.c
+++ b/gnu/libexec/uucp/libuuconf/fredia.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_fredia_rcsid[] = "$Id: fredia.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_fredia_rcsid[] = "$Id: fredia.c,v 1.5 1995/06/21 19:22:26 ian Rel $";
#endif
/* Free the memory allocated for a dialer. */
diff --git a/gnu/libexec/uucp/libuuconf/free.c b/gnu/libexec/uucp/libuuconf/free.c
index b8204fc..3ea45f9 100644
--- a/gnu/libexec/uucp/libuuconf/free.c
+++ b/gnu/libexec/uucp/libuuconf/free.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_free_rcsid[] = "$Id: free.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_free_rcsid[] = "$Id: free.c,v 1.6 1995/06/21 19:22:30 ian Rel $";
#endif
#include "alloc.h"
diff --git a/gnu/libexec/uucp/libuuconf/freprt.c b/gnu/libexec/uucp/libuuconf/freprt.c
index d7e58ae..399927b 100644
--- a/gnu/libexec/uucp/libuuconf/freprt.c
+++ b/gnu/libexec/uucp/libuuconf/freprt.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_freprt_rcsid[] = "$Id: freprt.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_freprt_rcsid[] = "$Id: freprt.c,v 1.5 1995/06/21 19:22:33 ian Rel $";
#endif
/* Free the memory allocated for a port. */
diff --git a/gnu/libexec/uucp/libuuconf/fresys.c b/gnu/libexec/uucp/libuuconf/fresys.c
index 1357031..e367543 100644
--- a/gnu/libexec/uucp/libuuconf/fresys.c
+++ b/gnu/libexec/uucp/libuuconf/fresys.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_fresys_rcsid[] = "$Id: fresys.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_fresys_rcsid[] = "$Id: fresys.c,v 1.5 1995/06/21 19:22:36 ian Rel $";
#endif
/* Free the memory allocated for a system. */
diff --git a/gnu/libexec/uucp/libuuconf/grdcmp.c b/gnu/libexec/uucp/libuuconf/grdcmp.c
index af5f26a..39ddd0b 100644
--- a/gnu/libexec/uucp/libuuconf/grdcmp.c
+++ b/gnu/libexec/uucp/libuuconf/grdcmp.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_grdcmp_rcsid[] = "$Id: grdcmp.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_grdcmp_rcsid[] = "$Id: grdcmp.c,v 1.5 1995/06/21 19:22:39 ian Rel $";
#endif
#include <ctype.h>
diff --git a/gnu/libexec/uucp/libuuconf/hdial.c b/gnu/libexec/uucp/libuuconf/hdial.c
index 85777d7..603aa12 100644
--- a/gnu/libexec/uucp/libuuconf/hdial.c
+++ b/gnu/libexec/uucp/libuuconf/hdial.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hdial_rcsid[] = "$Id: hdial.c,v 1.2 1994/05/07 18:12:20 ache Exp $";
+const char _uuconf_hdial_rcsid[] = "$Id: hdial.c,v 1.6 1995/06/21 19:22:42 ian Rel $";
#endif
#include <errno.h>
@@ -133,7 +133,7 @@ uuconf_hdb_dialer_info (pglobal, zname, qdialer)
bnext = *zsubs;
while (bnext != '\0')
{
- if (bnext == '=')
+ if (bnext == '=')
qdialer->uuconf_zdialtone = zsubs + 1;
else if (bnext == '-')
qdialer->uuconf_zpause = zsubs + 1;
diff --git a/gnu/libexec/uucp/libuuconf/hdnams.c b/gnu/libexec/uucp/libuuconf/hdnams.c
index 480c50d..be71feb 100644
--- a/gnu/libexec/uucp/libuuconf/hdnams.c
+++ b/gnu/libexec/uucp/libuuconf/hdnams.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hdnams_rcsid[] = "$Id: hdnams.c,v 1.2 1994/05/07 18:12:21 ache Exp $";
+const char _uuconf_hdnams_rcsid[] = "$Id: hdnams.c,v 1.6 1995/06/21 19:22:48 ian Rel $";
#endif
#include <errno.h>
@@ -65,7 +65,7 @@ uuconf_hdb_dialer_names (pglobal, ppzdialers)
iret = UUCONF_FOPEN_FAILED | UUCONF_ERROR_ERRNO;
break;
}
-
+
qglobal->ilineno = 0;
while (_uuconf_getline (qglobal, &zline, &cline, e) > 0)
diff --git a/gnu/libexec/uucp/libuuconf/hinit.c b/gnu/libexec/uucp/libuuconf/hinit.c
index 5fbb665..808862d 100644
--- a/gnu/libexec/uucp/libuuconf/hinit.c
+++ b/gnu/libexec/uucp/libuuconf/hinit.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hinit_rcsid[] = "$Id: hinit.c,v 1.2 1994/05/07 18:12:23 ache Exp $";
+const char _uuconf_hinit_rcsid[] = "$Id: hinit.c,v 1.8 1995/06/21 19:22:51 ian Rel $";
#endif
#include <errno.h>
@@ -165,7 +165,7 @@ uuconf_hdb_init (ppglobal, zprogram)
{
char ***ppz;
int cfiles, ifile;
-
+
if (strncmp (pzargs[i], "systems=", sizeof "systems=" - 1)
== 0)
{
diff --git a/gnu/libexec/uucp/libuuconf/hlocnm.c b/gnu/libexec/uucp/libuuconf/hlocnm.c
index d94ce77..f2222a2 100644
--- a/gnu/libexec/uucp/libuuconf/hlocnm.c
+++ b/gnu/libexec/uucp/libuuconf/hlocnm.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hlocnm_rcsid[] = "$Id: hlocnm.c,v 1.5 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_hlocnm_rcsid[] = "$Id: hlocnm.c,v 1.7 1995/06/21 19:22:55 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/hport.c b/gnu/libexec/uucp/libuuconf/hport.c
index fb0cd95..cf4b206 100644
--- a/gnu/libexec/uucp/libuuconf/hport.c
+++ b/gnu/libexec/uucp/libuuconf/hport.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hport_rcsid[] = "$Id: hport.c,v 1.11 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_hport_rcsid[] = "$Id: hport.c,v 1.14 1995/06/21 19:22:58 ian Rel $";
#endif
#include <errno.h>
@@ -334,6 +334,8 @@ uuconf_hdb_find_port (pglobal, zname, ibaud, ihighbaud, pifn, pinfo, qport)
qport->uuconf_palloc = pblock;
+ iret = UUCONF_SUCCESS;
+
break;
}
diff --git a/gnu/libexec/uucp/libuuconf/hrmunk.c b/gnu/libexec/uucp/libuuconf/hrmunk.c
index 1e39b8c..d06f67d 100644
--- a/gnu/libexec/uucp/libuuconf/hrmunk.c
+++ b/gnu/libexec/uucp/libuuconf/hrmunk.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hrmunk_rcsid[] = "$Id: hrmunk.c,v 1.2 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_hrmunk_rcsid[] = "$Id: hrmunk.c,v 1.4 1995/06/21 19:23:00 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/hsinfo.c b/gnu/libexec/uucp/libuuconf/hsinfo.c
index d9ad790..6520566 100644
--- a/gnu/libexec/uucp/libuuconf/hsinfo.c
+++ b/gnu/libexec/uucp/libuuconf/hsinfo.c
@@ -1,7 +1,7 @@
/* hsinfo.c
Get information about a system from the HDB configuration files.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hsinfo_rcsid[] = "$Id: hsinfo.c,v 1.2 1994/05/07 18:12:27 ache Exp $";
+const char _uuconf_hsinfo_rcsid[] = "$Id: hsinfo.c,v 1.14 1995/06/21 19:23:03 ian Rel $";
#endif
#include <errno.h>
@@ -256,6 +256,13 @@ _uuconf_ihdb_system_internal (qglobal, zsystem, qsys)
cretry, _uuconf_itime_grade_cmp,
&qset->uuconf_qtimegrade,
pblock);
+
+ /* We treat a syntax error in the time field as
+ equivalent to ``never'', on the assumption that that
+ is what HDB does. */
+ if (iret == UUCONF_SYNTAX_ERROR)
+ iret = UUCONF_SUCCESS;
+
if (iret != UUCONF_SUCCESS)
break;
@@ -343,7 +350,7 @@ _uuconf_ihdb_system_internal (qglobal, zsystem, qsys)
if (iret != UUCONF_SUCCESS)
break;
}
-
+
(void) fclose (e);
if (iret != UUCONF_SUCCESS)
diff --git a/gnu/libexec/uucp/libuuconf/hsnams.c b/gnu/libexec/uucp/libuuconf/hsnams.c
index 476835e..98b2345 100644
--- a/gnu/libexec/uucp/libuuconf/hsnams.c
+++ b/gnu/libexec/uucp/libuuconf/hsnams.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hsnams_rcsid[] = "$Id: hsnams.c,v 1.2 1994/05/07 18:12:28 ache Exp $";
+const char _uuconf_hsnams_rcsid[] = "$Id: hsnams.c,v 1.6 1995/06/21 19:23:06 ian Rel $";
#endif
#include <errno.h>
@@ -67,7 +67,7 @@ uuconf_hdb_system_names (pglobal, ppzsystems, falias)
iret = UUCONF_FOPEN_FAILED | UUCONF_ERROR_ERRNO;
break;
}
-
+
qglobal->ilineno = 0;
while (_uuconf_getline (qglobal, &zline, &cline, e) > 0)
diff --git a/gnu/libexec/uucp/libuuconf/hsys.c b/gnu/libexec/uucp/libuuconf/hsys.c
index 16be3b9..ef2d5ed 100644
--- a/gnu/libexec/uucp/libuuconf/hsys.c
+++ b/gnu/libexec/uucp/libuuconf/hsys.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hsys_rcsid[] = "$Id: hsys.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_hsys_rcsid[] = "$Id: hsys.c,v 1.5 1995/06/21 19:23:08 ian Rel $";
#endif
/* Get system information from the HDB configuration files. This is a
diff --git a/gnu/libexec/uucp/libuuconf/hunk.c b/gnu/libexec/uucp/libuuconf/hunk.c
index cfc79bb..e43a278 100644
--- a/gnu/libexec/uucp/libuuconf/hunk.c
+++ b/gnu/libexec/uucp/libuuconf/hunk.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_hunk_rcsid[] = "$Id: hunk.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_hunk_rcsid[] = "$Id: hunk.c,v 1.6 1995/06/21 19:23:11 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/iniglb.c b/gnu/libexec/uucp/libuuconf/iniglb.c
index fa8e796..8968426 100644
--- a/gnu/libexec/uucp/libuuconf/iniglb.c
+++ b/gnu/libexec/uucp/libuuconf/iniglb.c
@@ -1,7 +1,7 @@
/* iniglb.c
Initialize the global information structure.
- Copyright (C) 1992, 1994 Ian Lance Taylor
+ Copyright (C) 1992, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_iniglb_rcsid[] = "$Id: iniglb.c,v 1.8 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_iniglb_rcsid[] = "$Id: iniglb.c,v 1.11 1995/06/28 14:38:23 ian Rel $";
#endif
#include <errno.h>
@@ -83,6 +83,8 @@ _uuconf_iinit_global (pqglobal)
qprocess->zstatsfile = STATFILE;
qprocess->zdebugfile = DEBUGFILE;
qprocess->zdebug = "";
+ qprocess->fstrip_login = TRUE;
+ qprocess->fstrip_proto = TRUE;
qprocess->cmaxuuxqts = 0;
qprocess->zrunuuxqt = NULL;
qprocess->fv2 = TRUE;
diff --git a/gnu/libexec/uucp/libuuconf/init.c b/gnu/libexec/uucp/libuuconf/init.c
index 4c4ef84..e8bda30 100644
--- a/gnu/libexec/uucp/libuuconf/init.c
+++ b/gnu/libexec/uucp/libuuconf/init.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_init_rcsid[] = "$Id: init.c,v 1.5 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_init_rcsid[] = "$Id: init.c,v 1.7 1995/06/21 19:23:16 ian Rel $";
#endif
/* Initialize the UUCP configuration file reading routines. This is
diff --git a/gnu/libexec/uucp/libuuconf/int.c b/gnu/libexec/uucp/libuuconf/int.c
index 1639006..1fc8d59 100644
--- a/gnu/libexec/uucp/libuuconf/int.c
+++ b/gnu/libexec/uucp/libuuconf/int.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_int_rcsid[] = "$Id: int.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_int_rcsid[] = "$Id: int.c,v 1.6 1995/06/21 19:23:19 ian Rel $";
#endif
/* Parse a string into a variable. This is called by uuconf_cmd_args,
diff --git a/gnu/libexec/uucp/libuuconf/lckdir.c b/gnu/libexec/uucp/libuuconf/lckdir.c
index d0be913..28b4e94 100644
--- a/gnu/libexec/uucp/libuuconf/lckdir.c
+++ b/gnu/libexec/uucp/libuuconf/lckdir.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_lckdir_rcsid[] = "$Id: lckdir.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_lckdir_rcsid[] = "$Id: lckdir.c,v 1.5 1995/06/21 19:23:22 ian Rel $";
#endif
/* Get the name of the UUCP lock directory. */
diff --git a/gnu/libexec/uucp/libuuconf/lineno.c b/gnu/libexec/uucp/libuuconf/lineno.c
index e959814..a5f32f1 100644
--- a/gnu/libexec/uucp/libuuconf/lineno.c
+++ b/gnu/libexec/uucp/libuuconf/lineno.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_lineno_rcsid[] = "$Id: lineno.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_lineno_rcsid[] = "$Id: lineno.c,v 1.5 1995/06/21 19:23:24 ian Rel $";
#endif
/* Return the saved line number. */
diff --git a/gnu/libexec/uucp/libuuconf/llocnm.c b/gnu/libexec/uucp/libuuconf/llocnm.c
index 96ae75e..540fc5b 100644
--- a/gnu/libexec/uucp/libuuconf/llocnm.c
+++ b/gnu/libexec/uucp/libuuconf/llocnm.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_llocnm_rcsid[] = "$Id: llocnm.c,v 1.6 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_llocnm_rcsid[] = "$Id: llocnm.c,v 1.8 1995/06/21 19:23:27 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/local.c b/gnu/libexec/uucp/libuuconf/local.c
index 64593ca..3dfef4c 100644
--- a/gnu/libexec/uucp/libuuconf/local.c
+++ b/gnu/libexec/uucp/libuuconf/local.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_local_rcsid[] = "$Id: local.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_local_rcsid[] = "$Id: local.c,v 1.6 1995/06/21 19:23:29 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/locnm.c b/gnu/libexec/uucp/libuuconf/locnm.c
index 4309387..87616f6 100644
--- a/gnu/libexec/uucp/libuuconf/locnm.c
+++ b/gnu/libexec/uucp/libuuconf/locnm.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_locnm_rcsid[] = "$Id: locnm.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_locnm_rcsid[] = "$Id: locnm.c,v 1.6 1995/06/21 19:23:31 ian Rel $";
#endif
/* Get the local node name. */
diff --git a/gnu/libexec/uucp/libuuconf/logfil.c b/gnu/libexec/uucp/libuuconf/logfil.c
index f2f2695..e2571ff 100644
--- a/gnu/libexec/uucp/libuuconf/logfil.c
+++ b/gnu/libexec/uucp/libuuconf/logfil.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_logfil_rcsid[] = "$Id: logfil.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_logfil_rcsid[] = "$Id: logfil.c,v 1.5 1995/06/21 19:23:34 ian Rel $";
#endif
/* Get the name of the UUCP log file. */
diff --git a/gnu/libexec/uucp/libuuconf/maxuxq.c b/gnu/libexec/uucp/libuuconf/maxuxq.c
index 852f7e3..6aebca6 100644
--- a/gnu/libexec/uucp/libuuconf/maxuxq.c
+++ b/gnu/libexec/uucp/libuuconf/maxuxq.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_maxuxq_rcsid[] = "$Id: maxuxq.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_maxuxq_rcsid[] = "$Id: maxuxq.c,v 1.6 1995/06/21 19:23:36 ian Rel $";
#endif
/* Get the maximum number of simultaneous uuxqt executions. When
diff --git a/gnu/libexec/uucp/libuuconf/mrgblk.c b/gnu/libexec/uucp/libuuconf/mrgblk.c
index 713e240..6e9292e 100644
--- a/gnu/libexec/uucp/libuuconf/mrgblk.c
+++ b/gnu/libexec/uucp/libuuconf/mrgblk.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_mrgblk_rcsid[] = "$Id: mrgblk.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_mrgblk_rcsid[] = "$Id: mrgblk.c,v 1.5 1995/06/21 19:23:38 ian Rel $";
#endif
#include "alloc.h"
diff --git a/gnu/libexec/uucp/libuuconf/paramc.c b/gnu/libexec/uucp/libuuconf/paramc.c
index caa76c3..a04bbdb 100644
--- a/gnu/libexec/uucp/libuuconf/paramc.c
+++ b/gnu/libexec/uucp/libuuconf/paramc.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_paramc_rcsid[] = "$Id: paramc.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_paramc_rcsid[] = "$Id: paramc.c,v 1.5 1995/06/21 19:23:41 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/port.c b/gnu/libexec/uucp/libuuconf/port.c
index 63a0550..8b0614e 100644
--- a/gnu/libexec/uucp/libuuconf/port.c
+++ b/gnu/libexec/uucp/libuuconf/port.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_port_rcsid[] = "$Id: port.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_port_rcsid[] = "$Id: port.c,v 1.6 1995/06/21 19:23:43 ian Rel $";
#endif
/* Find a port by name, baud rate, and special purpose function. */
diff --git a/gnu/libexec/uucp/libuuconf/prtsub.c b/gnu/libexec/uucp/libuuconf/prtsub.c
index 8e6dde3..af0d56f 100644
--- a/gnu/libexec/uucp/libuuconf/prtsub.c
+++ b/gnu/libexec/uucp/libuuconf/prtsub.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_prtsub_rcsid[] = "$Id: prtsub.c,v 1.5 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_prtsub_rcsid[] = "$Id: prtsub.c,v 1.7 1995/06/21 19:23:46 ian Rel $";
#endif
/* Clear the information in a port. This can only clear the type
diff --git a/gnu/libexec/uucp/libuuconf/pubdir.c b/gnu/libexec/uucp/libuuconf/pubdir.c
index 0d6f5f1..7507371 100644
--- a/gnu/libexec/uucp/libuuconf/pubdir.c
+++ b/gnu/libexec/uucp/libuuconf/pubdir.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_pubdir_rcsid[] = "$Id: pubdir.c,v 1.5 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_pubdir_rcsid[] = "$Id: pubdir.c,v 1.7 1995/06/21 19:23:49 ian Rel $";
#endif
/* Get the name of the UUCP public directory. */
diff --git a/gnu/libexec/uucp/libuuconf/rdlocs.c b/gnu/libexec/uucp/libuuconf/rdlocs.c
index cf6e1b0..3f5da73 100644
--- a/gnu/libexec/uucp/libuuconf/rdlocs.c
+++ b/gnu/libexec/uucp/libuuconf/rdlocs.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_rdlocs_rcsid[] = "$Id: rdlocs.c,v 1.2 1994/05/07 18:12:46 ache Exp $";
+const char _uuconf_rdlocs_rcsid[] = "$Id: rdlocs.c,v 1.7 1995/06/21 19:23:52 ian Rel $";
#endif
#include <errno.h>
@@ -174,7 +174,7 @@ _uuconf_iread_locations (qglobal)
qglobal->qprocess->qsyslocs = si.qlocs;
qglobal->qprocess->qvalidate = si.qvals;
qglobal->qprocess->fread_syslocs = TRUE;
- }
+ }
return iret;
}
diff --git a/gnu/libexec/uucp/libuuconf/rdperm.c b/gnu/libexec/uucp/libuuconf/rdperm.c
index 1d36586..f1ecfd3 100644
--- a/gnu/libexec/uucp/libuuconf/rdperm.c
+++ b/gnu/libexec/uucp/libuuconf/rdperm.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_rdperm_rcsid[] = "$Id: rdperm.c,v 1.7 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_rdperm_rcsid[] = "$Id: rdperm.c,v 1.9 1995/06/21 19:23:54 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/reliab.c b/gnu/libexec/uucp/libuuconf/reliab.c
index 57d238b..f978117 100644
--- a/gnu/libexec/uucp/libuuconf/reliab.c
+++ b/gnu/libexec/uucp/libuuconf/reliab.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_reliab_rcsid[] = "$Id: reliab.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_reliab_rcsid[] = "$Id: reliab.c,v 1.6 1995/06/21 19:23:57 ian Rel $";
#endif
/* Handle the "seven-bit" command for a port or a dialer. The pvar
diff --git a/gnu/libexec/uucp/libuuconf/remunk.c b/gnu/libexec/uucp/libuuconf/remunk.c
index be947b7..913b8ee 100644
--- a/gnu/libexec/uucp/libuuconf/remunk.c
+++ b/gnu/libexec/uucp/libuuconf/remunk.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_remunk_rcsid[] = "$Id: remunk.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_remunk_rcsid[] = "$Id: remunk.c,v 1.5 1995/06/21 19:23:59 ian Rel $";
#endif
/* Get the name of the remote.unknown shell script. */
diff --git a/gnu/libexec/uucp/libuuconf/runuxq.c b/gnu/libexec/uucp/libuuconf/runuxq.c
index 013cca3..f1b7865 100644
--- a/gnu/libexec/uucp/libuuconf/runuxq.c
+++ b/gnu/libexec/uucp/libuuconf/runuxq.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_runuxq_rcsid[] = "$Id: runuxq.c,v 1.3 1994/03/25 04:39:39 ian Rel $";
+const char _uuconf_runuxq_rcsid[] = "$Id: runuxq.c,v 1.5 1995/06/21 19:24:02 ian Rel $";
#endif
/* Return how often to spawn a uuxqt process. This is either a
diff --git a/gnu/libexec/uucp/libuuconf/sinfo.c b/gnu/libexec/uucp/libuuconf/sinfo.c
index 60282a2..121f1de 100644
--- a/gnu/libexec/uucp/libuuconf/sinfo.c
+++ b/gnu/libexec/uucp/libuuconf/sinfo.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_sinfo_rcsid[] = "$Id: sinfo.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_sinfo_rcsid[] = "$Id: sinfo.c,v 1.5 1995/06/21 19:24:04 ian Rel $";
#endif
/* Get information about a particular system. We combine the
diff --git a/gnu/libexec/uucp/libuuconf/snams.c b/gnu/libexec/uucp/libuuconf/snams.c
index 8b24f04..5788db3 100644
--- a/gnu/libexec/uucp/libuuconf/snams.c
+++ b/gnu/libexec/uucp/libuuconf/snams.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_snams_rcsid[] = "$Id: snams.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_snams_rcsid[] = "$Id: snams.c,v 1.5 1995/06/21 19:24:07 ian Rel $";
#endif
/* Get all known system names. */
diff --git a/gnu/libexec/uucp/libuuconf/split.c b/gnu/libexec/uucp/libuuconf/split.c
index 96c1d89..d3d5546 100644
--- a/gnu/libexec/uucp/libuuconf/split.c
+++ b/gnu/libexec/uucp/libuuconf/split.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_split_rcsid[] = "$Id: split.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_split_rcsid[] = "$Id: split.c,v 1.5 1995/06/21 19:24:09 ian Rel $";
#endif
#include <ctype.h>
diff --git a/gnu/libexec/uucp/libuuconf/spool.c b/gnu/libexec/uucp/libuuconf/spool.c
index f56f0d5..8fe4f5a 100644
--- a/gnu/libexec/uucp/libuuconf/spool.c
+++ b/gnu/libexec/uucp/libuuconf/spool.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_spool_rcsid[] = "$Id: spool.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_spool_rcsid[] = "$Id: spool.c,v 1.6 1995/06/21 19:24:11 ian Rel $";
#endif
/* Get the name of the UUCP spool directory. */
diff --git a/gnu/libexec/uucp/libuuconf/stafil.c b/gnu/libexec/uucp/libuuconf/stafil.c
index e02e838..7c6377c 100644
--- a/gnu/libexec/uucp/libuuconf/stafil.c
+++ b/gnu/libexec/uucp/libuuconf/stafil.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_stafil_rcsid[] = "$Id: stafil.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_stafil_rcsid[] = "$Id: stafil.c,v 1.5 1995/06/21 19:24:14 ian Rel $";
#endif
/* Get the name of the UUCP statistics file. */
diff --git a/gnu/libexec/uucp/libuuconf/strip.c b/gnu/libexec/uucp/libuuconf/strip.c
new file mode 100644
index 0000000..fc314a7
--- /dev/null
+++ b/gnu/libexec/uucp/libuuconf/strip.c
@@ -0,0 +1,50 @@
+/* maxuxq.c
+ Get information about what things should be stripped.
+
+ Copyright (C) 1995 Ian Lance Taylor
+
+ This file is part of the Taylor UUCP uuconf library.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License
+ as published by the Free Software Foundation; either version 2 of
+ the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ The author of the program may be contacted at ian@airs.com or
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
+ */
+
+#include "uucnfi.h"
+
+#if USE_RCS_ID
+const char _uuconf_strip_rcsid[] = "$Id: strip.c,v 1.2 1995/06/28 15:43:14 ian Rel $";
+#endif
+
+/* Get information about what types of global information should be
+ stripped. There are currently only two, which we return as a
+ couple of bits. We store them as two separate variables, so we
+ don't need to have a special function to set the values correctly. */
+
+int
+uuconf_strip (pglobal, pistrip)
+ pointer pglobal;
+ int *pistrip;
+{
+ struct sglobal *qglobal = (struct sglobal *) pglobal;
+
+ *pistrip = 0;
+ if (qglobal->qprocess->fstrip_login)
+ *pistrip |= UUCONF_STRIP_LOGIN;
+ if (qglobal->qprocess->fstrip_proto)
+ *pistrip |= UUCONF_STRIP_PROTO;
+ return UUCONF_SUCCESS;
+}
diff --git a/gnu/libexec/uucp/libuuconf/syshdr.h b/gnu/libexec/uucp/libuuconf/syshdr.h
index b5a759f..12d4aa4 100644
--- a/gnu/libexec/uucp/libuuconf/syshdr.h
+++ b/gnu/libexec/uucp/libuuconf/syshdr.h
@@ -17,10 +17,10 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
/* The root directory (used when setting local-send and local-receive
diff --git a/gnu/libexec/uucp/libuuconf/syssub.c b/gnu/libexec/uucp/libuuconf/syssub.c
index 97b5f32..7a98f5d 100644
--- a/gnu/libexec/uucp/libuuconf/syssub.c
+++ b/gnu/libexec/uucp/libuuconf/syssub.c
@@ -1,7 +1,7 @@
/* syssub.c
System information subroutines.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_syssub_rcsid[] = "$Id: syssub.c,v 1.2 1994/05/07 18:12:59 ache Exp $";
+const char _uuconf_syssub_rcsid[] = "$Id: syssub.c,v 1.14 1995/06/21 19:24:20 ian Rel $";
#endif
#include <errno.h>
@@ -80,6 +80,7 @@ const char _uuconf_syssub_rcsid[] = "$Id: syssub.c,v 1.2 1994/05/07 18:12:59 ach
{ \
OP (uuconf_qtimegrade); \
OP (uuconf_qcalltimegrade); \
+ OP (uuconf_qcalledtimegrade); \
OP (uuconf_qcall_local_size); \
OP (uuconf_qcall_remote_size); \
OP (uuconf_qcalled_local_size); \
@@ -451,7 +452,7 @@ _uuconf_isystem_basic_default (qglobal, q)
qglobal->ierrno = errno;
return UUCONF_MALLOC_FAILED | UUCONF_ERROR_ERRNO;
}
-
+
memcpy ((pointer) zdup, (pointer) CMDPATH, sizeof CMDPATH);
pz = NULL;
csplit = 0;
diff --git a/gnu/libexec/uucp/libuuconf/tcalou.c b/gnu/libexec/uucp/libuuconf/tcalou.c
index bc13a60..a41d7ad 100644
--- a/gnu/libexec/uucp/libuuconf/tcalou.c
+++ b/gnu/libexec/uucp/libuuconf/tcalou.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tcalou_rcsid[] = "$Id: tcalou.c,v 1.6 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tcalou_rcsid[] = "$Id: tcalou.c,v 1.8 1995/06/21 19:24:24 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/tdial.c b/gnu/libexec/uucp/libuuconf/tdial.c
index 61f9134..fc2c588 100644
--- a/gnu/libexec/uucp/libuuconf/tdial.c
+++ b/gnu/libexec/uucp/libuuconf/tdial.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tdial_rcsid[] = "$Id: tdial.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tdial_rcsid[] = "$Id: tdial.c,v 1.6 1995/06/21 19:24:26 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/tdialc.c b/gnu/libexec/uucp/libuuconf/tdialc.c
index bac29e4..75cc11c 100644
--- a/gnu/libexec/uucp/libuuconf/tdialc.c
+++ b/gnu/libexec/uucp/libuuconf/tdialc.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tdialc_rcsid[] = "$Id: tdialc.c,v 1.2 1994/05/07 18:13:02 ache Exp $";
+const char _uuconf_tdialc_rcsid[] = "$Id: tdialc.c,v 1.6 1995/06/21 19:24:29 ian Rel $";
#endif
static int idchat P((pointer pglobal, int argc, char **argv, pointer pvar,
@@ -157,7 +157,7 @@ iddtr_toggle (pglobal, argc, argv, pvar, pinfo)
string into a trivial chat script. */
/*ARGSUSED*/
-static int
+static int
idcomplete (pglobal, argc, argv, pvar, pinfo)
pointer pglobal;
int argc;
@@ -192,7 +192,7 @@ idproto_param (pglobal, argc, argv, pvar, pinfo)
struct uuconf_proto_param **pqparam = (struct uuconf_proto_param **) pvar;
struct uuconf_dialer *qdialer = (struct uuconf_dialer *) pinfo;
- return _uuconf_iadd_proto_param (qglobal, argc - 1, argv + 1, pqparam,
+ return _uuconf_iadd_proto_param (qglobal, argc - 1, argv + 1, pqparam,
qdialer->uuconf_palloc);
}
diff --git a/gnu/libexec/uucp/libuuconf/tdnams.c b/gnu/libexec/uucp/libuuconf/tdnams.c
index 191e993..c1f42c6 100644
--- a/gnu/libexec/uucp/libuuconf/tdnams.c
+++ b/gnu/libexec/uucp/libuuconf/tdnams.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tdnams_rcsid[] = "$Id: tdnams.c,v 1.2 1994/05/07 18:13:03 ache Exp $";
+const char _uuconf_tdnams_rcsid[] = "$Id: tdnams.c,v 1.6 1995/06/21 19:24:31 ian Rel $";
#endif
#include <errno.h>
@@ -46,7 +46,7 @@ uuconf_taylor_dialer_names (pglobal, ppzdialers)
struct uuconf_cmdtab as[2];
char **pz;
int iret;
-
+
*ppzdialers = NULL;
as[0].uuconf_zcmd = "dialer";
diff --git a/gnu/libexec/uucp/libuuconf/tgcmp.c b/gnu/libexec/uucp/libuuconf/tgcmp.c
index 3e54a44..2960bdaa 100644
--- a/gnu/libexec/uucp/libuuconf/tgcmp.c
+++ b/gnu/libexec/uucp/libuuconf/tgcmp.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tgcmp_rcsid[] = "$Id: tgcmp.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tgcmp_rcsid[] = "$Id: tgcmp.c,v 1.5 1995/06/21 19:24:34 ian Rel $";
#endif
/* A comparison function to pass to _uuconf_itime_parse. This
diff --git a/gnu/libexec/uucp/libuuconf/thread.c b/gnu/libexec/uucp/libuuconf/thread.c
index 5a7bc7c..a3ee7ae 100644
--- a/gnu/libexec/uucp/libuuconf/thread.c
+++ b/gnu/libexec/uucp/libuuconf/thread.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_thread_rcsid[] = "$Id: thread.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_thread_rcsid[] = "$Id: thread.c,v 1.5 1995/06/21 19:24:37 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/time.c b/gnu/libexec/uucp/libuuconf/time.c
index 4aaafe5..2261164 100644
--- a/gnu/libexec/uucp/libuuconf/time.c
+++ b/gnu/libexec/uucp/libuuconf/time.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_time_rcsid[] = "$Id: time.c,v 1.11 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_time_rcsid[] = "$Id: time.c,v 1.13 1995/06/21 19:24:39 ian Rel $";
#endif
#include <ctype.h>
diff --git a/gnu/libexec/uucp/libuuconf/tinit.c b/gnu/libexec/uucp/libuuconf/tinit.c
index 69767aa..3404dbc 100644
--- a/gnu/libexec/uucp/libuuconf/tinit.c
+++ b/gnu/libexec/uucp/libuuconf/tinit.c
@@ -1,7 +1,7 @@
/* tinit.c
Initialize for reading Taylor UUCP configuration files.
- Copyright (C) 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tinit_rcsid[] = "$Id: tinit.c,v 1.10 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tinit_rcsid[] = "$Id: tinit.c,v 1.13 1995/06/28 14:38:51 ian Rel $";
#endif
#include <errno.h>
@@ -66,6 +66,10 @@ static const struct cmdtab_offset asCmds[] =
offsetof (struct sprocess, zdebugfile), NULL },
{ "debug", UUCONF_CMDTABTYPE_FN | 0,
offsetof (struct sprocess, zdebug), itdebug },
+ { "strip-login", UUCONF_CMDTABTYPE_BOOLEAN,
+ offsetof (struct sprocess, fstrip_login), NULL },
+ { "strip-proto", UUCONF_CMDTABTYPE_BOOLEAN,
+ offsetof (struct sprocess, fstrip_proto), NULL },
{ "max-uuxqts", UUCONF_CMDTABTYPE_INT,
offsetof (struct sprocess, cmaxuuxqts), NULL },
{ "run-uuxqt", UUCONF_CMDTABTYPE_STRING,
diff --git a/gnu/libexec/uucp/libuuconf/tlocnm.c b/gnu/libexec/uucp/libuuconf/tlocnm.c
index 8bb834b..5c15e92 100644
--- a/gnu/libexec/uucp/libuuconf/tlocnm.c
+++ b/gnu/libexec/uucp/libuuconf/tlocnm.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tlocnm_rcsid[] = "$Id: tlocnm.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tlocnm_rcsid[] = "$Id: tlocnm.c,v 1.6 1995/06/21 19:24:45 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/tport.c b/gnu/libexec/uucp/libuuconf/tport.c
index 6e46f48..507b036 100644
--- a/gnu/libexec/uucp/libuuconf/tport.c
+++ b/gnu/libexec/uucp/libuuconf/tport.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tport_rcsid[] = "$Id: tport.c,v 1.7 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tport_rcsid[] = "$Id: tport.c,v 1.9 1995/06/21 19:24:48 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/tportc.c b/gnu/libexec/uucp/libuuconf/tportc.c
index 0a7b0fb..7424408 100644
--- a/gnu/libexec/uucp/libuuconf/tportc.c
+++ b/gnu/libexec/uucp/libuuconf/tportc.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tportc_rcsid[] = "$Id: tportc.c,v 1.2 1994/05/07 18:13:11 ache Exp $";
+const char _uuconf_tportc_rcsid[] = "$Id: tportc.c,v 1.14 1995/06/21 19:24:52 ian Rel $";
#endif
#include <errno.h>
@@ -249,7 +249,7 @@ _uuconf_iport_cmd (qglobal, argc, argv, qport)
if (i >= CPORT_TYPES)
return UUCONF_SYNTAX_ERROR;
-
+
ttype = (enum uuconf_porttype) i;
}
diff --git a/gnu/libexec/uucp/libuuconf/tsinfo.c b/gnu/libexec/uucp/libuuconf/tsinfo.c
index 473e3ff..670cf34 100644
--- a/gnu/libexec/uucp/libuuconf/tsinfo.c
+++ b/gnu/libexec/uucp/libuuconf/tsinfo.c
@@ -1,7 +1,7 @@
/* tsinfo.c
Get information about a system from the Taylor UUCP configuration files.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tsinfo_rcsid[] = "$Id: tsinfo.c,v 1.11 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tsinfo_rcsid[] = "$Id: tsinfo.c,v 1.17 1995/08/11 03:34:37 ian Rel $";
#endif
#include <errno.h>
@@ -99,6 +99,8 @@ static const struct cmdtab_offset asIcmds[] =
offsetof (struct uuconf_system, uuconf_csuccess_wait), NULL },
{ "call-timegrade", UUCONF_CMDTABTYPE_FN | 3,
offsetof (struct uuconf_system, uuconf_qcalltimegrade), iitimegrade },
+ { "called-timegrade", UUCONF_CMDTABTYPE_FN | 3,
+ offsetof (struct uuconf_system, uuconf_qcalledtimegrade), iitimegrade },
{ "call-local-size", UUCONF_CMDTABTYPE_FN | 3,
offsetof (struct uuconf_system, uuconf_qcall_local_size), iisize },
{ "call-remote-size", UUCONF_CMDTABTYPE_FN | 3,
@@ -294,9 +296,19 @@ _uuconf_itaylor_system_internal (qglobal, zsystem, qsys)
iret = _uuconf_isystem_default (qglobal, qsys, &sdefaults,
si.fdefault_alternates);
- /* The first alternate is always available for calling in. */
+ /* The first alternate is always available for calling in. It is
+ always available for calling out if it has some way to choose a
+ port (this would normally be set by uiset_call anyhow, but it
+ won't be if all the port information comes from the defaults). */
if (iret == UUCONF_SUCCESS)
- qsys->uuconf_fcalled = TRUE;
+ {
+ qsys->uuconf_fcalled = TRUE;
+ if (qsys->uuconf_zport != (char *) &_uuconf_unset
+ || qsys->uuconf_qport != (struct uuconf_port *) &_uuconf_unset
+ || qsys->uuconf_ibaud >= 0
+ || qsys->uuconf_zphone != (char *) &_uuconf_unset)
+ qsys->uuconf_fcall = TRUE;
+ }
if (iret != UUCONF_SUCCESS)
{
diff --git a/gnu/libexec/uucp/libuuconf/tsnams.c b/gnu/libexec/uucp/libuuconf/tsnams.c
index 70da76f..a350b15 100644
--- a/gnu/libexec/uucp/libuuconf/tsnams.c
+++ b/gnu/libexec/uucp/libuuconf/tsnams.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tsnams_rcsid[] = "$Id: tsnams.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tsnams_rcsid[] = "$Id: tsnams.c,v 1.5 1995/06/21 19:24:59 ian Rel $";
#endif
/* Get all the system names from the Taylor UUCP configuration files.
diff --git a/gnu/libexec/uucp/libuuconf/tsys.c b/gnu/libexec/uucp/libuuconf/tsys.c
index 86f8203..bf5b343 100644
--- a/gnu/libexec/uucp/libuuconf/tsys.c
+++ b/gnu/libexec/uucp/libuuconf/tsys.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tsys_rcsid[] = "$Id: tsys.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tsys_rcsid[] = "$Id: tsys.c,v 1.5 1995/06/21 19:25:01 ian Rel $";
#endif
/* Get system information from the Taylor UUCP configuration files.
diff --git a/gnu/libexec/uucp/libuuconf/tval.c b/gnu/libexec/uucp/libuuconf/tval.c
index ba3be13..53f0c85 100644
--- a/gnu/libexec/uucp/libuuconf/tval.c
+++ b/gnu/libexec/uucp/libuuconf/tval.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_tval_rcsid[] = "$Id: tval.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_tval_rcsid[] = "$Id: tval.c,v 1.5 1995/06/21 19:25:03 ian Rel $";
#endif
/* Validate a login name for a system using Taylor UUCP configuration
diff --git a/gnu/libexec/uucp/libuuconf/ugtlin.c b/gnu/libexec/uucp/libuuconf/ugtlin.c
index 36a52eb..27d8ab6 100644
--- a/gnu/libexec/uucp/libuuconf/ugtlin.c
+++ b/gnu/libexec/uucp/libuuconf/ugtlin.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_ugtlin_rcsid[] = "$Id: ugtlin.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_ugtlin_rcsid[] = "$Id: ugtlin.c,v 1.6 1995/06/21 19:25:06 ian Rel $";
#endif
/* Read a line from a file with backslash continuations. This updates
diff --git a/gnu/libexec/uucp/libuuconf/unk.c b/gnu/libexec/uucp/libuuconf/unk.c
index 2df924e..ad6c0c8 100644
--- a/gnu/libexec/uucp/libuuconf/unk.c
+++ b/gnu/libexec/uucp/libuuconf/unk.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_unk_rcsid[] = "$Id: unk.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_unk_rcsid[] = "$Id: unk.c,v 1.5 1995/06/21 19:25:08 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/uucnfi.h b/gnu/libexec/uucp/libuuconf/uucnfi.h
index 3bab167..1f42391 100644
--- a/gnu/libexec/uucp/libuuconf/uucnfi.h
+++ b/gnu/libexec/uucp/libuuconf/uucnfi.h
@@ -1,7 +1,7 @@
/* uucnfi.h
Internal header file for the uuconf package.
- Copyright (C) 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,10 +17,10 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
/* This is the internal header file for the uuconf package. It should
@@ -78,6 +78,10 @@ struct sprocess
const char *zdebugfile;
/* The default debugging level. */
const char *zdebug;
+ /* Whether login information should be stripped. */
+ boolean fstrip_login;
+ /* Whether protocol information should be stripped. */
+ boolean fstrip_proto;
/* The maximum number of simultaneously executing uuxqts. */
int cmaxuuxqts;
/* How often to spawn a uuxqt process. */
@@ -150,7 +154,7 @@ struct sunknown
int cargs;
/* Arguments. */
char **pzargs;
-};
+};
/* This structure is used to hold the locations of systems within the
Taylor UUCP sys files. */
diff --git a/gnu/libexec/uucp/libuuconf/val.c b/gnu/libexec/uucp/libuuconf/val.c
index 76dfab3..f406ec2 100644
--- a/gnu/libexec/uucp/libuuconf/val.c
+++ b/gnu/libexec/uucp/libuuconf/val.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_val_rcsid[] = "$Id: val.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_val_rcsid[] = "$Id: val.c,v 1.5 1995/06/21 19:25:13 ian Rel $";
#endif
/* Validate a login name for a system. */
diff --git a/gnu/libexec/uucp/libuuconf/vinit.c b/gnu/libexec/uucp/libuuconf/vinit.c
index 3e2d507..d9c5f97 100644
--- a/gnu/libexec/uucp/libuuconf/vinit.c
+++ b/gnu/libexec/uucp/libuuconf/vinit.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_vinit_rcsid[] = "$Id: vinit.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_vinit_rcsid[] = "$Id: vinit.c,v 1.5 1995/06/21 19:25:16 ian Rel $";
#endif
#include <errno.h>
diff --git a/gnu/libexec/uucp/libuuconf/vport.c b/gnu/libexec/uucp/libuuconf/vport.c
index 5aac382..7846cb9 100644
--- a/gnu/libexec/uucp/libuuconf/vport.c
+++ b/gnu/libexec/uucp/libuuconf/vport.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_vport_rcsid[] = "$Id: vport.c,v 1.2 1994/05/07 18:13:22 ache Exp $";
+const char _uuconf_vport_rcsid[] = "$Id: vport.c,v 1.9 1995/06/21 19:25:19 ian Rel $";
#endif
#include <errno.h>
@@ -100,9 +100,9 @@ uuconf_v2_find_port (pglobal, zname, ibaud, ihighbaud, pifn, pinfo, qport)
}
/* An entry in L-devices is
-
+
type device dial-device baud dialer
-
+
The type (normally "ACU") is treated as the name. */
/* If there aren't enough entries, ignore the line; this
diff --git a/gnu/libexec/uucp/libuuconf/vsinfo.c b/gnu/libexec/uucp/libuuconf/vsinfo.c
index 005efed..6a6875c 100644
--- a/gnu/libexec/uucp/libuuconf/vsinfo.c
+++ b/gnu/libexec/uucp/libuuconf/vsinfo.c
@@ -1,7 +1,7 @@
/* vsinfo.c
Get information about a system from the V2 configuration files.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_vsinfo_rcsid[] = "$Id: vsinfo.c,v 1.2 1994/05/07 18:13:23 ache Exp $";
+const char _uuconf_vsinfo_rcsid[] = "$Id: vsinfo.c,v 1.14 1995/06/21 19:25:24 ian Rel $";
#endif
#include <errno.h>
@@ -210,6 +210,13 @@ _uuconf_iv2_system_internal (qglobal, zsystem, qsys)
_uuconf_itime_grade_cmp,
&qset->uuconf_qtimegrade,
pblock);
+
+ /* We treat a syntax error in the time field as equivalent
+ to ``never'', on the assumption that that is what V2
+ does. */
+ if (iret == UUCONF_SYNTAX_ERROR)
+ iret = UUCONF_SUCCESS;
+
if (iret != UUCONF_SUCCESS)
break;
@@ -501,7 +508,26 @@ _uuconf_iv2_system_internal (qglobal, zsystem, qsys)
++qglobal->ilineno;
zline[strcspn (zline, "#\n")] = '\0';
- if (strncmp (zline, "PATH=", sizeof "PATH=" - 1) == 0)
+
+ while (*zline == '\0')
+ {
+ if (getline (&zline, &cline, e) <= 0)
+ {
+ if (zline != NULL)
+ {
+ free ((pointer) zline);
+ zline = NULL;
+ }
+ }
+ else
+ {
+ ++qglobal->ilineno;
+ zline[strcspn (zline, "#\n")] = '\0';
+ }
+ }
+
+ if (zline != NULL
+ && strncmp (zline, "PATH=", sizeof "PATH=" - 1) == 0)
{
int ctoks;
char **pznew;
@@ -531,7 +557,7 @@ _uuconf_iv2_system_internal (qglobal, zsystem, qsys)
qsys->uuconf_pzpath = pznew;
zline = NULL;
cline = 0;
- }
+ }
if (getline (&zline, &cline, e) < 0)
{
@@ -550,12 +576,15 @@ _uuconf_iv2_system_internal (qglobal, zsystem, qsys)
{
while (TRUE)
{
- zline[strcspn (zline, "#\n")] = '\0';
- iret = _uuconf_iadd_string (qglobal, zline, TRUE, FALSE,
- &qsys->uuconf_pzcmds,
- pblock);
- if (iret != UUCONF_SUCCESS)
- break;
+ zline[strcspn (zline, "#,\n")] = '\0';
+ if (*zline != '\0')
+ {
+ iret = _uuconf_iadd_string (qglobal, zline, TRUE, FALSE,
+ &qsys->uuconf_pzcmds,
+ pblock);
+ if (iret != UUCONF_SUCCESS)
+ break;
+ }
if (getline (&zline, &cline, e) < 0)
break;
++qglobal->ilineno;
diff --git a/gnu/libexec/uucp/libuuconf/vsnams.c b/gnu/libexec/uucp/libuuconf/vsnams.c
index a52cfcf..2d2e4a5 100644
--- a/gnu/libexec/uucp/libuuconf/vsnams.c
+++ b/gnu/libexec/uucp/libuuconf/vsnams.c
@@ -1,7 +1,7 @@
/* vsnams.c
Get all known system names from the V2 configuration files.
- Copyright (C) 1992 Ian Lance Taylor
+ Copyright (C) 1992, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP uuconf library.
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_vsnams_rcsid[] = "$Id: vsnams.c,v 1.4 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_vsnams_rcsid[] = "$Id: vsnams.c,v 1.8 1995/06/21 19:25:26 ian Rel $";
#endif
#include <errno.h>
@@ -68,7 +68,7 @@ uuconf_v2_system_names (pglobal, ppzsystems, falias)
zline = NULL;
cline = 0;
- while (getline (&zline, &cline, e) > 0)
+ while (_uuconf_getline (qglobal, &zline, &cline, e) > 0)
{
char *zname;
diff --git a/gnu/libexec/uucp/libuuconf/vsys.c b/gnu/libexec/uucp/libuuconf/vsys.c
index 4b0a68b..82ac246 100644
--- a/gnu/libexec/uucp/libuuconf/vsys.c
+++ b/gnu/libexec/uucp/libuuconf/vsys.c
@@ -17,16 +17,16 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char _uuconf_vsys_rcsid[] = "$Id: vsys.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
+const char _uuconf_vsys_rcsid[] = "$Id: vsys.c,v 1.5 1995/06/21 19:25:29 ian Rel $";
#endif
/* Get system information from the V2 configuration files. This is a
diff --git a/gnu/libexec/uucp/libuucp/MANIFEST b/gnu/libexec/uucp/libuucp/MANIFEST
index 4fe9c3b..909eb67 100644
--- a/gnu/libexec/uucp/libuucp/MANIFEST
+++ b/gnu/libexec/uucp/libuucp/MANIFEST
@@ -1,28 +1,63 @@
-Makefile.in
+COPYING
+ChangeLog
MANIFEST
-bsrch.c
-buffer.c
-bzero.c
-crc.c
-debug.c
-escape.c
-getlin.c
-getopt.c
-getop1.c
-memchr.c
-memcmp.c
-memcpy.c
-parse.c
-spool.c
-status.c
-strcas.c
-strchr.c
-strdup.c
-strncs.c
-strrch.c
-strstr.c
-strtol.c
-strtou.c
-xfree.c
-xmall.c
-xreall.c
+Makefile.in
+NEWS
+README
+TODO
+chat.c
+config.h.in
+configure
+configure.in
+conn.c
+conn.h
+copy.c
+cu.1
+cu.c
+cu.h
+getopt.h
+install-sh
+log.c
+policy.h
+prot.c
+prot.h
+prote.c
+protf.c
+protg.c
+proti.c
+protj.c
+prott.c
+proty.c
+protz.c
+rec.c
+send.c
+sysh.unx
+system.h
+time.c
+trans.c
+trans.h
+tstuu.c
+util.c
+uuchk.c
+uucico.8
+uucico.c
+uuconf.h
+uuconv.c
+uucp.1
+uucp.c
+uucp.h
+uucp.texi
+uudefs.h
+uudir.c
+uulog.c
+uuname.c
+uupick.c
+uusched.in
+uustat.1
+uustat.c
+uuto.in
+uux.1
+uux.c
+uuxqt.8
+uuxqt.c
+xcmd.c
diff --git a/gnu/libexec/uucp/libuucp/bsrch.c b/gnu/libexec/uucp/libuucp/bsrch.c
index 3b1a61c..58b8710 100644
--- a/gnu/libexec/uucp/libuucp/bsrch.c
+++ b/gnu/libexec/uucp/libuucp/bsrch.c
@@ -13,8 +13,8 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.
+not, write to the Free Software Foundation, Inc., 59 Temple Place -
+Suite 330, Boston, MA 02111-1307, USA.
This file was modified slightly by Ian Lance Taylor, May 1992, for
Taylor UUCP. */
diff --git a/gnu/libexec/uucp/libuucp/buffer.c b/gnu/libexec/uucp/libuucp/buffer.c
index 8ddb221..e33b282 100644
--- a/gnu/libexec/uucp/libuucp/buffer.c
+++ b/gnu/libexec/uucp/libuucp/buffer.c
@@ -17,10 +17,10 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libuucp/crc.c b/gnu/libexec/uucp/libuucp/crc.c
index 323adcb..fc9687b 100644
--- a/gnu/libexec/uucp/libuucp/crc.c
+++ b/gnu/libexec/uucp/libuucp/crc.c
@@ -78,14 +78,14 @@ static const unsigned long aicrc32tab[] = { /* CRC polynomial 0xedb88320 */
};
/*
- * IUPDC32 macro derived from article Copyright (C) 1986 Stephen Satchell.
+ * IUPDC32 macro derived from article Copyright (C) 1986 Stephen Satchell.
* NOTE: First argument must be in range 0 to 255.
* Second argument is referenced twice.
- *
- * Programmers may incorporate any or all code into their programs,
- * giving proper credit within the source. Publication of the
- * source routines is permitted so long as proper credit is given
- * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
+ *
+ * Programmers may incorporate any or all code into their programs,
+ * giving proper credit within the source. Publication of the
+ * source routines is permitted so long as proper credit is given
+ * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
* Omen Technology.
*/
diff --git a/gnu/libexec/uucp/libuucp/debug.c b/gnu/libexec/uucp/libuucp/debug.c
index e722e2c..6ae3063 100644
--- a/gnu/libexec/uucp/libuucp/debug.c
+++ b/gnu/libexec/uucp/libuucp/debug.c
@@ -17,10 +17,10 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
@@ -137,7 +137,9 @@ cdebug_char (z, ichar)
*z++ = b;
*z = '\0';
return 2;
-}
+}
+
+#if DEBUG > 1
/* Display a buffer when debugging. */
@@ -167,3 +169,5 @@ udebug_buffer (zhdr, zbuf, clen)
ubuffree (zalc);
}
+
+#endif
diff --git a/gnu/libexec/uucp/libuucp/escape.c b/gnu/libexec/uucp/libuucp/escape.c
index 261accb..646b787 100644
--- a/gnu/libexec/uucp/libuucp/escape.c
+++ b/gnu/libexec/uucp/libuucp/escape.c
@@ -12,7 +12,7 @@ cescape (z)
char *z;
{
char *zto, *zfrom;
-
+
zto = z;
zfrom = z;
while (*zfrom != '\0')
diff --git a/gnu/libexec/uucp/libuucp/getlin.c b/gnu/libexec/uucp/libuucp/getlin.c
index 983da7d..822bc1c 100644
--- a/gnu/libexec/uucp/libuucp/getlin.c
+++ b/gnu/libexec/uucp/libuucp/getlin.c
@@ -17,10 +17,10 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
diff --git a/gnu/libexec/uucp/libuucp/getop1.c b/gnu/libexec/uucp/libuucp/getop1.c
index 41b9bb4..c7c7383 100644
--- a/gnu/libexec/uucp/libuucp/getop1.c
+++ b/gnu/libexec/uucp/libuucp/getop1.c
@@ -5,15 +5,15 @@
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This file was modified slightly by Ian Lance Taylor, June 1992, for
Taylor UUCP. */
@@ -38,7 +38,7 @@ getopt_long (argc, argv, options, long_options, opt_index)
but does match a short option, it is parsed as a short option
instead. */
-int
+int
getopt_long_only (argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
diff --git a/gnu/libexec/uucp/libuucp/getopt.c b/gnu/libexec/uucp/libuucp/getopt.c
index 8c35f84..eed7d8e 100644
--- a/gnu/libexec/uucp/libuucp/getopt.c
+++ b/gnu/libexec/uucp/libuucp/getopt.c
@@ -9,15 +9,15 @@
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This file was modified slightly by Ian Lance Taylor, June 1992, for
Taylor UUCP. */
@@ -488,7 +488,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (c < 040 || c >= 0177)
fprintf (stderr, "%s: unrecognized option, character code 0%o\n",
- argv[0], (unsigned int) c);
+ argv[0], BUCHAR (c));
else
fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c);
}
diff --git a/gnu/libexec/uucp/libuucp/memchr.c b/gnu/libexec/uucp/libuucp/memchr.c
index fd6eb83..c743154 100644
--- a/gnu/libexec/uucp/libuucp/memchr.c
+++ b/gnu/libexec/uucp/libuucp/memchr.c
@@ -17,8 +17,8 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.
+not, write to the Free Software Foundation, Inc., 59 Temple Place -
+Suite 330, Boston, MA 02111-1307, USA.
This file was modified slightly by Ian Lance Taylor, May 1992, for
Taylor UUCP. It assumes 32 bit longs. I'm willing to trust that any
@@ -53,9 +53,9 @@ memchr (s, c, n)
/* Bits 31, 24, 16, and 8 of this number are zero. Call these bits
the "holes." Note that there is a hole just to the left of
each byte, with an extra at the end:
-
+
bits: 01111110 11111110 11111110 11111111
- bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
+ bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
The 1-bits make sure that carries propagate to the next 0-bit.
The 0-bits provide holes for carries to fall into. */
@@ -108,10 +108,10 @@ memchr (s, c, n)
/* Add MAGIC_BITS to LONGWORD. */
if ((((longword + magic_bits)
-
+
/* Set those bits that were unchanged by the addition. */
^ ~longword)
-
+
/* Look at only the hole bits. If any of the hole bits
are unchanged, most likely one of the bytes was a
zero. */
diff --git a/gnu/libexec/uucp/libuucp/parse.c b/gnu/libexec/uucp/libuucp/parse.c
index d829fa9..da724fc 100644
--- a/gnu/libexec/uucp/libuucp/parse.c
+++ b/gnu/libexec/uucp/libuucp/parse.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char parse_rcsid[] = "$Id: parse.c,v 1.2 1994/05/07 18:13:33 ache Exp $";
+const char parse_rcsid[] = "$Id: parse.c,v 1.8 1995/06/21 19:18:35 ian Rel $";
#endif
#include "uudefs.h"
@@ -104,7 +104,7 @@ fparse_cmd (zcmd, qcmd)
if (z == NULL)
return FALSE;
qcmd->zto = z;
-
+
z = strtok ((char *) NULL, " \t\n");
if (z == NULL)
return FALSE;
@@ -155,7 +155,7 @@ fparse_cmd (zcmd, qcmd)
}
return TRUE;
- }
+ }
z = strtok ((char *) NULL, " \t\n");
if (z == NULL)
@@ -203,7 +203,7 @@ fparse_cmd (zcmd, qcmd)
}
else if (qcmd->bcmd == 'E')
return FALSE;
-
+
if (z != NULL)
{
z = strtok ((char *) NULL, "");
diff --git a/gnu/libexec/uucp/libuucp/strstr.c b/gnu/libexec/uucp/libuucp/strstr.c
index 111460b..2cf1097 100644
--- a/gnu/libexec/uucp/libuucp/strstr.c
+++ b/gnu/libexec/uucp/libuucp/strstr.c
@@ -13,8 +13,8 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.
+not, write to the Free Software Foundation, Inc., 59 Temple Place -
+Suite 330, Boston, MA 02111-1307, USA.
This file was modified slightly by Ian Lance Taylor, May 1992, for
Taylor UUCP. */
diff --git a/gnu/libexec/uucp/libuucp/strtol.c b/gnu/libexec/uucp/libuucp/strtol.c
index f663994..0c6b28c 100644
--- a/gnu/libexec/uucp/libuucp/strtol.c
+++ b/gnu/libexec/uucp/libuucp/strtol.c
@@ -13,8 +13,8 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.
+not, write to the Free Software Foundation, Inc., 59 Temple Place -
+Suite 330, Boston, MA 02111-1307, USA.
This file was modified slightly by Ian Lance Taylor, May 1992, for
Taylor UUCP. */
diff --git a/gnu/libexec/uucp/libuucp/strtou.c b/gnu/libexec/uucp/libuucp/strtou.c
index cd22506..d3c8189 100644
--- a/gnu/libexec/uucp/libuucp/strtou.c
+++ b/gnu/libexec/uucp/libuucp/strtou.c
@@ -13,8 +13,8 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+not, write to the Free Software Foundation, Inc., 59 Temple Place -
+Suite 330, Boston, MA 02111-1307, USA. */
#define UNSIGNED 1
diff --git a/gnu/libexec/uucp/tstuu.c b/gnu/libexec/uucp/tstuu.c
index 3f62975..a4ba862 100644
--- a/gnu/libexec/uucp/tstuu.c
+++ b/gnu/libexec/uucp/tstuu.c
@@ -1,7 +1,7 @@
/* tstuu.c
Test the uucp package on a UNIX system.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char tstuu_rcsid[] = "$Id: tstuu.c,v 1.2 1994/05/07 18:08:16 ache Exp $";
+const char tstuu_rcsid[] = "$Id: tstuu.c,v 1.86 1995/06/29 19:34:59 ian Rel $";
#endif
#include "sysdep.h"
@@ -187,7 +187,7 @@ struct sbuf
int cend;
char ab[BUFCHARS];
};
-
+
/* Local functions. */
static void umake_file P((const char *zfile, int cextra));
@@ -230,6 +230,12 @@ main (argc, argv)
char abpty2[sizeof "/dev/ptyp0"];
struct sbuf *qbuf1, *qbuf2;
+#if ! HAVE_TAYLOR_CONFIG
+ fprintf (stderr, "%s: only works when compiled with HAVE_TAYLOR_CONFIG\n",
+ argv[0]);
+ exit (1);
+#endif
+
zcmd1 = NULL;
zcmd2 = NULL;
zsys = "test2";
@@ -268,7 +274,7 @@ main (argc, argv)
break;
default:
fprintf (stderr,
- "Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ "Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
fprintf (stderr,
"Usage: tstuu [-xn] [-t #] [-u] [-1 cmd] [-2 cmd]\n");
@@ -305,7 +311,7 @@ main (argc, argv)
{
int om, os;
FILE *e;
-
+
sprintf (zptyname, "/dev/pty%c%c", *zpty,
"0123456789abcdef"[ipty]);
om = open (zptyname, O_RDWR);
@@ -755,7 +761,7 @@ umake_file (z, c)
FILE *e;
e = xfopen (z, "w");
-
+
for (i = 0; i < 256; i++)
{
int i2;
@@ -1293,7 +1299,7 @@ cpshow (z, ichar)
sprintf (z, "%03o", (unsigned int)(ichar & 0xff));
return strlen (z) + 1;
}
-}
+}
/* Pick one of two file descriptors which is ready for reading, or
return in five seconds. If the argument is ready for reading,
@@ -1345,7 +1351,7 @@ uchoose (po1, po2)
if ((as[0].revents & POLLIN) == 0)
*po1 = -1;
-
+
if ((as[1].revents & POLLIN) == 0)
*po2 = -1;
@@ -1388,7 +1394,7 @@ cread (o, pqbuf)
(*pqbuf)->cstart = 0;
(*pqbuf)->cend = 0;
}
-
+
cgot = read (o, (*pqbuf)->ab + (*pqbuf)->cend,
(sizeof (*pqbuf)->ab) - (*pqbuf)->cend);
if (cgot < 0)
@@ -1515,7 +1521,7 @@ fsend (o, oslave, pqbuf)
uchild (SIGCHLD);
}
}
-
+
if (cwrote == 0)
break;
diff --git a/gnu/libexec/uucp/uuchk/uuchk.c b/gnu/libexec/uucp/uuchk/uuchk.c
index 8e5c4ff..190fd4b 100644
--- a/gnu/libexec/uucp/uuchk/uuchk.c
+++ b/gnu/libexec/uucp/uuchk/uuchk.c
@@ -1,7 +1,7 @@
/* uuchk.c
Display what we think the permissions of systems are.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uuchk_rcsid[] = "$Id: uuchk.c,v 1.2 1994/05/07 18:13:37 ache Exp $";
+const char uuchk_rcsid[] = "$Id: uuchk.c,v 1.65 1995/07/18 00:59:30 ian Rel $";
#endif
#include "getopt.h"
@@ -70,6 +70,7 @@ static const char *zKprogram;
/* Long getopt options. */
static const struct option asKlongopts[] =
{
+ { "system", required_argument, NULL,'s' },
{ "config", required_argument, NULL, 'I' },
{ "debug", required_argument, NULL, 'x' },
{ "version", no_argument, NULL, 'v' },
@@ -83,19 +84,23 @@ main (argc, argv)
char **argv;
{
int iopt;
- /* The configuration file name. */
+ const char *zsystem = NULL;
const char *zconfig = NULL;
int iret;
pointer puuconf;
- char **pzsystems;
zKprogram = argv[0];
- while ((iopt = getopt_long (argc, argv, "I:vx:", asKlongopts,
+ while ((iopt = getopt_long (argc, argv, "I:s:vx:", asKlongopts,
(int *) NULL)) != EOF)
{
switch (iopt)
{
+ case 's':
+ /* Examine specific system. */
+ zsystem = optarg;
+ break;
+
case 'I':
/* Set the configuration file name. */
zconfig = optarg;
@@ -108,11 +113,11 @@ main (argc, argv)
case 'v':
/* Print version and exit. */
- printf ("%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zKprogram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
-
+
case 1:
/* --help. */
ukhelp ();
@@ -139,29 +144,132 @@ main (argc, argv)
if (iret != UUCONF_SUCCESS)
ukuuconf_error (puuconf, iret);
- iret = uuconf_system_names (puuconf, &pzsystems, FALSE);
- if (iret != UUCONF_SUCCESS)
- ukuuconf_error (puuconf, iret);
-
- if (*pzsystems == NULL)
+ if (zsystem != NULL)
{
- fprintf (stderr, "%s: no systems found\n", zKprogram);
- exit (EXIT_FAILURE);
- }
+ struct uuconf_system ssys;
- while (*pzsystems != NULL)
+ iret = uuconf_system_info (puuconf, zsystem, &ssys);
+ if (iret == UUCONF_NOT_FOUND)
+ {
+ fprintf (stderr, "%s: system not found\n", zsystem);
+ exit (EXIT_FAILURE);
+ }
+ else if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+
+ ukshow (&ssys, puuconf);
+ (void) uuconf_system_free (puuconf, &ssys);
+ }
+ else
{
- struct uuconf_system ssys;
+ const char *zstr;
+ int iint;
+ char **pzsystems;
+
+ iret = uuconf_localname (puuconf, &zstr);
+ if (iret == UUCONF_SUCCESS)
+ printf ("Local node name %s\n", zstr);
+ else if (iret != UUCONF_NOT_FOUND)
+ ukuuconf_error (puuconf, iret);
- iret = uuconf_system_info (puuconf, *pzsystems, &ssys);
+ iret = uuconf_spooldir (puuconf, &zstr);
if (iret != UUCONF_SUCCESS)
ukuuconf_error (puuconf, iret);
+ printf ("Spool directory %s\n", zstr);
+
+ iret = uuconf_pubdir (puuconf, &zstr);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ printf ("Public directory %s\n", zstr);
+
+ iret = uuconf_lockdir (puuconf, &zstr);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ printf ("Lock directory %s\n", zstr);
+
+ iret = uuconf_logfile (puuconf, &zstr);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ printf ("Log file %s\n", zstr);
+
+ iret = uuconf_statsfile (puuconf, &zstr);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ printf ("Statistics file %s\n", zstr);
+
+ iret = uuconf_debugfile (puuconf, &zstr);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ printf ("Debug file %s\n", zstr);
+
+ iret = uuconf_debuglevel (puuconf, &zstr);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ if (zstr != NULL)
+ printf ("Global debugging level %s\n", zstr);
+
+ iret = uuconf_strip (puuconf, &iint);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ printf ("uucico -l will %sstrip login names and passwords\n",
+ (iint & UUCONF_STRIP_LOGIN) != 0 ? "" : "not ");
+ printf ("uucico will %sstrip UUCP protocol commands\n",
+ (iint & UUCONF_STRIP_PROTO) != 0 ? "" : "not ");
+
+ iret = uuconf_maxuuxqts (puuconf, &iint);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ if (iint != 0)
+ printf ("Maximum number of uuxqt processes permitted %d\n", iint);
+
+ iret = uuconf_runuuxqt (puuconf, &iint);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ if (iint > 0)
+ printf ("Start uuxqt every %d jobs\n", iint);
else
- ukshow (&ssys, puuconf);
- (void) uuconf_system_free (puuconf, &ssys);
- ++pzsystems;
- if (*pzsystems != NULL)
- printf ("\n");
+ {
+ switch (iint)
+ {
+ case UUCONF_RUNUUXQT_NEVER:
+ printf ("Never start uuxqt\n");
+ break;
+ case UUCONF_RUNUUXQT_ONCE:
+ printf ("Start uuxqt once per uucico invocation\n");
+ break;
+ case UUCONF_RUNUUXQT_PERCALL:
+ printf ("Start uuxqt once per call\n");
+ break;
+ default:
+ fprintf (stderr, "Illegal value from uuconf_runuuxqt\n");
+ exit (EXIT_FAILURE);
+ break;
+ }
+ }
+
+ iret = uuconf_system_names (puuconf, &pzsystems, FALSE);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+
+ if (*pzsystems == NULL)
+ {
+ fprintf (stderr, "%s: no systems found\n", zKprogram);
+ exit (EXIT_FAILURE);
+ }
+
+ while (*pzsystems != NULL)
+ {
+ struct uuconf_system ssys;
+
+ printf ("\n");
+ iret = uuconf_system_info (puuconf, *pzsystems, &ssys);
+ if (iret != UUCONF_SUCCESS)
+ ukuuconf_error (puuconf, iret);
+ else
+ ukshow (&ssys, puuconf);
+ (void) uuconf_system_free (puuconf, &ssys);
+ ++pzsystems;
+ }
}
exit (EXIT_SUCCESS);
@@ -174,7 +282,7 @@ main (argc, argv)
static void ukusage ()
{
- fprintf (stderr, "Usage: %s [{-I,--config} file]\n", zKprogram);
+ fprintf (stderr, "Usage: %s [-s system] [-I file]\n", zKprogram);
fprintf (stderr, "Use %s --help for help\n", zKprogram);
exit (EXIT_FAILURE);
}
@@ -184,10 +292,10 @@ static void ukusage ()
static void
ukhelp ()
{
- printf ("Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
- printf ("Usage: %s [{-I,--config} file] [-v] [--version] [--help]\n",
- zKprogram);
+ printf ("Usage: %s [-s system] [-I file] [-v]\n", zKprogram);
+ printf (" -s,--system system: Only print configuration for named system\n");
printf (" -I,--config file: Set configuration file to use\n");
printf (" -v,--version: Print version and exit\n");
printf (" --help: Print help and exit\n");
@@ -203,6 +311,7 @@ ukshow (qsys, puuconf)
char **pz;
int i;
int iret;
+ boolean fanycall;
printf ("System: %s", qsys->uuconf_zname);
if (qsys->uuconf_pzalias != NULL)
@@ -218,6 +327,7 @@ ukshow (qsys, puuconf)
}
printf ("\n");
+ fanycall = FALSE;
for (i = 0; qsys != NULL; qsys = qsys->uuconf_qalternate, i++)
{
boolean fcall, fcalled;
@@ -245,6 +355,9 @@ ukshow (qsys, puuconf)
continue;
}
+ if (fcall)
+ fanycall = TRUE;
+
if (fcalled)
{
if (qsys->uuconf_zcalled_login != NULL
@@ -279,7 +392,7 @@ ukshow (qsys, puuconf)
printf (" Call out");
else
printf (" This alternate applies when calling");
-
+
if (qsys->uuconf_zport != NULL || qsys->uuconf_qport != NULL)
{
printf (" using ");
@@ -389,6 +502,10 @@ ukshow (qsys, puuconf)
printf ("\n");
}
+ if (qsys->uuconf_cmax_retries > 0)
+ printf (" May retry the call up to %d times\n",
+ qsys->uuconf_cmax_retries);
+
if (qsys->uuconf_qcalltimegrade != NULL)
{
boolean fprint, fother;
@@ -427,6 +544,50 @@ ukshow (qsys, puuconf)
}
}
+ if (fcalled)
+ {
+ if (qsys->uuconf_qcalledtimegrade != NULL)
+ {
+ boolean fprint, fother;
+
+ qtime = qcompress_span (qsys->uuconf_qcalledtimegrade);
+ fprint = FALSE;
+ fother = FALSE;
+ if (qtime->uuconf_istart != 0)
+ fother = TRUE;
+ for (qspan = qtime; qspan != NULL; qspan = qspan->uuconf_qnext)
+ {
+ if ((char) qspan->uuconf_ival == UUCONF_GRADE_LOW)
+ {
+ fother = TRUE;
+ continue;
+ }
+ fprint = TRUE;
+ printf (" ");
+ ukshow_time (qspan);
+ printf (" will send work grade %c or higher\n",
+ (char) qspan->uuconf_ival);
+ if (qspan->uuconf_qnext == NULL)
+ {
+ if (qspan->uuconf_iend != 7 * 24 * 60)
+ fother = TRUE;
+ }
+ else
+ {
+ if (qspan->uuconf_iend
+ != qspan->uuconf_qnext->uuconf_istart)
+ fother = TRUE;
+ }
+ }
+ if (fprint && fother)
+ printf (" (At other times will send any work)\n");
+ }
+ }
+
+ if (fcall && qsys->uuconf_csuccess_wait != 0)
+ printf (" Will wait %d seconds after a successful call\n",
+ qsys->uuconf_csuccess_wait);
+
if (qsys->uuconf_fsequence)
printf (" Sequence numbers are used\n");
@@ -514,7 +675,7 @@ ukshow (qsys, puuconf)
printf (" %s", *pz);
printf ("\n");
}
-
+
if (qsys->uuconf_pzforward_to != NULL)
{
printf (" May forward to");
@@ -522,7 +683,7 @@ ukshow (qsys, puuconf)
printf (" %s", *pz);
printf ("\n");
}
-
+
if (qsys->uuconf_zprotocols != NULL)
printf (" Will use protocols %s\n", qsys->uuconf_zprotocols);
else
@@ -531,6 +692,9 @@ ukshow (qsys, puuconf)
if (qsys->uuconf_qproto_params != NULL)
ukshow_proto_params (qsys->uuconf_qproto_params, 1);
}
+
+ if (! fanycall)
+ printf (" Calls will never be placed to this system\n");
}
/* Show information about a port. */
diff --git a/gnu/libexec/uucp/uucico/Makefile b/gnu/libexec/uucp/uucico/Makefile
index f968c35..f93d4b4 100644
--- a/gnu/libexec/uucp/uucico/Makefile
+++ b/gnu/libexec/uucp/uucico/Makefile
@@ -1,5 +1,5 @@
# Makefile for uucico
-# $Id: Makefile,v 1.6 1994/05/31 15:55:43 ache Exp $
+# $Id: Makefile,v 1.7 1995/05/13 12:29:57 ache Exp $
BINDIR= $(libxdir)
BINOWN= $(owner)
@@ -7,8 +7,8 @@ BINMODE= 4555
PROG= uucico
SRCS= uucico.c trans.c send.c rec.c xcmd.c prot.c protg.c protf.c \
- prott.c prote.c proti.c protj.c protz.c time.c chat.c \
- conn.c copy.c log.c tcp.c tli.c util.c
+ prott.c prote.c proti.c protj.c proty.c protz.c time.c log.c \
+ chat.c conn.c util.c copy.c
LDADD+= $(LIBUNIX) $(LIBUUCONF) $(LIBUUCP)
DPADD+= $(LIBUNIX) $(LIBUUCONF) $(LIBUUCP)
CFLAGS+= -I$(.CURDIR)/../common_sources\
diff --git a/gnu/libexec/uucp/uucico/prote.c b/gnu/libexec/uucp/uucico/prote.c
index 4cff75b..fc73b5d 100644
--- a/gnu/libexec/uucp/uucico/prote.c
+++ b/gnu/libexec/uucp/uucico/prote.c
@@ -1,7 +1,7 @@
/* prote.c
The 'e' protocol.
- Copyright (C) 1991, 1992 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char prote_rcsid[] = "$Id: prote.c,v 1.2 1994/05/07 18:13:43 ache Exp $";
+const char prote_rcsid[] = "$Id: prote.c,v 1.20 1995/08/02 00:24:28 ian Rel $";
#endif
#include "uudefs.h"
@@ -97,7 +97,7 @@ festart (qdaemon, pzlog)
/* Stop the protocol. */
/*ARGSUSED*/
-boolean
+boolean
feshutdown (qdaemon)
struct sdaemon *qdaemon;
{
@@ -254,6 +254,16 @@ feprocess_data (qdaemon, pfexit, pcneed)
cinbuf = iPrecend - iPrecstart;
if (cinbuf < 0)
cinbuf += CRECBUFLEN;
+
+ if (cEbytes == 0)
+ {
+ if (! fgot_data (qdaemon, abPrecbuf, (size_t) 0,
+ (const char *) NULL, (size_t) 0,
+ -1, -1, (long) -1, TRUE, pfexit))
+ return FALSE;
+ if (*pfexit)
+ return TRUE;
+ }
}
/* Here we can read real data for the file. */
diff --git a/gnu/libexec/uucp/uucico/protf.c b/gnu/libexec/uucp/uucico/protf.c
index c38b9a1..289dbeff 100644
--- a/gnu/libexec/uucp/uucico/protf.c
+++ b/gnu/libexec/uucp/uucico/protf.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char protf_rcsid[] = "$Id: protf.c,v 1.2 1994/05/07 18:13:45 ache Exp $";
+const char protf_rcsid[] = "$Id: protf.c,v 1.33 1995/06/21 19:15:17 ian Rel $";
#endif
#include <ctype.h>
@@ -247,7 +247,7 @@ ffsenddata (qdaemon, zdata, cdata, ilocal, iremote, ipos)
char ab[CFBUFSIZE * 2];
char *ze;
register unsigned int itmpchk;
-
+
cFsent_data += cdata;
ze = ab;
@@ -759,7 +759,7 @@ ffawait_cksum (qtrans, qdaemon, zdata, cdata)
xfree (qtrans->pinfo);
return FALSE;
}
-
+
icheck = (unsigned int) strtol ((char *) zdata, (char **) NULL, 16);
if (icheck != (iFcheck & 0xffff))
diff --git a/gnu/libexec/uucp/uucico/protg.c b/gnu/libexec/uucp/uucico/protg.c
index efae85f..eda4ed0 100644
--- a/gnu/libexec/uucp/uucico/protg.c
+++ b/gnu/libexec/uucp/uucico/protg.c
@@ -1,7 +1,7 @@
/* protg.c
The 'g' protocol.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char protg_rcsid[] = "$Id: protg.c,v 1.2 1994/05/07 18:13:46 ache Exp $";
+const char protg_rcsid[] = "$Id: protg.c,v 1.68 1995/06/21 19:15:22 ian Rel $";
#endif
#include <ctype.h>
@@ -137,7 +137,7 @@ const char protg_rcsid[] = "$Id: protg.c,v 1.2 1994/05/07 18:13:46 ache Exp $";
/* Maximum amount of data in a single packet. This is set by the <k>
field in the header; the amount of data in a packet is
2 ** (<k> + 4). <k> ranges from 1 to 8. */
-
+
#define CMAXDATAINDEX (8)
#define CMAXDATA (1 << (CMAXDATAINDEX + 4))
@@ -446,7 +446,7 @@ fgstart (qdaemon, pzlog)
iGrequest_packsize, qdaemon->qproto->bname);
iseg = 1;
}
-
+
if (iGrequest_winsize <= 0 || iGrequest_winsize > 7)
{
ulog (LOG_ERROR, "Illegal window size %d for '%c' protocol",
@@ -561,7 +561,7 @@ fvstart (qdaemon, pzlog)
if (iGrequest_packsize == IPACKSIZE)
iGrequest_packsize = 1024;
return fgstart (qdaemon, pzlog);
-}
+}
/* Exchange initialization messages with the other system.
@@ -1140,7 +1140,7 @@ fgwait_for_packet (qdaemon, freturncontrol, ctimeout, cretries)
size_t cneed;
boolean ffound;
size_t crec;
-
+
if (! fgprocess_data (qdaemon, TRUE, freturncontrol, &fexit,
&cneed, &ffound))
return FALSE;
@@ -1502,7 +1502,7 @@ fgprocess_data (qdaemon, fdoacks, freturncontrol, pfexit, pcneed, pffound)
cinbuf -= CFRAMELEN;
/* Make sure we have enough data. If we don't, wait for
- more. */
+ more. */
cwant = (int) CPACKLEN (ab);
if (cinbuf < cwant)
@@ -1511,7 +1511,7 @@ fgprocess_data (qdaemon, fdoacks, freturncontrol, pfexit, pcneed, pffound)
*pcneed = cwant - cinbuf;
return TRUE;
}
-
+
/* Set up the data pointers and compute the checksum. */
if (iPrecend >= iPrecstart)
cfirst = cwant;
@@ -1546,7 +1546,7 @@ fgprocess_data (qdaemon, fdoacks, freturncontrol, pfexit, pcneed, pffound)
(((0xaaaa - (icheck ^ (ab[IFRAME_CONTROL] & 0xff)))
& 0xffff)));
}
-
+
ihdrcheck = (unsigned short) (((ab[IFRAME_CHECKHIGH] & 0xff) << 8)
| (ab[IFRAME_CHECKLOW] & 0xff));
@@ -1614,7 +1614,7 @@ fgprocess_data (qdaemon, fdoacks, freturncontrol, pfexit, pcneed, pffound)
&& CONTROL_XXX (ab[IFRAME_CONTROL]) == RR
&& iGremote_ack == CONTROL_YYY (ab[IFRAME_CONTROL])
&& INEXTSEQ (iGremote_ack) != iGsendseq
- && iGretransmit_seq != -1)
+ && iGretransmit_seq == -1)
{
DEBUG_MESSAGE0 (DEBUG_PROTO | DEBUG_ABNORMAL,
"fgprocess_data: Treating duplicate RR as RJ");
diff --git a/gnu/libexec/uucp/uucico/proti.c b/gnu/libexec/uucp/uucico/proti.c
index 17b540e..3209892 100644
--- a/gnu/libexec/uucp/uucico/proti.c
+++ b/gnu/libexec/uucp/uucico/proti.c
@@ -1,7 +1,7 @@
/* proti.c
The 'i' protocol.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char proti_rcsid[] = "$Id: proti.c,v 1.2 1994/05/07 18:13:48 ache Exp $";
+const char proti_rcsid[] = "$Id: proti.c,v 1.33 1995/06/21 19:15:28 ian Rel $";
#endif
#include <ctype.h>
@@ -146,8 +146,8 @@ const char proti_rcsid[] = "$Id: proti.c,v 1.2 1994/05/07 18:13:48 ache Exp $";
#define SPOS (4)
#define CLOSE (5)
-/* Largest possible packet size (plus 1). */
-#define IMAXPACKSIZE (1 << 12)
+/* Largest possible packet size. */
+#define IMAXPACKSIZE ((1 << 12) - 1)
/* Largest possible sequence number (plus 1). */
#define IMAXSEQ 32
@@ -239,6 +239,11 @@ static int cIsync_retries = CSYNC_RETRIES;
``timeout''). */
static int cItimeout = CTIMEOUT;
+/* Timeout to use when waiting for an acknowledgement to open up space
+ in the window. This is computed based on the window size and the
+ connection speed. */
+static int cIwindow_timeout = CTIMEOUT;
+
/* Number of times to retry sending a packet before giving up
(protocol parameter ``retries''). */
static int cIretries = CRETRIES;
@@ -406,6 +411,7 @@ fijstart (qdaemon, pzlog, imaxpacksize, pfsend, pfreceive)
unsigned long icksum;
int ctries;
int csyncs;
+ long ibaud;
*pzlog = NULL;
@@ -413,7 +419,7 @@ fijstart (qdaemon, pzlog, imaxpacksize, pfsend, pfreceive)
pfIreceive = pfreceive;
if (iIforced_remote_packsize <= 0
- || iIforced_remote_packsize >= imaxpacksize)
+ || iIforced_remote_packsize > imaxpacksize)
iIforced_remote_packsize = 0;
else
iIremote_packsize = iIforced_remote_packsize;
@@ -508,6 +514,42 @@ fijstart (qdaemon, pzlog, imaxpacksize, pfsend, pfreceive)
}
}
+ /* Calculate the window timeout. */
+ ibaud = iconn_baud (qdaemon->qconn);
+ if (ibaud == 0)
+ cIwindow_timeout = cItimeout;
+ else
+ {
+ /* We expect to receive an ACK about halfway through each
+ window. In principle, an entire window might be sitting in a
+ modem buffer while we are waiting for an ACK. Therefore, the
+ minimum time we should wait for an ACK is
+ (1/2 window size) * (seconds / byte) + (roundtrip time) ==
+ (1/2 window size) * (1 / (baud / 10)) + (roundtrip time) ==
+ (1/2 window size) * (10 / baud) + (roundtrip time) ==
+ (5 * (window size)) / baud + (roundtrip time)
+
+ The window size is iIremote_packsize * iIremote_winsize. For
+ typical settings of packsize == 1024, winsize == 16, baud ==
+ 9600, this equation works out to
+ (5 * 1024 * 16) / 9600 == 8 seconds
+ We then take cItimeout as the round trip time, which gives us
+ some flexibility. We get more flexibility because it is
+ quite likely that by the time we have finished sending out
+ the last packet in a window, the first one has already been
+ received by the remote system. */
+ cIwindow_timeout = ((5 * iIremote_packsize * iIremote_winsize) / ibaud
+ + cItimeout);
+ }
+
+ /* If we are the callee, bump both timeouts by one, to make it less
+ likely that both systems will timeout simultaneously. */
+ if (! qdaemon->fcaller)
+ {
+ ++cItimeout;
+ ++cIwindow_timeout;
+ }
+
/* We got a SYNC packet; set up packet buffers to use. */
if (iIremote_packsize > imaxpacksize)
iIremote_packsize = imaxpacksize;
@@ -607,6 +649,7 @@ fishutdown (qdaemon)
cIsync_timeout = CSYNC_TIMEOUT;
cIsync_retries = CSYNC_RETRIES;
cItimeout = CTIMEOUT;
+ cIwindow_timeout = CTIMEOUT;
cIretries = CRETRIES;
cIerrors = CERRORS;
cIerror_decay = CERROR_DECAY;
@@ -741,7 +784,7 @@ fiwindow_wait (qdaemon)
sends the entire packet. Hopefully that will trigger an ACK
or a NAK and get us going again. */
DEBUG_MESSAGE0 (DEBUG_PROTO, "fiwindow_wait: Waiting for ACK");
- if (! fiwait_for_packet (qdaemon, cItimeout, cIretries,
+ if (! fiwait_for_packet (qdaemon, cIwindow_timeout, cIretries,
TRUE, (boolean *) NULL))
return FALSE;
}
@@ -866,7 +909,7 @@ fisenddata (qdaemon, zdata, cdata, ilocal, iremote, ipos)
DEBUG_MESSAGE4 (DEBUG_PROTO,
"fisenddata: Sending packet %d size %d local %d remote %d",
- iIsendseq, (int) cdata, ilocal, iremote);
+ iIsendseq, (int) cdata, ilocal, iremote);
iIsendseq = INEXTSEQ (iIsendseq);
++cIsent_packets;
@@ -1535,7 +1578,7 @@ fiprocess_packet (qdaemon, zhdr, zfirst, cfirst, zsecond, csecond, pfexit)
case NAK:
/* We must resend the requested packet. */
- {
+ {
int iseq;
char *zsend;
size_t clen;
@@ -1598,7 +1641,7 @@ fiprocess_packet (qdaemon, zhdr, zfirst, cfirst, zsecond, csecond, pfexit)
zsend[IHDR_CHECK] = IHDRCHECK_VAL (zsend);
iIlocal_ack = iIrecseq;
}
-
+
++cIresent_packets;
clen = CHDRCON_GETBYTES (zsend[IHDR_CONTENTS1],
diff --git a/gnu/libexec/uucp/uucico/protj.c b/gnu/libexec/uucp/uucico/protj.c
index 091099e..3d7c206 100644
--- a/gnu/libexec/uucp/uucico/protj.c
+++ b/gnu/libexec/uucp/uucico/protj.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char protj_rcsid[] = "$Id: protj.c,v 1.4 1994/01/30 21:01:46 ian Rel $";
+const char protj_rcsid[] = "$Id: protj.c,v 1.6 1995/06/21 19:15:32 ian Rel $";
#endif
#include <ctype.h>
diff --git a/gnu/libexec/uucp/uucico/prott.c b/gnu/libexec/uucp/uucico/prott.c
index 8bf703a..dec4557 100644
--- a/gnu/libexec/uucp/uucico/prott.c
+++ b/gnu/libexec/uucp/uucico/prott.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char prott_rcsid[] = "$Id: prott.c,v 1.2 1994/05/07 18:13:51 ache Exp $";
+const char prott_rcsid[] = "$Id: prott.c,v 1.29 1995/06/21 19:15:36 ian Rel $";
#endif
#include "uudefs.h"
@@ -96,7 +96,7 @@ ftstart (qdaemon, pzlog)
/* Stop the protocol. */
/*ARGSUSED*/
-boolean
+boolean
ftshutdown (qdaemon)
struct sdaemon *qdaemon;
{
@@ -269,7 +269,7 @@ ftprocess_data (qdaemon, pfexit, pcneed)
return FALSE;
iPrecstart = (iPrecstart + clen) % CRECBUFLEN;
-
+
if (*pfexit)
return TRUE;
diff --git a/gnu/libexec/uucp/uucico/proty.c b/gnu/libexec/uucp/uucico/proty.c
new file mode 100644
index 0000000..f15671e
--- /dev/null
+++ b/gnu/libexec/uucp/uucico/proty.c
@@ -0,0 +1,660 @@
+/* proty.c
+ The 'y' protocol.
+
+ Copyright (C) 1994, 1995 Jorge Cwik and 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "uucp.h"
+
+#if USE_RCS_ID
+const char proty_id[] = "$Id: proty.c,v 1.4 1995/06/21 19:15:40 ian Rel $";
+#endif
+
+#include "uudefs.h"
+#include "uuconf.h"
+#include "conn.h"
+#include "trans.h"
+#include "system.h"
+#include "prot.h"
+
+/* The 'y' protocol, and this implementation, was written and designed
+ by Jorge Cwik <jorge@satlink.net>. Some of the routines, and the
+ coding style in general, were taken verbatim or adapted from other
+ Taylor UUCP modules. Mark Delany made the initial testings and
+ helped in portability issues.
+
+ This protocol does not perform any kind of error correction or flow
+ control. It does do error checking. It does not require an end to
+ end reliable link. It is recommended for error-free (also called
+ semi-reliable) connections as provided by error correcting modems.
+ It needs an eight bit clean channel and some kind of flow control
+ at the lower layers, typically RTS/CTS hardware flow control.
+
+ The flow of the file transmission is completely unidirectional.
+ There are no ACKs or NAKs outside file boundaries. This makes it
+ very suitable for half duplex modulations (like PEP) and
+ connections with very long delays, like multihop satellite links. */
+
+/* This protocol uses 16 bit little-endian ints in the packet header. */
+#define FROMLITTLE(p) (((p)[0] & 0xff) + (((p)[1] & 0xff) << 8))
+#define TOLITTLE(p, i) ((p)[0] = (i) & 0xff, (p)[1] = ((i) >> 8) & 0xff)
+
+/* The buffer and packet size we use. */
+#define CYBUFSIZE (1024)
+#define IYPACKSIZE (1024)
+
+/* The offset in the buffer to the data. */
+#define CYFRAMELEN (6)
+
+/* Offsets in a packet header. */
+#define YFRAME_SEQ_OFF (0)
+#define YFRAME_LEN_OFF (2)
+#define YFRAME_CTL_OFF (2)
+#define YFRAME_CHK_OFF (4)
+
+/* Offsets in a packet header viewed as an array of shorts. */
+#define YFRAME_SEQ (0)
+#define YFRAME_LEN (1)
+#define YFRAME_CTL (1)
+#define YFRAME_CHK (2)
+
+/* The default timeout. */
+#define CYTIMEOUT (60)
+
+/* Control packet types. */
+#define YPKT_ACK (0xFFFE)
+#define YPKT_ERR (0xFFFD)
+#define YPKT_BAD (0xFFFC)
+
+/* The protocol version number. */
+#define Y_VERSION (1)
+
+/* When the protocol starts up, it transmit the following information:
+ 1 byte version
+ 1 byte packet size
+ 2 byte flags (none currently defined)
+ Future revision may expand the structure as long as these members
+ keep their current offset. */
+#define Y_INIT_HDR_LEN (4)
+#define Y_INIT_HDR_VERSION_OFF (0)
+#define Y_INIT_HDR_PKTSIZE_OFF (1)
+#define Y_INIT_HDR_FLAGS_OFF (2)
+
+/* The initialization length of the lowest accepted version. */
+#define MIN_Y_SYNC (4)
+
+/* Not strictly needed, but I would not want to accept a 32k sync pkt. */
+#define MAX_Y_SYNC IYPACKSIZE
+
+/* Local and remote packet sizes (we actually use the same value for
+ both). */
+static size_t iYlocal_packsize = IYPACKSIZE;
+static size_t iYremote_packsize = IYPACKSIZE;
+
+/* Local and remote packet sequence numbers. */
+static unsigned short iYlocal_pktnum;
+static unsigned short iYremote_pktnum;
+
+/* The timeout. */
+static int cYtimeout = CYTIMEOUT;
+
+/* Transmitter buffer. */
+static char *zYbuf;
+
+/* Protocol parameters. */
+
+struct uuconf_cmdtab asYproto_params[] =
+{
+ { "timeout", UUCONF_CMDTABTYPE_INT, (pointer) &cYtimeout, NULL },
+ { "packet-size", UUCONF_CMDTABTYPE_INT, (pointer) &iYlocal_packsize, NULL },
+ { NULL, 0, NULL, NULL }
+};
+
+/* Local functions. */
+
+static boolean fywait_for_packet P((struct sdaemon *qdaemon,
+ boolean *pfexit));
+static unsigned short iychecksum P((const char *z, size_t c));
+static unsigned short iychecksum2 P((const char *zfirst, size_t cfirst,
+ const char *zsecond, size_t csecond));
+static boolean fywait_for_header P((struct sdaemon *qdaemon,
+ unsigned short header[3], int timeout));
+static boolean fysend_pkt P((struct sdaemon *qdaemon,
+ const void *zdata, size_t cdata));
+static boolean fysend_control P((struct sdaemon *qdaemon,
+ int itype));
+static boolean fyread_data P((struct sdaemon *qdaemon, size_t clen,
+ int timeout));
+
+/* Exchange sync packets at protocol startup. */
+
+static boolean
+fyxchg_syncs (qdaemon)
+ struct sdaemon *qdaemon;
+{
+ char inithdr[Y_INIT_HDR_LEN];
+ unsigned short header[3];
+ unsigned short ichk;
+ size_t clen, cfirst;
+ int rpktsize;
+
+ /* Send our configuration. We could use only one array (for local
+ and remote). But this is safer in case the code changes and
+ depend on separate ones. */
+
+ inithdr[Y_INIT_HDR_VERSION_OFF] = Y_VERSION;
+ inithdr[Y_INIT_HDR_PKTSIZE_OFF] = iYlocal_packsize >> 8;
+ TOLITTLE (inithdr + Y_INIT_HDR_FLAGS_OFF, 0);
+
+ if (! fysend_pkt (qdaemon, inithdr, Y_INIT_HDR_LEN))
+ return FALSE;
+
+ if (! fywait_for_header (qdaemon, header, cYtimeout))
+ return FALSE;
+
+ DEBUG_MESSAGE0 (DEBUG_UUCP_PROTO, "fyxchg_syncs: Got sync header");
+ clen = header[YFRAME_LEN];
+
+ if (clen < MIN_Y_SYNC || clen > MAX_Y_SYNC)
+ {
+ ulog (LOG_ERROR, "Bad 'y' protocol sync packet length");
+ return FALSE;
+ }
+
+ /* It may be better to integrate this code with fywait_for_packet. */
+ if (! fyread_data (qdaemon, clen, cYtimeout))
+ return FALSE;
+
+ cfirst = CRECBUFLEN - iPrecstart;
+ ichk = iychecksum2 (abPrecbuf + iPrecstart, cfirst,
+ abPrecbuf, clen - cfirst);
+
+ rpktsize = BUCHAR (abPrecbuf[(iPrecstart + 1) % CRECBUFLEN]);
+
+ /* Future versions of the protocol may need to check and react
+ according to the version number. */
+
+ if (rpktsize == 0 || header[YFRAME_CHK] != ichk)
+ {
+ ulog (LOG_ERROR, "Bad 'y' protocol sync packet");
+ return FALSE;
+ }
+
+ iYremote_packsize = rpktsize << 8;
+
+ /* Some may want to do this different and in effect the protocol
+ support this. But I like the idea that the packet size would be
+ the same in both directions. This allows the caller to select
+ both packet sizes without changing the configuration at the
+ server. */
+ if (iYremote_packsize > iYlocal_packsize)
+ iYremote_packsize = iYlocal_packsize;
+
+ iPrecstart = (iPrecstart + clen) % CRECBUFLEN;
+ return TRUE;
+}
+
+/* Start the protocol. */
+
+boolean
+fystart (qdaemon, pzlog)
+ struct sdaemon *qdaemon;
+ char **pzlog;
+{
+ *pzlog = NULL;
+
+ /* This should force, or at least enable if available, RTS/CTS
+ hardware flow control !! */
+
+ /* The 'y' protocol requires an eight bit clean link */
+ if (! fconn_set (qdaemon->qconn, PARITYSETTING_NONE,
+ STRIPSETTING_EIGHTBITS, XONXOFF_OFF))
+ return FALSE;
+
+ iYlocal_pktnum = iYremote_pktnum = 0;
+
+ /* Only multiple of 256 sizes are allowed */
+ iYlocal_packsize &= ~0xff;
+ if (iYlocal_packsize < 256 || iYlocal_packsize > (16*1024))
+ iYlocal_packsize = IYPACKSIZE;
+
+ /* Exhange SYNC packets */
+ if (! fyxchg_syncs (qdaemon))
+ {
+ /* Restore defaults */
+ cYtimeout = CYTIMEOUT;
+ iYlocal_packsize = IYPACKSIZE;
+ return FALSE;
+ }
+
+ zYbuf = (char *) xmalloc (CYBUFSIZE + CYFRAMELEN);
+ return TRUE;
+}
+
+/* Shutdown the protocol. */
+
+boolean
+fyshutdown (qdaemon)
+ struct sdaemon *qdaemon;
+{
+ xfree ((pointer) zYbuf);
+ zYbuf = NULL;
+ cYtimeout = CYTIMEOUT;
+ iYlocal_packsize = IYPACKSIZE;
+ return TRUE;
+}
+
+/* Send a command string. We send packets containing the string until
+ the entire string has been sent, including the zero terminator. */
+
+/*ARGSUSED*/
+boolean
+fysendcmd (qdaemon, z, ilocal, iremote)
+ struct sdaemon *qdaemon;
+ const char *z;
+ int ilocal;
+ int iremote;
+{
+ size_t clen;
+
+ DEBUG_MESSAGE1 (DEBUG_UUCP_PROTO, "fysendcmd: Sending command \"%s\"", z);
+
+ clen = strlen (z) + 1;
+
+ while (clen > 0)
+ {
+ size_t csize;
+
+ csize = clen;
+ if (csize > iYremote_packsize)
+ csize = iYremote_packsize;
+
+ if (! fysend_pkt (qdaemon, z, csize))
+ return FALSE;
+
+ z += csize;
+ clen -= csize;
+ }
+
+ return TRUE;
+}
+
+/* Get space to be filled with data. We always use zYbuf, which was
+ allocated from the heap. */
+
+char *
+zygetspace (qdaemon, pclen)
+ struct sdaemon *qdaemon;
+ size_t *pclen;
+{
+ *pclen = iYremote_packsize;
+ return zYbuf + CYFRAMELEN;
+}
+
+/* Send out a data packet. */
+
+boolean
+fysenddata (qdaemon, zdata, cdata, ilocal, iremote, ipos)
+ struct sdaemon *qdaemon;
+ char *zdata;
+ size_t cdata;
+ int ilocal;
+ int iremote;
+ long ipos;
+{
+#if DEBUG > 0
+ if (cdata > iYremote_packsize)
+ ulog (LOG_FATAL, "fysend_packet: Packet size too large");
+#endif
+
+ TOLITTLE (zYbuf + YFRAME_SEQ_OFF, iYlocal_pktnum);
+ ++iYlocal_pktnum;
+ TOLITTLE (zYbuf + YFRAME_LEN_OFF, cdata);
+ TOLITTLE (zYbuf + YFRAME_CHK_OFF, iychecksum (zdata, cdata));
+
+ /* We pass FALSE to fsend_data since we don't expect the other side
+ to be sending us anything just now. */
+ return fsend_data (qdaemon->qconn, zYbuf, cdata + CYFRAMELEN, FALSE);
+}
+
+/* Wait for data to come in and process it until we've finished a
+ command or a file. */
+
+boolean
+fywait (qdaemon)
+ struct sdaemon *qdaemon;
+{
+ boolean fexit = FALSE;
+
+ while (! fexit)
+ {
+ if (! fywait_for_packet (qdaemon, &fexit))
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/* File level routines
+ We could handle this inside the other public routines,
+ but this is cleaner and better for future expansions */
+
+boolean
+fyfile (qdaemon, qtrans, fstart, fsend, cbytes, pfhandled)
+ struct sdaemon *qdaemon;
+ struct stransfer *qtrans;
+ boolean fstart;
+ boolean fsend;
+ long cbytes;
+ boolean *pfhandled;
+{
+ unsigned short header[3];
+
+ *pfhandled = FALSE;
+
+ if (! fstart)
+ {
+ if (fsend)
+ {
+ /* It is critical that the timeout here would be long
+ enough. We have just sent a full file without any kind
+ of flow control at the protocol level. The traffic may
+ be buffered in many places of the link, and the remote
+ may take a while until cathing up. */
+ if (! fywait_for_header (qdaemon, header, cYtimeout * 2))
+ return FALSE;
+
+ if (header[YFRAME_CTL] != (unsigned short) YPKT_ACK)
+ {
+ DEBUG_MESSAGE1 (DEBUG_PROTO | DEBUG_ABNORMAL,
+ "fyfile: Error from remote: 0x%04X", header[1]);
+ ulog (LOG_ERROR, "Received 'y' protocol error from remote");
+ return FALSE;
+ }
+ }
+ else
+ {
+ /* This is technically not requireed. But I've put this in
+ the protocol to allow easier expansions. */
+ return fysend_control (qdaemon, YPKT_ACK);
+ }
+ }
+
+ return TRUE;
+}
+
+/* Send a control packet, not used during the normal file
+ transmission. */
+
+static boolean
+fysend_control (qdaemon, itype)
+ struct sdaemon *qdaemon;
+ int itype;
+{
+ char header[CYFRAMELEN];
+
+ TOLITTLE (header + YFRAME_SEQ_OFF, iYlocal_pktnum);
+ iYlocal_pktnum++;
+ TOLITTLE (header + YFRAME_CTL_OFF, itype);
+ TOLITTLE (header + YFRAME_CHK_OFF, 0);
+
+ return fsend_data (qdaemon->qconn, header, CYFRAMELEN, FALSE);
+}
+
+/* Private function to send a packet. This one doesn't need the data
+ to be in the buffer provided by zygetspace. I've found it worth
+ for avoiding memory copies. Somebody may want to do it otherwise */
+
+static boolean
+fysend_pkt (qdaemon, zdata, cdata)
+ struct sdaemon *qdaemon;
+ const void *zdata;
+ size_t cdata;
+{
+ char header[CYFRAMELEN];
+
+ TOLITTLE (header + YFRAME_SEQ_OFF, iYlocal_pktnum);
+ iYlocal_pktnum++;
+ TOLITTLE (header + YFRAME_LEN_OFF, cdata);
+ TOLITTLE (header + YFRAME_CHK_OFF, iychecksum (zdata, cdata));
+
+ if (! fsend_data (qdaemon->qconn, header, CYFRAMELEN, FALSE))
+ return FALSE;
+ return fsend_data (qdaemon->qconn, zdata, cdata, FALSE);
+}
+
+/* Wait until enough data arrived from the comm line. This protocol
+ doesn't need to perform any kind of action while waiting. */
+
+static boolean
+fyread_data (qdaemon, clen, timeout)
+ struct sdaemon *qdaemon;
+ size_t clen;
+ int timeout;
+{
+ int cinbuf;
+ size_t crec;
+
+ cinbuf = iPrecend - iPrecstart;
+ if (cinbuf < 0)
+ cinbuf += CRECBUFLEN;
+
+ if (cinbuf < clen)
+ {
+ if (! freceive_data (qdaemon->qconn, clen - cinbuf, &crec,
+ timeout, TRUE))
+ return FALSE;
+ cinbuf += crec;
+ if (cinbuf < clen)
+ {
+ if (! freceive_data (qdaemon->qconn, clen - cinbuf, &crec,
+ timeout, TRUE))
+ return FALSE;
+ }
+ cinbuf += crec;
+ if (cinbuf < clen)
+ {
+ ulog (LOG_ERROR, "Timed out waiting for data");
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/* Receive a remote packet header, check for correct sequence number. */
+
+static boolean
+fywait_for_header (qdaemon, header, timeout)
+ struct sdaemon *qdaemon;
+ unsigned short header[3];
+ int timeout;
+{
+ if (! fyread_data (qdaemon, CYFRAMELEN, timeout))
+ return FALSE;
+
+ /* Somebody may want to optimize this in a portable way. I'm not
+ sure it's worth, but the output by gcc for the portable construct
+ is so bad (even with optimization), that I couldn't resist. */
+
+ if (iPrecstart <= (CRECBUFLEN - CYFRAMELEN))
+ {
+ header[0] = FROMLITTLE (abPrecbuf + iPrecstart);
+ header[1] = FROMLITTLE (abPrecbuf + iPrecstart + 2);
+ header[2] = FROMLITTLE (abPrecbuf + iPrecstart + 4);
+ }
+ else
+ {
+ register int i, j;
+
+ for (i = j = 0; j < CYFRAMELEN; i++, j += 2)
+ {
+ header[i] =
+ (((abPrecbuf[(iPrecstart + j + 1) % CRECBUFLEN] & 0xff) << 8)
+ + (abPrecbuf[(iPrecstart + j) % CRECBUFLEN] & 0xff));
+ }
+ }
+
+ iPrecstart = (iPrecstart + CYFRAMELEN) % CRECBUFLEN;
+
+ DEBUG_MESSAGE3 (DEBUG_UUCP_PROTO,
+ "fywait_for_header: Got header: 0x%04X, 0x%04X, 0x%04X",
+ header[0], header[1], header[2]);
+
+ if (header[YFRAME_SEQ] != iYremote_pktnum++)
+ {
+ ulog (LOG_ERROR, "Incorrect 'y' packet sequence");
+ fysend_control (qdaemon, YPKT_BAD);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* Receive a remote data packet */
+
+static boolean
+fywait_for_packet (qdaemon, pfexit)
+ struct sdaemon *qdaemon;
+ boolean *pfexit;
+{
+ unsigned short header[3], ichk;
+ size_t clen, cfirst;
+
+ if (! fywait_for_header (qdaemon, header, cYtimeout))
+ return FALSE;
+
+ clen = header[YFRAME_LEN];
+ if (clen == 0 && pfexit != NULL)
+ {
+ /* I Suppose the pointers could be NULL ??? */
+ return fgot_data (qdaemon, abPrecbuf, 0, abPrecbuf, 0,
+ -1, -1, (long) -1, TRUE, pfexit);
+ }
+
+ if (clen & 0x8000)
+ {
+ DEBUG_MESSAGE1 (DEBUG_PROTO | DEBUG_ABNORMAL,
+ "fywait_for_packet: Error from remote: 0x%04X",
+ header[YFRAME_CTL]);
+ ulog (LOG_ERROR, "Remote error packet");
+ return FALSE;
+ }
+
+ /* This is really not neccessary. But if this check is removed,
+ take in mind that the packet may be up to 32k long. */
+ if (clen > iYlocal_packsize)
+ {
+ ulog (LOG_ERROR, "Packet too large");
+ return FALSE;
+ }
+
+ if (! fyread_data (qdaemon, clen, cYtimeout))
+ return FALSE;
+
+ cfirst = CRECBUFLEN - iPrecstart;
+ if (cfirst > clen)
+ cfirst = clen;
+
+ if (cfirst == clen)
+ ichk = iychecksum (abPrecbuf + iPrecstart, clen);
+ else
+ ichk = iychecksum2 (abPrecbuf + iPrecstart, cfirst,
+ abPrecbuf, clen - cfirst);
+ if (header[YFRAME_CHK] != ichk)
+ {
+ DEBUG_MESSAGE2 (DEBUG_PROTO | DEBUG_ABNORMAL,
+ "fywait_for_packet: Bad checksum 0x%x != 0x%x",
+ header[YFRAME_CHK], ichk);
+ fysend_control (qdaemon, YPKT_ERR);
+ ulog (LOG_ERROR, "Checksum error");
+ return FALSE;
+ }
+
+ if (pfexit != NULL
+ && ! fgot_data (qdaemon, abPrecbuf + iPrecstart, cfirst,
+ abPrecbuf, clen - cfirst,
+ -1, -1, (long) -1, TRUE, pfexit))
+ return FALSE;
+
+ iPrecstart = (iPrecstart + clen) % CRECBUFLEN;
+
+ return TRUE;
+}
+
+/* Compute 16 bit checksum */
+
+#ifdef __GNUC__
+#ifdef __i386__
+#define I386_ASM
+#endif
+#endif
+
+#ifdef I386_ASM
+#define ROTATE(i) \
+ asm ("rolw $1,%0" : "=g" (i) : "g" (i))
+#else
+#define ROTATE(i) i += i + ((i & 0x8000) >> 15)
+#endif
+
+static unsigned short
+iychecksum (z, c)
+ register const char *z;
+ register size_t c;
+{
+ register unsigned short ichk;
+
+ ichk = 0xffff;
+
+ while (c-- > 0)
+ {
+ ROTATE (ichk);
+ ichk += BUCHAR (*z++);
+ }
+
+ return ichk;
+}
+
+static unsigned short
+iychecksum2 (zfirst, cfirst, zsecond, csecond)
+ const char *zfirst;
+ size_t cfirst;
+ const char *zsecond;
+ size_t csecond;
+{
+ register unsigned short ichk;
+ register const char *z;
+ register size_t c;
+
+ z = zfirst;
+ c = cfirst + csecond;
+
+ ichk = 0xffff;
+
+ while (c-- > 0)
+ {
+ ROTATE (ichk);
+ ichk += BUCHAR (*z++);
+
+ /* If the first buffer has been finished, switch to the second. */
+ if (--cfirst == 0)
+ z = zsecond;
+ }
+
+ return ichk;
+}
diff --git a/gnu/libexec/uucp/uucico/protz.c b/gnu/libexec/uucp/uucico/protz.c
index 7bcf803..5dd2473 100644
--- a/gnu/libexec/uucp/uucico/protz.c
+++ b/gnu/libexec/uucp/uucico/protz.c
@@ -8,7 +8,7 @@
* Ian Taylor's UUCP package.
*
* It was originally developed to establish a uucp link between myself and my
- * employer: Ivation Datasystems, Inc. of Ottawa.
+ * employer: Ivation Datasystems, Inc. of Ottawa.
*
* My thanks to Ivation for letting me release this to the public. Given that
* Zmodem is in the public domain, no additional copyrights have been added.
@@ -139,7 +139,7 @@
* ZDATA (ZCRCG, xx bytes) - received ok
* ZDATA (ZCRCF, 0 bytes) - corrupted
*
- * At this point the receiver would like to send back a ZRPOS with a value
+ * At this point the receiver would like to send back a ZRPOS with a value
* of the size of the file. However, it can't because the value is divided
* by 32, and it would have to round up to the next multiple of 32. This
* seemed a little ugly, so I went with using the entire header to store
@@ -148,7 +148,7 @@
*****************************************************************************
*
* Source version:
- *
+ *
* 1.1,2,3
* Protocol version 0
* Early attempts, completely rewritten later.
@@ -181,7 +181,7 @@
#include "uucp.h"
#if USE_RCS_ID
-const char protz_rcsid[] = "$Id: protz.c,v 1.2 1994/05/07 18:13:52 ache Exp $";
+const char protz_rcsid[] = "$Id: protz.c,v 1.8 1993/12/20 00:44:49 ian Rel $";
#endif
#include <errno.h>
@@ -1397,14 +1397,14 @@ static unsigned long crc_32_tab[] = { /* CRC polynomial 0xedb88320 */
};
/*
- * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell.
+ * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell.
* NOTE: First argument must be in range 0 to 255.
* Second argument is referenced twice.
- *
- * Programmers may incorporate any or all code into their programs,
- * giving proper credit within the source. Publication of the
- * source routines is permitted so long as proper credit is given
- * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
+ *
+ * Programmers may incorporate any or all code into their programs,
+ * giving proper credit within the source. Publication of the
+ * source routines is permitted so long as proper credit is given
+ * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
* Omen Technology.
*/
diff --git a/gnu/libexec/uucp/uucico/rec.c b/gnu/libexec/uucp/uucico/rec.c
index 08b31a4..4a8f163 100644
--- a/gnu/libexec/uucp/uucico/rec.c
+++ b/gnu/libexec/uucp/uucico/rec.c
@@ -1,7 +1,7 @@
/* rec.c
Routines to receive a file.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char rec_rcsid[] = "$Id: rec.c,v 1.3 1994/11/06 10:17:11 davidg Exp $";
+const char rec_rcsid[] = "$Id: rec.c,v 1.43 1995/08/02 01:21:12 ian Rel $";
#endif
#include <errno.h>
@@ -123,7 +123,7 @@ urrec_free (qtrans)
}
utransfree (qtrans);
-}
+}
/* Set up a request for a file from the remote system. This may be
called before the remote system has been called.
@@ -208,6 +208,7 @@ flocal_rec_file_init (qdaemon, qcmd)
ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
return FALSE;
}
+ slocalsys.uuconf_zname = (char *) zlocalname;
}
else if (iuuconf != UUCONF_SUCCESS)
{
@@ -364,8 +365,13 @@ flocal_rec_send_request (qtrans, qdaemon)
qtrans->iremote);
ubuffree (zsend);
- if (! fret)
- urrec_free (qtrans);
+ /* There is a potential space leak here: if pfsendcmd fails, we
+ might need to free qtrans. However, it is possible that by the
+ time pfsendcmd returns, a response will have been received which
+ led to the freeing of qtrans anyhow. One way to fix this would
+ be some sort of counter in qtrans to track allocations, but since
+ the space leak is small, and the conversation has failed anyhow,
+ it doesn't seem worth it. */
return fret;
}
@@ -569,7 +575,7 @@ fremote_send_file_init (qdaemon, qcmd, iremote)
qcmd->zfrom);
return fremote_send_fail (qdaemon, qcmd, FAILURE_PERM, iremote);
}
-
+
fspool = fspool_file (qcmd->zto);
/* We don't accept remote command files. An execution request may
@@ -795,6 +801,16 @@ fremote_send_reply (qtrans, qdaemon)
qinfo->freplied = TRUE;
+ if (! (*qdaemon->qproto->pfsendcmd) (qdaemon, ab, qtrans->ilocal,
+ qtrans->iremote))
+ {
+ (void) ffileclose (qtrans->e);
+ (void) remove (qinfo->ztemp);
+ /* Should probably free qtrans here, but see the comment at the
+ end of flocal_rec_send_request. */
+ return FALSE;
+ }
+
if (qdaemon->qproto->pffile != NULL)
{
boolean fhandled;
@@ -809,15 +825,6 @@ fremote_send_reply (qtrans, qdaemon)
}
}
- if (! (*qdaemon->qproto->pfsendcmd) (qdaemon, ab, qtrans->ilocal,
- qtrans->iremote))
- {
- (void) ffileclose (qtrans->e);
- (void) remove (qinfo->ztemp);
- urrec_free (qtrans);
- return FALSE;
- }
-
return TRUE;
}
@@ -861,16 +868,7 @@ fremote_send_fail_send (qtrans, qdaemon)
{
struct srecfailinfo *qinfo = (struct srecfailinfo *) qtrans->pinfo;
char ab[4];
- boolean fret;
- int ilocal = qtrans->ilocal;
- int iremote = qtrans->iremote;
-
- /* Wait for the end of file marker if we haven't gotten it yet. */
- if (! qinfo->freceived)
- {
- if (! fqueue_receive (qdaemon, qtrans))
- return FALSE;
- }
+ int ilocal, iremote;
ab[0] = qtrans->s.bcmd;
ab[1] = 'N';
@@ -897,20 +895,26 @@ fremote_send_fail_send (qtrans, qdaemon)
ab[2] = '\0';
break;
}
-
+
ab[3] = '\0';
- qinfo->fsent = TRUE;
+ ilocal = qtrans->ilocal;
+ iremote = qtrans->iremote;
- if (qinfo->freceived)
+ /* Wait for the end of file marker if we haven't gotten it yet. */
+ if (! qinfo->freceived)
+ {
+ qinfo->fsent = TRUE;
+ if (! fqueue_receive (qdaemon, qtrans))
+ return FALSE;
+ }
+ else
{
xfree (qtrans->pinfo);
utransfree (qtrans);
}
- fret = (*qdaemon->qproto->pfsendcmd) (qdaemon, ab, ilocal, iremote);
-
- return fret;
+ return (*qdaemon->qproto->pfsendcmd) (qdaemon, ab, ilocal, iremote);
}
/* Discard data until we reach the end of the file. This is used for
@@ -990,7 +994,13 @@ frec_file_end (qtrans, qdaemon, zdata, cdata)
zalc = NULL;
- if (! ffileclose (qtrans->e))
+ if (! fsysdep_sync (qtrans->e, qtrans->s.zto))
+ {
+ zerr = strerror (errno);
+ (void) ffileclose (qtrans->e);
+ (void) remove (qinfo->ztemp);
+ }
+ else if (! ffileclose (qtrans->e))
{
zerr = strerror (errno);
ulog (LOG_ERROR, "%s: close: %s", qtrans->s.zto, zerr);
@@ -1063,13 +1073,13 @@ frec_file_end (qtrans, qdaemon, zdata, cdata)
imode = 0666;
(void) fsysdep_change_mode (qinfo->zfile, imode);
}
-
+
zerr = NULL;
}
ustats (zerr == NULL, qtrans->s.zuser, qdaemon->qsys->uuconf_zname,
FALSE, qtrans->cbytes, qtrans->isecs, qtrans->imicros,
- qdaemon->fmaster);
+ qdaemon->fcaller);
qdaemon->creceived += qtrans->cbytes;
if (zerr == NULL)
@@ -1173,15 +1183,26 @@ frec_file_end (qtrans, qdaemon, zdata, cdata)
fprintf (e, "C %s\n", qtrans->s.zcmd);
fbad = FALSE;
- if (fclose (e) == EOF)
+
+ if (! fstdiosync (e, ztemp))
{
- ulog (LOG_ERROR, "fclose: %s", strerror (errno));
+ (void) fclose (e);
(void) remove (ztemp);
fbad = TRUE;
}
if (! fbad)
{
+ if (fclose (e) == EOF)
+ {
+ ulog (LOG_ERROR, "fclose: %s", strerror (errno));
+ (void) remove (ztemp);
+ fbad = TRUE;
+ }
+ }
+
+ if (! fbad)
+ {
if (! fsysdep_move_file (ztemp, zxqtfile, TRUE, FALSE, FALSE,
(const char *) NULL))
{
@@ -1235,9 +1256,7 @@ frec_file_send_confirm (qtrans, qdaemon)
{
struct srecinfo *qinfo = (struct srecinfo *) qtrans->pinfo;
const char *zsend;
- boolean fret;
- int ilocal = qtrans->ilocal;
- int iremote = qtrans->iremote;
+ int ilocal, iremote;
if (! qinfo->fmoved)
zsend = "CN5";
@@ -1255,17 +1274,18 @@ frec_file_send_confirm (qtrans, qdaemon)
zsend = "CYM";
}
- /* Now, if that was a remote command, then when the confirmation
- message is acked we no longer have to remember that we received
- that file. */
+ /* If that was a remote command, then, when the confirmation message
+ is acked, we no longer have to remember that we received that
+ file. */
if (! qinfo->flocal && qinfo->fmoved)
usent_receive_ack (qdaemon, qtrans);
- urrec_free (qtrans);
+ ilocal = qtrans->ilocal;
+ iremote = qtrans->iremote;
- fret = (*qdaemon->qproto->pfsendcmd) (qdaemon, zsend, ilocal, iremote);
+ urrec_free (qtrans);
- return fret;
+ return (*qdaemon->qproto->pfsendcmd) (qdaemon, zsend, ilocal, iremote);
}
/* Discard a temporary file if it is not useful. A temporary file is
diff --git a/gnu/libexec/uucp/uucico/send.c b/gnu/libexec/uucp/uucico/send.c
index 72d0083..6cd7450 100644
--- a/gnu/libexec/uucp/uucico/send.c
+++ b/gnu/libexec/uucp/uucico/send.c
@@ -1,7 +1,7 @@
/* send.c
Routines to send a file.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char send_rcsid[] = "$Id: send.c,v 1.3 1994/11/06 10:17:13 davidg Exp $";
+const char send_rcsid[] = "$Id: send.c,v 1.51 1995/06/21 19:15:49 ian Rel $";
#endif
#include <errno.h>
@@ -51,19 +51,21 @@ struct ssendinfo
boolean flocal;
/* TRUE if this is a spool directory file. */
boolean fspool;
- /* TRUE if the file has been completely sent. Also used in
- flocal_send_cancelled to mean that the file send will never
- succeed. */
+ /* TRUE if the file has been completely sent. */
boolean fsent;
+ /* TRUE if the file send will never succeed; used by
+ flocal_send_cancelled. */
+ boolean fnever;
/* Execution file for sending an unsupported E request. */
char *zexec;
+ /* Confirmation command received in fsend_await_confirm. */
+ char *zconfirm;
};
/* Local functions. */
static void usfree_send P((struct stransfer *qtrans));
-static boolean flocal_send_fail P((struct stransfer *qtrans,
- struct scmd *qcmd,
+static boolean flocal_send_fail P((struct scmd *qcmd,
struct sdaemon *qdaemon,
const char *zwhy));
static boolean flocal_send_request P((struct stransfer *qtrans,
@@ -106,11 +108,12 @@ usfree_send (qtrans)
ubuffree (qinfo->zmail);
ubuffree (qinfo->zfile);
ubuffree (qinfo->zexec);
+ ubuffree (qinfo->zconfirm);
xfree (qtrans->pinfo);
}
utransfree (qtrans);
-}
+}
/* Set up a local request to send a file. This may be called before
we have even tried to call the remote system.
@@ -198,7 +201,7 @@ flocal_send_file_init (qdaemon, qcmd)
is possible, but it might have changed since then. */
if (! qsys->uuconf_fcall_transfer
&& ! qsys->uuconf_fcalled_transfer)
- return flocal_send_fail ((struct stransfer *) NULL, qcmd, qdaemon,
+ return flocal_send_fail (qcmd, qdaemon,
"not permitted to transfer files");
/* We can't do the request now, but it may get done later. */
@@ -215,8 +218,7 @@ flocal_send_file_init (qdaemon, qcmd)
qsys->uuconf_pzlocal_send,
qsys->uuconf_zpubdir, TRUE,
TRUE, qcmd->zuser))
- return flocal_send_fail ((struct stransfer *) NULL, qcmd, qdaemon,
- "not permitted to send");
+ return flocal_send_fail (qcmd, qdaemon, "not permitted to send");
zfile = zbufcpy (qcmd->zfrom);
}
else
@@ -235,14 +237,12 @@ flocal_send_file_init (qdaemon, qcmd)
{
ubuffree (zfile);
if (cbytes != -1)
- return flocal_send_fail ((struct stransfer *) NULL, qcmd, qdaemon,
- "can not get size");
+ return flocal_send_fail (qcmd, qdaemon, "can not get size");
/* A cbytes value of -1 means that the file does not exist.
This can happen legitimately if it has already been sent from
the spool directory. */
if (! fspool)
- return flocal_send_fail ((struct stransfer *) NULL, qcmd, qdaemon,
- "does not exist");
+ return flocal_send_fail (qcmd, qdaemon, "does not exist");
(void) fsysdep_did_work (qcmd->pseq);
return TRUE;
}
@@ -263,11 +263,10 @@ flocal_send_file_init (qdaemon, qcmd)
else
qdaemon->cmax_ever = c2;
}
-
+
if (qdaemon->cmax_ever != -1
&& qdaemon->cmax_ever < qcmd->cbytes)
- return flocal_send_fail ((struct stransfer *) NULL, qcmd, qdaemon,
- "too large to send");
+ return flocal_send_fail (qcmd, qdaemon, "too large to send");
return TRUE;
}
@@ -286,6 +285,7 @@ flocal_send_file_init (qdaemon, qcmd)
qinfo->fspool = fspool;
qinfo->fsent = FALSE;
qinfo->zexec = NULL;
+ qinfo->zconfirm = NULL;
qtrans = qtransalc (qcmd);
qtrans->psendfn = flocal_send_request;
@@ -298,8 +298,7 @@ flocal_send_file_init (qdaemon, qcmd)
this reports an error to the log file and to the user. */
static boolean
-flocal_send_fail (qtrans, qcmd, qdaemon, zwhy)
- struct stransfer *qtrans;
+flocal_send_fail (qcmd, qdaemon, zwhy)
struct scmd *qcmd;
struct sdaemon *qdaemon;
const char *zwhy;
@@ -369,8 +368,7 @@ flocal_send_request (qtrans, qdaemon)
if (qdaemon->cmax_receive != -1
&& qdaemon->cmax_receive < qinfo->cbytes)
{
- fret = flocal_send_fail (qtrans, &qtrans->s, qdaemon,
- "too large for receiver");
+ fret = flocal_send_fail (&qtrans->s, qdaemon, "too large for receiver");
usfree_send (qtrans);
return fret;
}
@@ -500,8 +498,8 @@ flocal_send_request (qtrans, qdaemon)
qtrans->iremote);
ubuffree (zsend);
- if (! fret)
- usfree_send (qtrans);
+ /* If fret is FALSE, we should free qtrans here, but see the comment
+ at the end of flocal_rec_send_request. */
return fret;
}
@@ -594,12 +592,8 @@ flocal_send_await_reply (qtrans, qdaemon, zdata, cdata)
}
else
{
- if (! flocal_send_fail ((struct stransfer *) NULL, &qtrans->s,
- qdaemon, zerr))
- {
- usfree_send (qtrans);
- return FALSE;
- }
+ if (! flocal_send_fail (&qtrans->s, qdaemon, zerr))
+ return FALSE;
}
/* If the protocol does not support multiple channels, we can
@@ -637,8 +631,7 @@ flocal_send_await_reply (qtrans, qdaemon, zdata, cdata)
qtrans->psendfn = flocal_send_cancelled;
qtrans->precfn = NULL;
- /* Reuse fsent to pass fnever to flocal_send_cancelled. */
- qinfo->fsent = fnever;
+ qinfo->fnever = fnever;
return fqueue_send (qdaemon, qtrans);
}
@@ -672,6 +665,7 @@ flocal_send_await_reply (qtrans, qdaemon, zdata, cdata)
protocol supports multiple channels, we have already called
fqueue_send; calling it again would move the request in the
queue, which would make the log file a bit confusing. */
+ qtrans->fcmd = TRUE;
qtrans->precfn = fsend_await_confirm;
if (qinfo->fsent)
return fqueue_receive (qdaemon, qtrans);
@@ -814,9 +808,8 @@ flocal_send_cancelled (qtrans, qdaemon)
/* If we are breaking a 'E' command into two 'S' commands, and that
was for the first 'S' command, and the first 'S' command will
- never be sent (passed as qinfo->fsent), we still have to send the
- second one. */
- if (qinfo->fsent
+ never be sent, we still have to send the second one. */
+ if (qinfo->fnever
&& qtrans->s.bcmd == 'E'
&& (qdaemon->ifeatures & FEATURE_EXEC) == 0
&& qinfo->zexec == NULL)
@@ -937,6 +930,7 @@ fremote_rec_file_init (qdaemon, qcmd, iremote)
qinfo->fspool = FALSE;
qinfo->fsent = FALSE;
qinfo->zexec = NULL;
+ qinfo->zconfirm = NULL;
qtrans = qtransalc (qcmd);
qtrans->psendfn = fremote_rec_reply;
@@ -962,11 +956,17 @@ fremote_rec_reply (qtrans, qdaemon)
qtrans->fsendfile = TRUE;
qtrans->psendfn = fsend_file_end;
+ qtrans->fcmd = TRUE;
qtrans->precfn = fsend_await_confirm;
if (! fqueue_send (qdaemon, qtrans))
return FALSE;
+ qtrans->zlog = zbufalc (sizeof "Sending ( bytes) "
+ + strlen (qtrans->s.zfrom) + 25);
+ sprintf (qtrans->zlog, "Sending %s (%ld bytes)", qtrans->s.zfrom,
+ qinfo->cbytes);
+
/* We send the file size because SVR4 UUCP does. We don't look for
it. We send a trailing M if we want to request a hangup. We
send it both after the mode and at the end of the entire string;
@@ -982,15 +982,11 @@ fremote_rec_reply (qtrans, qdaemon)
qtrans->iremote))
{
(void) ffileclose (qtrans->e);
- usfree_send (qtrans);
+ /* Should probably free qtrans here, but see the comment at the
+ end of flocal_rec_send_request. */
return FALSE;
}
- qtrans->zlog = zbufalc (sizeof "Sending ( bytes) "
- + strlen (qtrans->s.zfrom) + 25);
- sprintf (qtrans->zlog, "Sending %s (%ld bytes)", qtrans->s.zfrom,
- qinfo->cbytes);
-
if (qdaemon->qproto->pffile != NULL)
{
boolean fhandled;
@@ -1039,9 +1035,7 @@ fremote_rec_fail_send (qtrans, qdaemon)
{
enum tfailure *ptinfo = (enum tfailure *) qtrans->pinfo;
const char *z;
- boolean fret;
- int ilocal = qtrans->ilocal;
- int iremote = qtrans->iremote;
+ int ilocal, iremote;
switch (*ptinfo)
{
@@ -1056,11 +1050,14 @@ fremote_rec_fail_send (qtrans, qdaemon)
z = "RN";
break;
}
+
+ ilocal = qtrans->ilocal;
+ iremote = qtrans->iremote;
xfree (qtrans->pinfo);
utransfree (qtrans);
- fret = (*qdaemon->qproto->pfsendcmd) (qdaemon, z, ilocal, iremote);
- return fret;
+
+ return (*qdaemon->qproto->pfsendcmd) (qdaemon, z, ilocal, iremote);
}
/* This is called when the main loop has finished sending a file. It
@@ -1093,8 +1090,13 @@ fsend_file_end (qtrans, qdaemon)
qinfo->fsent = TRUE;
+ /* If zconfirm is set, then we have already received the
+ confirmation, and should call fsend_await_confirm directly. */
+ if (qinfo->zconfirm != NULL)
+ return fsend_await_confirm (qtrans, qdaemon, qinfo->zconfirm,
+ strlen (qinfo->zconfirm) + 1);
+
/* qtrans->precfn should have been set by a previous function. */
- qtrans->fcmd = TRUE;
return fqueue_receive (qdaemon, qtrans);
}
@@ -1112,6 +1114,18 @@ fsend_await_confirm (qtrans, qdaemon, zdata, cdata)
boolean fnever;
const char *zerr;
+ /* If fsent is FALSE, it means that we have received the
+ confirmation before fsend_file_end got called. To avoid
+ confusion, we save away the confirmation message, and let
+ fsend_file_end call us directly. If we did not do this, we would
+ have to fix a thorny race condition in floop, which wants to
+ refer to the qtrans structure after sending the end of the file. */
+ if (! qinfo->fsent)
+ {
+ qinfo->zconfirm = zbufcpy (zdata);
+ return TRUE;
+ }
+
if (qinfo->zexec == NULL)
(void) ffileclose (qtrans->e);
@@ -1153,7 +1167,7 @@ fsend_await_confirm (qtrans, qdaemon, zdata, cdata)
ustats (zerr == NULL, qtrans->s.zuser, qdaemon->qsys->uuconf_zname,
TRUE, qtrans->cbytes, qtrans->isecs, qtrans->imicros,
- qdaemon->fmaster);
+ qdaemon->fcaller);
qdaemon->csent += qtrans->cbytes;
if (zerr == NULL)
@@ -1264,6 +1278,8 @@ fsend_exec_file_init (qtrans, qdaemon)
qtrans->isecs = 0;
qtrans->imicros = 0;
qinfo->fsent = FALSE;
+ ubuffree (qinfo->zconfirm);
+ qinfo->zconfirm = NULL;
return fqueue_send (qdaemon, qtrans);
}
diff --git a/gnu/libexec/uucp/uucico/time.c b/gnu/libexec/uucp/uucico/time.c
index a83f732..7484246 100644
--- a/gnu/libexec/uucp/uucico/time.c
+++ b/gnu/libexec/uucp/uucico/time.c
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char time_rcsid[] = "$Id: time.c,v 1.19 1994/01/30 21:01:46 ian Rel $";
+const char time_rcsid[] = "$Id: time.c,v 1.21 1995/06/21 19:16:02 ian Rel $";
#endif
#include <ctype.h>
diff --git a/gnu/libexec/uucp/uucico/trans.c b/gnu/libexec/uucp/uucico/trans.c
index 1cb5487..b2babd6 100644
--- a/gnu/libexec/uucp/uucico/trans.c
+++ b/gnu/libexec/uucp/uucico/trans.c
@@ -1,7 +1,7 @@
/* trans.c
Routines to handle file transfers.
- Copyright (C) 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char trans_rcsid[] = "$Id: trans.c,v 1.2 1994/05/07 18:13:59 ache Exp $";
+const char trans_rcsid[] = "$Id: trans.c,v 1.40 1995/08/11 02:43:32 ian Rel $";
#endif
#include <errno.h>
@@ -45,9 +45,8 @@ static void utdequeue P((struct stransfer *));
static void utchanalc P((struct sdaemon *qdaemon, struct stransfer *qtrans));
__inline__ static struct stransfer *qtchan P((int ichan));
__inline__ static void utchanfree P((struct stransfer *qtrans));
-static boolean ftcharge P((struct sdaemon *qdaemon,
- struct stransfer *qtrans,
- boolean fsend, boolean fforce));
+static boolean fttime P((struct sdaemon *qdaemon, long *pisecs,
+ long *pimicros));
static boolean fcheck_queue P((struct sdaemon *qdaemon));
static boolean ftadd_cmd P((struct sdaemon *qdaemon, const char *z,
size_t cdata, int iremote, boolean flast));
@@ -93,19 +92,15 @@ static int iTchan;
This is maintained for remote jobs. */
static struct stransfer *aqTremote[IMAX_CHAN + 1];
-/* A structure used to charge time to file transfers. */
-struct scharge
-{
- /* The transfer we are currently charging. */
- struct stransfer *qtrans;
- /* The time at the last update. */
- long isecs;
- long imicros;
-};
+/* The transaction we are currently receiving. This is used to avoid
+ getting the time too frequently. */
+static struct stransfer *qTtiming_rec;
-/* We are always charging one send and one receive. */
-static struct scharge sTsend;
-static struct scharge sTreceive;
+/* The time from which to charge any received data. This is either
+ the last time we charged for received data, or the last time
+ something was put on the empty receive queue. */
+static long iTrecsecs;
+static long iTrecmicros;
/* The minimum amount of time, in seconds, to wait between times we
check the spool directory, if we are busy transferring data. If we
@@ -216,9 +211,7 @@ fqueue_remote (qdaemon, qtrans)
aqTremote[qtrans->iremote] = qtrans;
utdequeue (qtrans);
utqueue (&qTremote, qtrans, FALSE);
-
- /* We just received data for this transfer, so start charging. */
- return ftcharge (qdaemon, qtrans, FALSE, FALSE);
+ return TRUE;
}
/* Queue up a transfer with something to send. */
@@ -267,10 +260,6 @@ fqueue_send (qdaemon, qtrans)
qtrans->pqqueue = &qTsend;
}
- /* Since we're now going to wait to send data, don't charge this
- transfer for receive time. */
- if (qtrans == sTreceive.qtrans)
- return ftcharge (qdaemon, (struct stransfer *) NULL, FALSE, FALSE);
return TRUE;
}
@@ -285,13 +274,16 @@ fqueue_receive (qdaemon, qtrans)
if (qtrans->precfn == NULL)
ulog (LOG_FATAL, "fqueue_receive: Bad call");
#endif
+
+ /* If this is the only item on the receive queue, we do not want to
+ charge it for any time during which we have not been waiting for
+ anything, so update the receive timestamp. */
+ if (qTreceive == NULL)
+ iTrecsecs = ixsysdep_process_time (&iTrecmicros);
+
utdequeue (qtrans);
utqueue (&qTreceive, qtrans, FALSE);
- /* Since we are now going to wait to receive data, don't charge this
- transfer for send time. */
- if (qtrans == sTsend.qtrans)
- return ftcharge (qdaemon, (struct stransfer *) NULL, TRUE, FALSE);
return TRUE;
}
@@ -411,8 +403,8 @@ utransfree (q)
ubuffree ((char *) q->s.ztemp);
ubuffree ((char *) q->s.znotify);
ubuffree ((char *) q->s.zcmd);
-
- utchanfree (q);
+
+ utchanfree (q);
if (q->iremote > 0)
{
aqTremote[q->iremote] = NULL;
@@ -433,80 +425,32 @@ utransfree (q)
q->precfn = NULL;
#endif
- /* Don't try to charge time to this structure any longer. */
- if (sTsend.qtrans == q)
- sTsend.qtrans = NULL;
- if (sTreceive.qtrans == q)
- sTreceive.qtrans = NULL;
+ /* Avoid any possible confusion in the timing code. */
+ if (qTtiming_rec == q)
+ qTtiming_rec = NULL;
utdequeue (q);
utqueue (&qTavail, q, FALSE);
}
-/* Handle timing of file tranfers. This is called when processing
- starts for a transfer structure. All time up to the next call to
- this function is charged to that transfer structure. Sending time
- and receiving time are charged separately. Normally if we are
- about to start charging the same structure we are already charging,
- we do nothing; but if the fforce argument is TRUE, we charge the
- time anyhow. */
+/* Get the time. This is a wrapper around ixsysdep_process_time. If
+ enough time has elapsed since the last time we got the time, check
+ the work queue. */
static boolean
-ftcharge (qdaemon, qtrans, fsend, fforce)
+fttime (qdaemon, pisecs, pimicros)
struct sdaemon *qdaemon;
- struct stransfer *qtrans;
- boolean fsend;
- boolean fforce;
+ long *pisecs;
+ long *pimicros;
{
- struct scharge *qcharge, *qother;
- long inextsecs, inextmicros;
-
- if (fsend)
- {
- qcharge = &sTsend;
- qother = &sTreceive;
- }
- else
- {
- qcharge = &sTreceive;
- qother = &sTsend;
- }
-
- if (! fforce && qtrans == qcharge->qtrans)
- return TRUE;
-
- inextsecs = ixsysdep_process_time (&inextmicros);
- if (qcharge->qtrans != NULL)
- {
- qcharge->qtrans->isecs += inextsecs - qcharge->isecs;
- qcharge->qtrans->imicros += inextmicros - qcharge->imicros;
-
- /* If we are charging the same structure for both send and
- receive, update the time we are not currently charging so
- that we don't charge twice for the same time. */
- if (qcharge->qtrans == qother->qtrans)
- {
- qother->isecs = inextsecs;
- qother->imicros = inextmicros;
- }
- }
-
- qcharge->qtrans = qtrans;
- qcharge->isecs = inextsecs;
- qcharge->imicros = inextmicros;
-
- /* If enough time has elapsed since the last time we checked the
- queue, check it again. We do this here because we have already
- gone to the trouble of getting the time. */
- if (inextsecs - iTchecktime >= CCHECKWAIT)
+ *pisecs = ixsysdep_process_time (pimicros);
+ if (*pisecs - iTchecktime >= CCHECKWAIT)
{
if (! fcheck_queue (qdaemon))
return FALSE;
}
-
return TRUE;
}
-
/* Gather local commands and queue them up for later processing. Also
recompute time based control values. */
@@ -517,6 +461,7 @@ fqueue (qdaemon, pfany)
boolean *pfany;
{
const struct uuconf_system *qsys;
+ long ival;
int bgrade;
struct uuconf_timespan *qlocal_size, *qremote_size;
@@ -526,13 +471,18 @@ fqueue (qdaemon, pfany)
qsys = qdaemon->qsys;
/* If we are not the caller, the grade will be set during the
- initial handshake. */
+ initial handshake, although this may be overridden by the
+ calledtimegrade configuration option. */
if (! qdaemon->fcaller)
- bgrade = qdaemon->bgrade;
+ {
+ if (! ftimespan_match (qsys->uuconf_qcalledtimegrade, &ival,
+ (int *) NULL))
+ bgrade = qdaemon->bgrade;
+ else
+ bgrade = (char) ival;
+ }
else
{
- long ival;
-
if (! ftimespan_match (qsys->uuconf_qtimegrade, &ival,
(int *) NULL))
bgrade = '\0';
@@ -612,7 +562,7 @@ fqueue (qdaemon, pfany)
break;
#endif
}
- }
+ }
if (pfany != NULL)
*pfany = qTlocal != NULL;
@@ -639,8 +589,7 @@ uclear_queue (qdaemon)
qTreceive = NULL;
cTchans = 0;
iTchan = 0;
- sTsend.qtrans = NULL;
- sTreceive.qtrans = NULL;
+ qTtiming_rec = NULL;
cTcmdlen = 0;
qTreceive_ack = NULL;
for (i = 0; i < IMAX_CHAN + 1; i++)
@@ -812,12 +761,10 @@ floop (qdaemon)
if (! q->fsendfile)
{
- if (! ftcharge (qdaemon, q, TRUE, TRUE))
- {
- fret = FALSE;
- break;
- }
-
+ /* Technically, we should add the time required for this
+ call to q->isecs and q->imicros. In practice, the
+ amount of time required should be sufficiently small
+ that it can be safely disregarded. */
if (! (*q->psendfn) (q, qdaemon))
{
fret = FALSE;
@@ -826,11 +773,16 @@ floop (qdaemon)
}
else
{
- if (! ftcharge (qdaemon, q, TRUE, FALSE))
+ long isecs, imicros;
+ boolean fcharged;
+ long inextsecs = 0, inextmicros;
+
+ if (! fttime (qdaemon, &isecs, &imicros))
{
fret = FALSE;
break;
}
+ fcharged = FALSE;
if (q->zlog != NULL)
{
@@ -864,7 +816,7 @@ floop (qdaemon)
else
{
cdata = cfileread (q->e, zdata, cdata);
- if (ffilereaderror (q->e, cdata))
+ if (ffileioerror (q->e, cdata))
{
/* There is no way to report a file reading
error, so we just drop the connection. */
@@ -891,17 +843,48 @@ floop (qdaemon)
/* We must update the time now, because this
call may make an entry in the statistics
file. */
- if (! ftcharge (qdaemon, q, TRUE, TRUE))
- fret = FALSE;
+ inextsecs = ixsysdep_process_time (&inextmicros);
+ DEBUG_MESSAGE4 (DEBUG_UUCP_PROTO,
+ "floop: Charging %ld to %c %s %s",
+ ((inextsecs - isecs) * 1000000
+ + inextmicros - imicros),
+ q->s.bcmd, q->s.zfrom, q->s.zto);
+ q->isecs += inextsecs - isecs;
+ q->imicros += inextmicros - imicros;
+ fcharged = TRUE;
+
q->fsendfile = FALSE;
+
if (! (*q->psendfn) (q, qdaemon))
fret = FALSE;
+
break;
}
}
if (! fret)
break;
+
+ if (! fcharged)
+ {
+ inextsecs = ixsysdep_process_time (&inextmicros);
+ DEBUG_MESSAGE4 (DEBUG_UUCP_PROTO,
+ "floop: Charging %ld to %c %s %s",
+ ((inextsecs - isecs) * 1000000
+ + inextmicros - imicros),
+ q->s.bcmd, q->s.zfrom, q->s.zto);
+ q->isecs += inextsecs - isecs;
+ q->imicros += inextmicros - imicros;
+ }
+
+ if (inextsecs - iTchecktime >= CCHECKWAIT)
+ {
+ if (! fcheck_queue (qdaemon))
+ {
+ fret = FALSE;
+ break;
+ }
+ }
}
}
}
@@ -926,7 +909,7 @@ floop (qdaemon)
TRUE if we just receive data for a file. This routine never sets
*pfexit to FALSE. */
-boolean
+boolean
fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
fallacked, pfexit)
struct sdaemon *qdaemon;
@@ -943,6 +926,7 @@ fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
struct stransfer *q;
int cwrote;
boolean fret;
+ long isecs, imicros;
if (fallacked && qTreceive_ack != NULL)
uwindow_acked (qdaemon, TRUE);
@@ -989,6 +973,11 @@ fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
if (pfexit != NULL && (qdaemon->fhangup || qTremote != NULL))
*pfexit = TRUE;
+ /* Time spent waiting for a new command is not charged to
+ anybody. */
+ if (! fttime (qdaemon, &iTrecsecs, &iTrecmicros))
+ fret = FALSE;
+
return fret;
}
else
@@ -1011,6 +1000,54 @@ fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
fret = TRUE;
+ if (q->zlog != NULL && ! q->fsendfile)
+ {
+ ulog (LOG_NORMAL, "%s", q->zlog);
+ ubuffree (q->zlog);
+ q->zlog = NULL;
+ }
+
+ if (cfirst == 0 || q->fcmd || ! q->frecfile || q != qTtiming_rec)
+ {
+ struct stransfer *qcharge;
+
+ /* Either we are receiving some sort of command, or we are
+ receiving data for a transfer other than the one we are
+ currently timing. It we are currently timing a transfer,
+ charge any accumulated time to it. Otherwise, if we
+ currently have something to send, just forget about the
+ accumulated time (when using a bidirectional protocol, it's
+ very difficult to charge this time correctly). Otherwise,
+ charge it to whatever transfer receives it. */
+ if (! fttime (qdaemon, &isecs, &imicros))
+ fret = FALSE;
+ if (qTtiming_rec != NULL)
+ qcharge = qTtiming_rec;
+ else if (qTsend != NULL)
+ qcharge = NULL;
+ else
+ qcharge = q;
+ if (qcharge != NULL)
+ {
+ DEBUG_MESSAGE4 (DEBUG_UUCP_PROTO,
+ "fgot_data: Charging %ld to %c %s %s",
+ ((isecs - iTrecsecs) * 1000000
+ + imicros - iTrecmicros),
+ qcharge->s.bcmd, qcharge->s.zfrom,
+ qcharge->s.zto);
+ qcharge->isecs += isecs - iTrecsecs;
+ qcharge->imicros += imicros - iTrecmicros;
+ }
+ iTrecsecs = isecs;
+ iTrecmicros = imicros;
+
+ /* If we received file data, start timing the new transfer. */
+ if (cfirst == 0 || q->fcmd || ! q->frecfile)
+ qTtiming_rec = NULL;
+ else
+ qTtiming_rec = q;
+ }
+
/* If we're receiving a command, then accumulate it up to the null
byte. */
if (q->fcmd)
@@ -1050,8 +1087,6 @@ fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
char *zcmd;
size_t ccmd;
- if (! ftcharge (qdaemon, q, FALSE, TRUE))
- fret = FALSE;
zcmd = q->zcmd;
ccmd = q->ccmd;
q->fcmd = FALSE;
@@ -1061,11 +1096,6 @@ fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
fret = FALSE;
ubuffree (zcmd);
}
- else
- {
- if (! ftcharge (qdaemon, q, FALSE, FALSE))
- fret = FALSE;
- }
if (pfexit != NULL
&& (qdaemon->fhangup
@@ -1077,8 +1107,6 @@ fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
{
/* We're either not receiving a file or the file transfer is
complete. */
- if (! ftcharge (qdaemon, q, FALSE, TRUE))
- fret = FALSE;
q->frecfile = FALSE;
if (! (*q->precfn) (q, qdaemon, zfirst, cfirst))
fret = FALSE;
@@ -1095,16 +1123,6 @@ fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
}
else
{
- if (! ftcharge (qdaemon, q, FALSE, FALSE))
- fret = FALSE;
-
- if (q->zlog != NULL)
- {
- ulog (LOG_NORMAL, "%s", q->zlog);
- ubuffree (q->zlog);
- q->zlog = NULL;
- }
-
if (ipos != -1 && ipos != q->ipos)
{
DEBUG_MESSAGE1 (DEBUG_UUCP_PROTO,
@@ -1146,7 +1164,7 @@ fgot_data (qdaemon, zfirst, cfirst, zsecond, csecond, ilocal, iremote, ipos,
}
else
{
- if (cwrote < 0)
+ if (ffileioerror (q->e, cwrote))
ulog (LOG_ERROR, "write: %s", strerror (errno));
else
ulog (LOG_ERROR,
@@ -1216,7 +1234,8 @@ ftadd_cmd (qdaemon, z, clen, iremote, flast)
DEBUG_MESSAGE1 (DEBUG_UUCP_PROTO,
"ftadd_cmd: Got command \"%s\"", zbuf);
- if (! fparse_cmd (zbuf, &s))
+ if (! fparse_cmd (zbuf, &s)
+ || s.bcmd == 'P')
{
ulog (LOG_ERROR, "Received garbled command \"%s\"", zbuf);
return TRUE;
@@ -1253,6 +1272,7 @@ ftadd_cmd (qdaemon, z, clen, iremote, flast)
q = qtransalc ((struct scmd *) NULL);
q->psendfn = fremote_hangup_reply;
q->iremote = iremote;
+ q->s.bcmd = 'H';
return fqueue_remote (qdaemon, q);
}
case 'N':
@@ -1401,11 +1421,6 @@ ufailed (qdaemon)
{
register struct stransfer *q;
- /* Update the transfer times, but avoid looking in the queue. */
- iTchecktime = ixsysdep_process_time ((long *) NULL);
- (void) ftcharge (qdaemon, (struct stransfer *) NULL, TRUE, TRUE);
- (void) ftcharge (qdaemon, (struct stransfer *) NULL, FALSE, TRUE);
-
if (qTsend != NULL)
{
q = qTsend;
@@ -1416,7 +1431,7 @@ ufailed (qdaemon)
{
ustats (FALSE, q->s.zuser, qdaemon->qsys->uuconf_zname,
q->fsendfile, q->cbytes, q->isecs, q->imicros,
- FALSE);
+ qdaemon->fcaller);
if (q->fsendfile)
qdaemon->csent += q->cbytes;
else
@@ -1439,7 +1454,7 @@ ufailed (qdaemon)
{
ustats (FALSE, q->s.zuser, qdaemon->qsys->uuconf_zname,
q->fsendfile, q->cbytes, q->isecs, q->imicros,
- FALSE);
+ qdaemon->fcaller);
if (q->fsendfile)
qdaemon->csent += q->cbytes;
else
diff --git a/gnu/libexec/uucp/uucico/uucico.8 b/gnu/libexec/uucp/uucico/uucico.8
index 99f5682..a7ca915 100644
--- a/gnu/libexec/uucp/uucico/uucico.8
+++ b/gnu/libexec/uucp/uucico/uucico.8
@@ -1,5 +1,5 @@
-''' $Id: uucico.8,v 1.3 1994/05/07 18:14:01 ache Exp $
-.TH uucico 8 "Taylor UUCP 1.05"
+''' $Id: uucico.8,v 1.18 1995/06/26 22:36:09 ian Rel $
+.TH uucico 8 "Taylor UUCP 1.06"
.SH NAME
uucico \- UUCP file transfer daemon
.SH SYNOPSIS
@@ -250,8 +250,8 @@ is equivalent to
.B \-\-debug abnormal,chat.
The debugging output is sent to the debugging file, usually one of
-/var/spool/uucp/Debug, /var/spool/uucp/DEBUG, or
-/var/spool/uucp/.Admin/audit.local.
+/var/spool/uucp/Debug, /usr/spool/uucp/DEBUG, or
+/usr/spool/uucp/.Admin/audit.local.
.TP 5
.B \-I file, \-\-config file
Set configuration file to use. This option may not be available,
@@ -264,12 +264,6 @@ Report version information and exit.
.TP 5
.B \-\-help
Print a help message and exit.
-.TP 5
-.B \-u login
-This option is ignored. It is only included because some versions of
-uucpd invoke
-.I uucico
-with it.
.SH FILES
The file names may be changed at compilation time or by the
configuration file, so these are only approximations.
diff --git a/gnu/libexec/uucp/uucico/uucico.c b/gnu/libexec/uucp/uucico/uucico.c
index 8183980..4044a31 100644
--- a/gnu/libexec/uucp/uucico/uucico.c
+++ b/gnu/libexec/uucp/uucico/uucico.c
@@ -1,7 +1,7 @@
/* uucico.c
This is the main UUCP communication program.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uucico_rcsid[] = "$Id: uucico.c,v 1.3 1994/05/25 20:14:52 ache Exp $";
+const char uucico_rcsid[] = "$Id: uucico.c,v 1.190 1995/06/29 19:35:59 ian Rel $";
#endif
#include <ctype.h>
@@ -95,7 +95,10 @@ static const struct sprotocol asProtocols[] =
ffsenddata, ffwait, fffile },
{ 'v', UUCONF_RELIABLE_EIGHT, 1, TRUE,
asGproto_params, fvstart, fgshutdown, fgsendcmd, zggetspace,
- fgsenddata, fgwait, NULL }
+ fgsenddata, fgwait, NULL },
+ { 'y', UUCONF_RELIABLE_RELIABLE | UUCONF_RELIABLE_EIGHT, 1, TRUE,
+ asYproto_params, fystart, fyshutdown, fysendcmd, zygetspace,
+ fysenddata, fywait, fyfile }
};
#define CPROTOCOLS (sizeof asProtocols / sizeof asProtocols[0])
@@ -161,8 +164,9 @@ static void uapply_proto_params P((pointer puuconf, int bproto,
static boolean fsend_uucp_cmd P((struct sconnection *qconn,
const char *z));
static char *zget_uucp_cmd P((struct sconnection *qconn,
- boolean frequired));
-static char *zget_typed_line P((struct sconnection *qconn));
+ boolean frequired, boolean fstrip));
+static char *zget_typed_line P((struct sconnection *qconn,
+ boolean fstrip));
/* Long getopt options. */
static const struct option asLongopts[] =
@@ -333,7 +337,7 @@ main (argc, argv)
else
uusage ();
break;
-
+
case 's':
/* Set system name */
zsystem = optarg;
@@ -386,7 +390,7 @@ main (argc, argv)
case 'v':
/* Print version and exit. */
- printf ("%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -784,7 +788,7 @@ uusage ()
static void
uhelp ()
{
- printf ("Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
printf ("Usage: %s [options]\n", zProgram);
printf (" -s,-S,--system system: Call system (-S implies -f)\n");
@@ -877,6 +881,7 @@ fcall (puuconf, zconfig, fuuxqt, qorigsys, qport, fifwork, fforce, fdetach,
if (! fsysdep_get_status (qorigsys, &sstat, (boolean *) NULL))
return FALSE;
+ ubuffree (sstat.zstring);
/* Make sure it's been long enough since the last failed call, and
that we haven't exceeded the maximum number of retries. Even if
@@ -1205,8 +1210,10 @@ fdo_call (qdaemon, qstat, qdialer, pfcalled, pterr)
pointer puuconf;
const struct uuconf_system *qsys;
struct sconnection *qconn;
- const char *zport;
int iuuconf;
+ int istrip;
+ boolean fstrip;
+ const char *zport;
char *zstr;
long istart_time;
char *zlog;
@@ -1215,6 +1222,14 @@ fdo_call (qdaemon, qstat, qdialer, pfcalled, pterr)
qsys = qdaemon->qsys;
qconn = qdaemon->qconn;
+ iuuconf = uuconf_strip (puuconf, &istrip);
+ if (iuuconf != UUCONF_SUCCESS)
+ {
+ ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
+ return FALSE;
+ }
+ fstrip = (istrip & UUCONF_STRIP_PROTO) != 0;
+
*pterr = STATUS_LOGIN_FAILED;
if (qconn->qport == NULL)
@@ -1234,7 +1249,7 @@ fdo_call (qdaemon, qstat, qdialer, pfcalled, pterr)
/* We should now see "Shere" from the other system. Newer systems
send "Shere=foo" where foo is the remote name. */
- zstr = zget_uucp_cmd (qconn, TRUE);
+ zstr = zget_uucp_cmd (qconn, TRUE, fstrip);
if (zstr == NULL)
return FALSE;
@@ -1339,7 +1354,7 @@ fdo_call (qdaemon, qstat, qdialer, pfcalled, pterr)
ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
return FALSE;
}
- }
+ }
zsend = zbufalc (strlen (qdaemon->zlocalname) + 70);
if (! qsys->uuconf_fsequence)
@@ -1385,7 +1400,7 @@ fdo_call (qdaemon, qstat, qdialer, pfcalled, pterr)
/* Now we should see ROK or Rreason where reason gives a cryptic
reason for failure. If we are talking to a counterpart, we will
get back ROKN, possibly with a feature bitfield attached. */
- zstr = zget_uucp_cmd (qconn, TRUE);
+ zstr = zget_uucp_cmd (qconn, TRUE, fstrip);
if (zstr == NULL)
return FALSE;
@@ -1460,7 +1475,7 @@ fdo_call (qdaemon, qstat, qdialer, pfcalled, pterr)
/* The slave should now send \020Pprotos\0 where protos is a list of
supported protocols. Each protocol is a single character. */
- zstr = zget_uucp_cmd (qconn, TRUE);
+ zstr = zget_uucp_cmd (qconn, TRUE, fstrip);
if (zstr == NULL)
return FALSE;
@@ -1618,7 +1633,7 @@ fdo_call (qdaemon, qstat, qdialer, pfcalled, pterr)
before the hangup string. */
for (i = 0; i < 25; i++)
{
- zstr = zget_uucp_cmd (qconn, FALSE);
+ zstr = zget_uucp_cmd (qconn, FALSE, fstrip);
if (zstr == NULL)
break;
fdone = strstr (zstr, "OOOOOO") != NULL;
@@ -1700,13 +1715,23 @@ flogin_prompt (puuconf, zconfig, fuuxqt, qconn, zlogin)
struct sconnection *qconn;
const char *zlogin;
{
+ int iuuconf;
+ int istrip;
+ boolean fstrip;
char *zuser, *zpass;
boolean fret;
- int iuuconf;
struct scallin_info s;
DEBUG_MESSAGE0 (DEBUG_HANDSHAKE, "flogin_prompt: Waiting for login");
+ iuuconf = uuconf_strip (puuconf, &istrip);
+ if (iuuconf != UUCONF_SUCCESS)
+ {
+ ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
+ return FALSE;
+ }
+ fstrip = (istrip & UUCONF_STRIP_LOGIN) != 0;
+
zuser = NULL;
if (zlogin == NULL)
{
@@ -1715,7 +1740,7 @@ flogin_prompt (puuconf, zconfig, fuuxqt, qconn, zlogin)
ubuffree (zuser);
if (! fconn_write (qconn, "login: ", sizeof "login: " - 1))
return FALSE;
- zuser = zget_typed_line (qconn);
+ zuser = zget_typed_line (qconn, fstrip);
}
while (zuser != NULL && *zuser == '\0');
@@ -1731,7 +1756,7 @@ flogin_prompt (puuconf, zconfig, fuuxqt, qconn, zlogin)
return FALSE;
}
- zpass = zget_typed_line (qconn);
+ zpass = zget_typed_line (qconn, fstrip);
if (zpass == NULL)
{
ubuffree (zuser);
@@ -1819,10 +1844,12 @@ faccept_call (puuconf, zconfig, fuuxqt, zlogin, qconn, pzsystem)
const char **pzsystem;
{
long istart_time;
+ int iuuconf;
+ int istrip;
+ boolean fstrip;
const char *zport;
struct uuconf_port *qport;
struct uuconf_port sport;
- int iuuconf;
struct uuconf_dialer *qdialer;
struct uuconf_dialer sdialer;
boolean ftcp_port;
@@ -1847,6 +1874,17 @@ faccept_call (puuconf, zconfig, fuuxqt, zlogin, qconn, pzsystem)
istart_time = ixsysdep_time ((long *) NULL);
+ iuuconf = uuconf_strip (puuconf, &istrip);
+ if (iuuconf != UUCONF_SUCCESS)
+ {
+ ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
+ uaccept_call_cleanup (puuconf, (struct uuconf_system *) NULL,
+ (struct uuconf_port *) NULL,
+ &sport, (char *) NULL);
+ return FALSE;
+ }
+ fstrip = (istrip & UUCONF_STRIP_PROTO) != 0;
+
/* Figure out protocol parameters determined by the port. If no
port was specified we're reading standard input, so try to get
the port name and read information from the port file. We only
@@ -1907,7 +1945,7 @@ faccept_call (puuconf, zconfig, fuuxqt, zlogin, qconn, pzsystem)
}
else
qdialer = qport->uuconf_u.uuconf_smodem.uuconf_qdialer;
- }
+ }
else if (qport->uuconf_ttype == UUCONF_PORTTYPE_TCP
|| (qport->uuconf_ttype == UUCONF_PORTTYPE_TLI
&& (qport->uuconf_ireliable
@@ -1981,7 +2019,7 @@ faccept_call (puuconf, zconfig, fuuxqt, zlogin, qconn, pzsystem)
return FALSE;
}
- zstr = zget_uucp_cmd (qconn, TRUE);
+ zstr = zget_uucp_cmd (qconn, TRUE, fstrip);
if (zstr == NULL)
{
uaccept_call_cleanup (puuconf, (struct uuconf_system *) NULL,
@@ -2195,7 +2233,7 @@ faccept_call (puuconf, zconfig, fuuxqt, zlogin, qconn, pzsystem)
getopt, which is distributed with the program anyhow. */
optind = 0;
opterr = 0;
-
+
while ((iopt = getopt (pzset - paz, paz,
"N::p:Q:RU:v:x:")) != EOF)
{
@@ -2427,9 +2465,9 @@ faccept_call (puuconf, zconfig, fuuxqt, zlogin, qconn, pzsystem)
uaccept_call_cleanup (puuconf, &ssys, qport, &sport, zloc);
return FALSE;
}
-
+
/* The master will now send back the selected protocol. */
- zstr = zget_uucp_cmd (qconn, TRUE);
+ zstr = zget_uucp_cmd (qconn, TRUE, fstrip);
if (zstr == NULL)
{
sstat.ttype = STATUS_FAILED;
@@ -2581,7 +2619,7 @@ faccept_call (puuconf, zconfig, fuuxqt, zlogin, qconn, pzsystem)
string. */
for (i = 0; i < 25; i++)
{
- zstr = zget_uucp_cmd (qconn, FALSE);
+ zstr = zget_uucp_cmd (qconn, FALSE, fstrip);
if (zstr == NULL)
break;
fdone = strstr (zstr, "OOOOOO") != NULL;
@@ -2719,9 +2757,10 @@ fsend_uucp_cmd (qconn, z)
#define CINCREMENT (100)
static char *
-zget_uucp_cmd (qconn, frequired)
+zget_uucp_cmd (qconn, frequired, fstrip)
struct sconnection *qconn;
boolean frequired;
+ boolean fstrip;
{
char *zalc;
size_t calc;
@@ -2757,7 +2796,7 @@ zget_uucp_cmd (qconn, frequired)
while ((ctimeout = (int) (iendtime - ixsysdep_time ((long *) NULL))) > 0)
{
int b;
-
+
b = breceive_char (qconn, ctimeout, frequired);
/* Now b == -1 on timeout, -2 on error. */
if (b < 0)
@@ -2777,10 +2816,8 @@ zget_uucp_cmd (qconn, frequired)
}
/* Apparently some systems use parity on these strings, so we
- strip the parity bit. This may need to be configurable at
- some point, although only if system names can have eight bit
- characters. */
- if (! isprint (BUCHAR (b)))
+ optionally strip the parity bit. */
+ if (fstrip)
b &= 0x7f;
#if DEBUG > 1
@@ -2870,10 +2907,11 @@ zget_uucp_cmd (qconn, frequired)
did, ignore a leading \n to account for \r\n pairs. */
static char *
-zget_typed_line (qconn)
+zget_typed_line (qconn, fstrip)
struct sconnection *qconn;
+ boolean fstrip;
{
- static boolean flastcr;
+ static boolean flastcr;
char *zalc;
size_t calc;
size_t cgot;
@@ -2897,7 +2935,7 @@ zget_typed_line (qconn)
while (TRUE)
{
int b;
-
+
b = breceive_char (qconn, CTIMEOUT, FALSE);
/* Now b == -1 on timeout, -2 on error. */
@@ -2922,6 +2960,10 @@ zget_typed_line (qconn)
continue;
}
+ /* Optionally strip the parity bit. */
+ if (fstrip)
+ b &= 0x7f;
+
#if DEBUG > 1
if (FDEBUGGING (DEBUG_CHAT))
{
diff --git a/gnu/libexec/uucp/uucico/xcmd.c b/gnu/libexec/uucp/uucico/xcmd.c
index b563a53..a02411a 100644
--- a/gnu/libexec/uucp/uucico/xcmd.c
+++ b/gnu/libexec/uucp/uucico/xcmd.c
@@ -1,7 +1,7 @@
/* xcmd.c
Routines to handle work requests.
- Copyright (C) 1991, 1992, 1993 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char xcmd_rcsid[] = "$Id: xcmd.c,v 1.14 1994/04/04 03:25:12 ian Rel $";
+const char xcmd_rcsid[] = "$Id: xcmd.c,v 1.19 1995/06/21 20:20:42 ian Rel $";
#endif
#include <errno.h>
@@ -97,8 +97,8 @@ flocal_xcmd_request (qtrans, qdaemon)
qtrans->iremote);
ubuffree (zsend);
- if (! fret)
- utransfree (qtrans);
+ /* If fret is FALSE, we should free qtrans here, but see the comment
+ at the end of flocal_rec_send_request. */
return fret;
}
@@ -330,7 +330,7 @@ fremote_xcmd_init (qdaemon, qcmd, iremote)
/* Copy the file either to the final destination or to the
spool directory. */
- if (! fcopy_file (zfile, zto, qdestsys == NULL, fmkdirs))
+ if (! fcopy_file (zfile, zto, qdestsys == NULL, fmkdirs, FALSE))
{
ubuffree (zto);
break;
diff --git a/gnu/libexec/uucp/uuconv/uuconv.c b/gnu/libexec/uucp/uuconv/uuconv.c
index 3d6ee47..2528140 100644
--- a/gnu/libexec/uucp/uuconv/uuconv.c
+++ b/gnu/libexec/uucp/uuconv/uuconv.c
@@ -1,7 +1,7 @@
/* uuconv.c
Convert one type of UUCP configuration file to another.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucnfi.h"
#if USE_RCS_ID
-const char uuconv_rcsid[] = "$Id: uuconv.c,v 1.2 1994/05/07 18:14:06 ache Exp $";
+const char uuconv_rcsid[] = "$Id: uuconv.c,v 1.27 1995/06/29 19:36:27 ian Rel $";
#endif
#include "getopt.h"
@@ -158,7 +158,7 @@ main (argc, argv)
/* Print version and exit. */
fprintf
(stderr,
- "%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ "%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -395,7 +395,7 @@ main (argc, argv)
piportfn, (pointer) eport, &sport);
break;
}
-
+
if (iret != UUCONF_NOT_FOUND)
uvuuconf_error (pinput, iret);
@@ -524,7 +524,7 @@ static void
uvhelp ()
{
fprintf (stderr,
- "Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ "Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
fprintf (stderr, "Converts UUCP configuration files from one format to another.\n");
fprintf (stderr,
@@ -740,7 +740,7 @@ uvwrite_chat (e, q, qlast, zprefix, fforce)
|| qlast->uuconf_pzfail != q->uuconf_pzfail))
for (pz = q->uuconf_pzfail; *pz != NULL; pz++)
fprintf (e, "%schat-fail %s\n", zprefix, *pz);
-
+
if (qlast == NULL || qlast->uuconf_fstrip != q->uuconf_fstrip)
{
sprintf (ab, "%schat-strip", zprefix);
@@ -849,6 +849,20 @@ uvwrite_taylor_system (e, q)
}
}
+ if (CHANGED (uuconf_qcalledtimegrade)
+ && (q->uuconf_qcalledtimegrade
+ != (struct uuconf_timespan *) &_uuconf_unset))
+ {
+ for (qtime = q->uuconf_qcalledtimegrade;
+ qtime != NULL;
+ qtime = qtime->uuconf_qnext)
+ {
+ fprintf (e, "called-timegrade %c ", (char) qtime->uuconf_ival);
+ uvwrite_time (e, qtime);
+ fprintf (e, "\n");
+ }
+ }
+
if (CHANGED (uuconf_qcall_local_size))
uvwrite_size (e, q->uuconf_qcall_local_size, "call-local-size");
@@ -924,7 +938,7 @@ uvwrite_taylor_system (e, q)
if (CHANGED (uuconf_qproto_params))
uvwrite_proto_params (e, q->uuconf_qproto_params, "");
-
+
uvwrite_chat (e, &q->uuconf_scalled_chat,
(qlast == NULL
? (struct uuconf_chat *) NULL
@@ -1064,7 +1078,7 @@ uvwrite_v2_system (e, q)
&& q->uuconf_zphone != NULL)
{
char **pzc;
-
+
fprintf (e, " %s", q->uuconf_zphone);
pzc = q->uuconf_schat.uuconf_pzchat;
if (pzc != (char **) &_uuconf_unset
@@ -1142,7 +1156,7 @@ uvwrite_hdb_system (e, qsys)
&& q->uuconf_zphone != NULL)
{
char **pzc;
-
+
fprintf (e, " %s", q->uuconf_zphone);
pzc = q->uuconf_schat.uuconf_pzchat;
if (pzc != (char **) &_uuconf_unset
@@ -1312,7 +1326,7 @@ fvperm_array_cmp (pz1, pz2)
break;
return *pz1 == NULL && *pz2 == NULL;
-}
+}
/* Add a Permissions entry to a global list, combining entries where
possible. */
@@ -1502,7 +1516,7 @@ uvwrite_perm_array (e, pzarg, zcmd, pccol)
return;
c = strlen (zcmd) + 1;
-
+
for (pz = pzarg; *pz != NULL; pz++)
c += strlen (*pz) + 1;
@@ -1739,7 +1753,7 @@ uvwrite_taylor_port (e, qport, zprefix)
else
{
sprintf (ab, "%sdialer-sequence", zprefix);
- uvwrite_string_array (e, qm->uuconf_pzdialer, zprefix);
+ uvwrite_string_array (e, qm->uuconf_pzdialer, ab);
}
}
if (qm->uuconf_qdialer != NULL)
@@ -2001,7 +2015,7 @@ uvwrite_taylor_dialer (e, qdialer, zprefix)
qdialer->uuconf_sabort.uuconf_ctimeout = -1;
if (qdialer->uuconf_sabort.uuconf_fstrip)
qdialer->uuconf_sabort.uuconf_fstrip = -1;
-
+
uvwrite_chat (e, &qdialer->uuconf_schat, (struct uuconf_chat *) NULL,
zprefix, FALSE);
if (qdialer->uuconf_zdialtone != NULL
diff --git a/gnu/libexec/uucp/uucp/uucp.1 b/gnu/libexec/uucp/uucp/uucp.1
index c297f1f..25cc7cb 100644
--- a/gnu/libexec/uucp/uucp/uucp.1
+++ b/gnu/libexec/uucp/uucp/uucp.1
@@ -1,5 +1,5 @@
-''' $Id: uucp.1,v 1.2 1994/05/07 18:14:08 ache Exp $
-.TH uucp 1 "Taylor UUCP 1.05"
+''' $Id: uucp.1,v 1.11 1995/06/26 21:34:49 ian Rel $
+.TH uucp 1 "Taylor UUCP 1.06"
.SH NAME
uucp \- Unix to Unix copy
.SH SYNOPSIS
@@ -80,6 +80,10 @@ default.
If any necessary directories do not exist for the destination path,
abort the copy.
.TP 5
+.B \-R, \-\-recursive
+If any of the source file names are directories, copy their contents
+recursively to the destination (which must itself be a directory).
+.TP 5
.B \-g grade, \-\-grade grade
Set the grade of the file transfer command. Jobs of a higher grade
are executed first. Grades run 0 ... 9 A ... Z a ... z from high to
@@ -126,6 +130,26 @@ and one for the system
.B \-W, \-\-noexpand
Do not prepend remote relative path names with the current directory.
.TP 5
+.B \-t, \-\-uuto
+This option is used by the
+.I uuto
+shell script. It causes
+.I uucp
+to interpret the final argument as
+.I system!user.
+The file(s) are sent to
+.I ~/receive/USER/LOCAL
+on the remote system, where
+.I USER
+is from the final argument and
+.I LOCAL
+is the local UUCP
+system name. Also,
+.I uucp
+will act as though
+.I \-\-notify user
+were specified.
+.TP 5
.B \-x type, \-\-debug type
Turn on particular debugging types. The following types are
recognized: abnormal, chat, handshake, uucp-proto, proto, port,
diff --git a/gnu/libexec/uucp/uucp/uucp.c b/gnu/libexec/uucp/uucp/uucp.c
index 929f93a..91240f0 100644
--- a/gnu/libexec/uucp/uucp/uucp.c
+++ b/gnu/libexec/uucp/uucp/uucp.c
@@ -1,7 +1,7 @@
/* uucp.c
Prepare to copy a file to or from a remote system.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uucp_rcsid[] = "$Id: uucp.c,v 1.57 1994/01/30 20:59:40 ian Rel $";
+const char uucp_rcsid[] = "$Id: uucp.c,v 1.63 1995/08/02 01:22:53 ian Rel $";
#endif
#include <ctype.h>
@@ -256,7 +256,7 @@ main (argc, argv)
case 'v':
/* Print version and exit. */
- printf ("%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -630,7 +630,7 @@ ucusage ()
static void
uchelp ()
{
- printf ("Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
printf ("Usage: %s [options] file1 [file2 ...] dest\n", zProgram);
printf (" -c,--nocopy: Do not copy local files to spool directory\n");
@@ -741,7 +741,7 @@ uccopy (zfile, zdest)
efrom = esysdep_user_fopen (zfile, TRUE, TRUE);
if (! ffileisopen (efrom))
ucabort ();
- if (! fcopy_open_file (efrom, zto, FALSE, fCmkdirs))
+ if (! fcopy_open_file (efrom, zto, FALSE, fCmkdirs, TRUE))
ucabort ();
(void) ffileclose (efrom);
ubuffree (zto);
@@ -795,7 +795,7 @@ uccopy (zfile, zdest)
if (! ffileisopen (efrom))
ucabort ();
ucrecord_file (ztemp);
- if (! fcopy_open_file (efrom, ztemp, FALSE, TRUE))
+ if (! fcopy_open_file (efrom, ztemp, FALSE, TRUE, TRUE))
ucabort ();
(void) ffileclose (efrom);
}
@@ -864,6 +864,8 @@ uccopy (zfile, zdest)
ubuffree (zbase);
+ if (! fstdiosync (e, zxqt))
+ ulog (LOG_FATAL, "fsync failed");
if (fclose (e) != 0)
ulog (LOG_FATAL, "fclose: %s", strerror (errno));
@@ -1073,6 +1075,8 @@ uccopy (zfile, zdest)
fprintf (e, " %s\n", zcmd);
+ if (! fstdiosync (e, zxqt))
+ ulog (LOG_FATAL, "fsync failed");
if (fclose (e) != 0)
ulog (LOG_FATAL, "fclose: %s", strerror (errno));
diff --git a/gnu/libexec/uucp/uulog/uulog.c b/gnu/libexec/uucp/uulog/uulog.c
index fbf6bff..9d9cad5 100644
--- a/gnu/libexec/uucp/uulog/uulog.c
+++ b/gnu/libexec/uucp/uulog/uulog.c
@@ -1,7 +1,7 @@
/* uulog.c
Display the UUCP log file.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uulog_rcsid[] = "$Id: uulog.c,v 1.2 1994/05/07 18:14:12 ache Exp $";
+const char uulog_rcsid[] = "$Id: uulog.c,v 1.26 1995/06/29 19:37:19 ian Rel $";
#endif
#include <ctype.h>
@@ -186,7 +186,7 @@ main (argc, argv)
case 'v':
/* Print version and exit. */
- printf ("%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -350,7 +350,7 @@ main (argc, argv)
zluser = znext;
cluser = strcspn (znext, " \t");
#endif
-
+
/* Skip the first field. */
znext += strcspn (znext, " \t");
znext += strspn (znext, " \t");
@@ -386,7 +386,7 @@ main (argc, argv)
clsys = strcspn (znext, "!");
znext += clsys + 1;
zluser = znext;
- clsys = strcspn (znext, " \t");
+ cluser = strcspn (znext, " \t");
#endif
}
@@ -463,7 +463,7 @@ ulusage ()
static void
ulhelp ()
{
- printf ("Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
#if HAVE_HDB_LOGGING
printf ("Usage: %s [-n #] [-sf system] [-u user] [-xDS] [-I file] [-X debug]\n",
diff --git a/gnu/libexec/uucp/uuname/uuname.c b/gnu/libexec/uucp/uuname/uuname.c
index 7d0d9b1..22fc706 100644
--- a/gnu/libexec/uucp/uuname/uuname.c
+++ b/gnu/libexec/uucp/uuname/uuname.c
@@ -1,7 +1,7 @@
/* uuname.c
List the names of known remote UUCP sites.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uuname_rcsid[] = "$Id: uuname.c,v 1.17 1994/01/30 20:59:40 ian Rel $";
+const char uuname_rcsid[] = "$Id: uuname.c,v 1.21 1995/06/29 19:37:53 ian Rel $";
#endif
#include "getopt.h"
@@ -99,7 +99,7 @@ main (argc, argv)
case 'v':
/* Print version and exit. */
- printf ("%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -189,7 +189,7 @@ unusage ()
static void unhelp ()
{
- printf ("Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
printf ("Usage: %s [-a] [-l] [-I file]\n", zProgram);
printf (" -a,--aliases: display aliases\n");
diff --git a/gnu/libexec/uucp/uupick/uupick.c b/gnu/libexec/uucp/uupick/uupick.c
index cb27f7d..d88230f 100644
--- a/gnu/libexec/uucp/uupick/uupick.c
+++ b/gnu/libexec/uucp/uupick/uupick.c
@@ -1,7 +1,7 @@
/* uupick.c
Get files stored in the public directory by uucp -t.
- Copyright (C) 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uupick_rcsid[] = "$Id: uupick.c,v 1.10 1994/01/30 20:59:40 ian Rel $";
+const char uupick_rcsid[] = "$Id: uupick.c,v 1.16 1995/06/29 19:38:55 ian Rel $";
#endif
#include <errno.h>
@@ -71,7 +71,6 @@ main (argc, argv)
int iopt;
pointer puuconf;
int iuuconf;
- struct uuconf_system ssys;
const char *zpubdir;
char *zfile, *zfrom, *zfull;
char *zallsys;
@@ -107,7 +106,7 @@ main (argc, argv)
/* Print version and exit. */
fprintf
(stderr,
- "%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ "%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -140,14 +139,17 @@ main (argc, argv)
zpubdir = NULL;
if (zsystem != NULL)
{
+ struct uuconf_system ssys;
+
+ /* Get the public directory for the system. If we can't find
+ the system information, just use the standard public
+ directory, since uupick is not setuid. */
iuuconf = uuconf_system_info (puuconf, zsystem, &ssys);
if (iuuconf == UUCONF_SUCCESS)
{
zpubdir = zbufcpy (ssys.uuconf_zpubdir);
(void) uuconf_system_free (puuconf, &ssys);
}
- else if (iuuconf != UUCONF_NOT_FOUND)
- (void) ulog_uuconf (LOG_FATAL, puuconf, iuuconf);
}
if (zpubdir == NULL)
{
@@ -282,6 +284,7 @@ main (argc, argv)
printf ("m [dir]: move file to directory\n");
printf ("a [dir]: move all files from this system to directory\n");
printf ("p: list file to stdout\n");
+ printf ("d: delete file\n");
printf ("! command: shell escape\n");
fcontinue = TRUE;
break;
@@ -319,7 +322,7 @@ static void
uphelp ()
{
fprintf (stderr,
- "Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ "Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
fprintf (stderr,
" -s,--system system: Only consider files from named system\n");
diff --git a/gnu/libexec/uucp/uustat/uustat.1 b/gnu/libexec/uucp/uustat/uustat.1
index 7f9ecbc..e925799 100644
--- a/gnu/libexec/uucp/uustat/uustat.1
+++ b/gnu/libexec/uucp/uustat/uustat.1
@@ -1,5 +1,5 @@
-''' $Id: uustat.1,v 1.3 1994/12/11 21:35:17 ats Exp $
-.TH uustat 1 "Taylor UUCP 1.05"
+''' $Id: uustat.1,v 1.12 1995/06/26 20:34:30 ian Rel $
+.TH uustat 1 "Taylor UUCP 1.06"
.SH NAME
uustat \- UUCP status inquiry and control
.SH SYNOPSIS
@@ -341,7 +341,7 @@ or
.B \-\-mail
options.
.TP 5
-.B \-W, \-\-comment
+.B \-W comment, \-\-comment comment
Specify a comment to be included in mail sent with the
.B \-M,
.B \-\-mail,
@@ -350,6 +350,17 @@ or
.B \-\-notify
options.
.TP 5
+.B \-B lines, \-\-mail-lines lines
+When the
+.B \-M,
+.B \-\-mail,
+.B \-N,
+or
+.B \-\-notify
+options are used to send mail about an execution with standard input,
+this option controls the number of lines of standard input to include
+in the message. The default is 100.
+.TP 5
.B \-Q, \-\-no-list
Do not actually list the job, but only take any actions indicated by
the
@@ -534,7 +545,7 @@ configuration file, so these are only approximations.
/var/spool/uucp -
UUCP spool directory.
.SH SEE ALSO
-ps(1), rmail(8), uucp(1), uux(1), uucico(8), uuxqt(8)
+ps(1), rmail(1), uucp(1), uux(1), uucico(8), uuxqt(8)
.SH AUTHOR
Ian Lance Taylor
(ian@airs.com)
diff --git a/gnu/libexec/uucp/uustat/uustat.c b/gnu/libexec/uucp/uustat/uustat.c
index edeccfa..8918cae 100644
--- a/gnu/libexec/uucp/uustat/uustat.c
+++ b/gnu/libexec/uucp/uustat/uustat.c
@@ -1,7 +1,7 @@
/* uustat.c
UUCP status program
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uustat_rcsid[] = "$Id: uustat.c,v 1.2 1994/05/07 18:14:24 ache Exp $";
+const char uustat_rcsid[] = "$Id: uustat.c,v 1.55 1995/08/02 00:14:15 ian Rel $";
#endif
#include <ctype.h>
@@ -97,7 +97,7 @@ struct scmdlist
static void ususage P((void));
static void ushelp P((void));
-static boolean fsxqt_file_read P((pointer puuconf, const char *zfile));
+static boolean fsxqt_file_read P((pointer puuconf, FILE *));
static void usxqt_file_free P((void));
static int isxqt_cmd P((pointer puuconf, int argc, char **argv, pointer pvar,
pointer pinfo));
@@ -387,7 +387,7 @@ main (argc, argv)
case 'v':
/* Print version and exit. */
- printf ("%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -597,7 +597,7 @@ ususage ()
static void
ushelp ()
{
- printf ("Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
printf ("Usage: %s [options]\n", zProgram);
printf (" -a,--all: list all UUCP jobs\n");
@@ -671,21 +671,13 @@ static const struct uuconf_cmdtab asSxqt_cmds[] =
/* Read an execution file, setting the above variables. */
static boolean
-fsxqt_file_read (puuconf, zfile)
+fsxqt_file_read (puuconf, e)
pointer puuconf;
- const char *zfile;
+ FILE *e;
{
- FILE *e;
int iuuconf;
boolean fret;
- e = fopen (zfile, "r");
- if (e == NULL)
- {
- ulog (LOG_ERROR, "fopen (%s): %s", zfile, strerror (errno));
- return FALSE;
- }
-
zSxqt_user = NULL;
zSxqt_system = NULL;
zSxqt_stdin = NULL;
@@ -698,7 +690,6 @@ fsxqt_file_read (puuconf, zfile)
iuuconf = uuconf_cmd_file (puuconf, e, asSxqt_cmds, (pointer) NULL,
(uuconf_cmdtabfn) NULL,
UUCONF_CMDTABFLAG_CASE, (pointer) NULL);
- (void) fclose (e);
if (iuuconf == UUCONF_SUCCESS)
fret = TRUE;
else
@@ -885,7 +876,7 @@ fsworkfiles (puuconf, icmd, csystems, pazsystems, fnotsystems, cusers,
ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
return FALSE;
}
-
+
for (pz = pznames; *pz != NULL; pz++)
{
if (csystems > 0)
@@ -1063,6 +1054,7 @@ fsworkfile_show (puuconf, icmd, qsys, qcmd, itime, ccommands, pazcommands,
const char *zprog, *zcmd, *zrequestor, *zstdin;
char *zfree;
struct scmdlist *qxqt;
+ FILE *exqt = NULL;
struct scmdlist *qfree;
fmatch = FALSE;
@@ -1070,12 +1062,33 @@ fsworkfile_show (puuconf, icmd, qsys, qcmd, itime, ccommands, pazcommands,
zfree = NULL;
for (qxqt = qlist; qxqt != NULL; qxqt = qxqt->qnext)
- if (qxqt->s.bcmd == 'E'
- || (qxqt->s.bcmd == 'S'
- && qxqt->s.zto[0] == 'X'
- && qxqt->s.zto[1] == '.'
- && fspool_file (qxqt->s.zfrom)))
- break;
+ {
+ if (qxqt->s.bcmd == 'E')
+ break;
+ if (qxqt->s.bcmd == 'S'
+ && qxqt->s.zto[0] == 'X'
+ && qxqt->s.zto[1] == '.'
+ && fspool_file (qxqt->s.zfrom))
+ {
+ char *zxqt;
+
+ /* Open the file now, so that, if it does not exist, we
+ can still report sensibly (the qxqt == NULL case) on
+ any other files that may exist. */
+
+ zxqt = zsysdep_spool_file_name (qsys, qxqt->s.zfrom,
+ qxqt->s.pseq);
+ if (zxqt == NULL)
+ return FALSE;
+
+ exqt = fopen (zxqt, "r");
+
+ ubuffree (zxqt);
+
+ if (exqt != NULL)
+ break;
+ }
+ }
if (qxqt == NULL)
{
@@ -1157,20 +1170,13 @@ fsworkfile_show (puuconf, icmd, qsys, qcmd, itime, ccommands, pazcommands,
}
else
{
- char *zxqt;
-
- zxqt = zsysdep_spool_file_name (qsys, qxqt->s.zfrom,
- qxqt->s.pseq);
- if (zxqt == NULL)
- return FALSE;
-
- if (! fsxqt_file_read (puuconf, zxqt))
+ if (! fsxqt_file_read (puuconf, exqt))
{
- ubuffree (zxqt);
+ (void) fclose (exqt);
return FALSE;
}
- ubuffree (zxqt);
+ (void) fclose (exqt);
zprog = zSxqt_prog;
zcmd = zSxqt_cmd;
@@ -1269,9 +1275,10 @@ fsworkfile_show (puuconf, icmd, qsys, qcmd, itime, ccommands, pazcommands,
int b;
/* Ask stdin whether this job should be killed. */
- fprintf (stderr, "%s: %s %s?",
+ fprintf (stderr, "%s: %s %s? ",
+ zProgram,
(icmd & JOB_REJUVENATE) != 0 ? "Rejuvenate" : "Kill",
- zProgram, zlistid);
+ zlistid);
(void) fflush (stderr);
b = getchar ();
fkill_or_rejuv = b == 'y' || b == 'Y';
@@ -1281,7 +1288,7 @@ fsworkfile_show (puuconf, icmd, qsys, qcmd, itime, ccommands, pazcommands,
else if ((icmd & JOB_KILL) != 0
|| (icmd & JOB_REJUVENATE) != 0)
fkill_or_rejuv = TRUE;
-
+
if (fkill_or_rejuv
&& (qlist->s.zuser == NULL
|| strcmp (zsysdep_login_name (), qlist->s.zuser) != 0)
@@ -1422,14 +1429,16 @@ fsexecutions (puuconf, icmd, csystems, pazsystems, fnotsystems, cusers,
return FALSE;
}
- if (! fsysdep_get_xqt_init ())
+ if (! fsysdep_get_xqt_init ((const char *) NULL))
return FALSE;
- while ((zfile = zsysdep_get_xqt (&zsystem, &ferr)) != NULL)
+ while ((zfile = zsysdep_get_xqt ((const char *) NULL, &zsystem, &ferr))
+ != NULL)
{
boolean fmatch;
int i;
long itime;
+ FILE *e;
if (csystems > 0)
{
@@ -1462,12 +1471,20 @@ fsexecutions (puuconf, icmd, csystems, pazsystems, fnotsystems, cusers,
/* We need to read the execution file before we can check the
user name. */
- if (! fsxqt_file_read (puuconf, zfile))
+ e = fopen (zfile, "r");
+ if (e == NULL)
+ {
+ /* Probably uucico just deleted the file. */
+ continue;
+ }
+ if (! fsxqt_file_read (puuconf, e))
{
+ (void) fclose (e);
ubuffree (zfile);
ubuffree (zsystem);
- continue;
+ continue;
}
+ (void) fclose (e);
if (cusers == 0)
fmatch = TRUE;
@@ -1531,9 +1548,10 @@ fsexecutions (puuconf, icmd, csystems, pazsystems, fnotsystems, cusers,
int b;
/* Ask stdin whether this job should be killed. */
- fprintf (stderr, "%s: %s %s?",
+ fprintf (stderr, "%s: %s %s? ",
+ zProgram,
(icmd & JOB_REJUVENATE) != 0 ? "Rejuvenate" : "Kill",
- zProgram, zSxqt_cmd);
+ zSxqt_cmd);
(void) fflush (stderr);
b = getchar ();
fkill_or_rejuv = b == 'y' || b == 'Y';
@@ -1573,6 +1591,7 @@ fsexecutions (puuconf, icmd, csystems, pazsystems, fnotsystems, cusers,
ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
fbad = TRUE;
}
+ ssys.uuconf_zname = (char *) zlocalname;
}
else if (! funknown_system (puuconf, zsystem, &ssys))
{
@@ -1635,7 +1654,7 @@ fsexecutions (puuconf, icmd, csystems, pazsystems, fnotsystems, cusers,
ubuffree (zsystem);
}
- usysdep_get_xqt_free ();
+ usysdep_get_xqt_free ((const char *) NULL);
return ferr;
}
@@ -1815,7 +1834,25 @@ fsnotify (puuconf, icmd, zcomment, cstdin, fkilled, zcmd, qcmd, zid, itime,
(cgot
* sizeof (char *)));
}
- pz[i++] = zbufcpy (zline);
+ if (strncmp (zline, "From ", sizeof "From " - 1) != 0)
+ pz[i++] = zbufcpy (zline);
+ else
+ {
+ char *zalc;
+
+ /* Escape "From " at the start of a line. This
+ should really be the responsibility of the
+ mail transfer agent. On some systems,
+ though, the mail transfer agent does not do
+ it, but user mail programs expect it. We
+ help them out here, since it doesn't matter
+ much--we're already truncating the message
+ anyhow. */
+ zalc = zbufalc (strlen (zline) + 2);
+ zalc[0] = '>';
+ strcpy (zalc + 1, zline);
+ pz[i++] = zalc;
+ }
}
xfree ((pointer) zline);
(void) fclose (e);
@@ -1961,11 +1998,12 @@ fsquery (puuconf, csystems, pazsystems, fnotsystems, iold, iyoung)
}
/* Get a count of all the execution files. */
- if (! fsysdep_get_xqt_init ())
+ if (! fsysdep_get_xqt_init ((const char *) NULL))
return FALSE;
qlist = NULL;
- while ((zfile = zsysdep_get_xqt (&zsystem, &ferr)) != NULL)
+ while ((zfile = zsysdep_get_xqt ((const char *) NULL, &zsystem, &ferr))
+ != NULL)
{
struct sxqtlist *qlook;
@@ -1998,7 +2036,7 @@ fsquery (puuconf, csystems, pazsystems, fnotsystems, iold, iyoung)
ubuffree (zfile);
}
- usysdep_get_xqt_free ();
+ usysdep_get_xqt_free ((const char *) NULL);
if (ferr)
return FALSE;
@@ -2281,15 +2319,23 @@ fsquery_show (qsys, cwork, ifirstwork, qxqt, inow, zlocalname,
if (flocal || fnostatus)
{
printf ("\n");
+ if (! flocal)
+ ubuffree (sstat.zstring);
return TRUE;
}
usysdep_localtime (sstat.ilast, &stime);
- printf (" %02d-%02d %02d:%02d ",
+ printf (" %02d-%02d %02d:%02d ",
stime.tm_mon + 1,stime.tm_mday, stime.tm_hour, stime.tm_min);
- printf ("%s\n", azStatus[(int) sstat.ttype]);
+ if (sstat.zstring == NULL)
+ printf ("%s\n", azStatus[(int) sstat.ttype]);
+ else
+ {
+ printf ("%s\n", sstat.zstring);
+ ubuffree (sstat.zstring);
+ }
return TRUE;
}
@@ -2361,9 +2407,16 @@ fsmachines ()
struct tm stime;
usysdep_localtime (sstat.ilast, &stime);
- printf ("%-14s %02d-%02d %02d:%02d %s", zsystem,
+ printf ("%-14s %02d-%02d %02d:%02d ", zsystem,
stime.tm_mon + 1, stime.tm_mday, stime.tm_hour,
- stime.tm_min, azStatus[(int) sstat.ttype]);
+ stime.tm_min);
+ if (sstat.zstring == NULL)
+ printf ("%s", azStatus[(int) sstat.ttype]);
+ else
+ {
+ printf ("%s", sstat.zstring);
+ ubuffree (sstat.zstring);
+ }
ubuffree (zsystem);
if (sstat.ttype != STATUS_TALKING
&& sstat.cwait > 0)
diff --git a/gnu/libexec/uucp/uux/uux.1 b/gnu/libexec/uucp/uux/uux.1
index b73ef98..034d480 100644
--- a/gnu/libexec/uucp/uux/uux.1
+++ b/gnu/libexec/uucp/uux/uux.1
@@ -1,5 +1,5 @@
-''' $Id: uux.1,v 1.2 1994/05/07 18:14:33 ache Exp $
-.TH uux 1 "Taylor UUCP 1.05"
+''' $Id: uux.1,v 1.12 1995/06/27 02:21:14 ian Rel $
+.TH uux 1 "Taylor UUCP 1.06"
.SH NAME
uux \- Remote command execution over UUCP
.SH SYNOPSIS
@@ -69,6 +69,10 @@ Arguments may be quoted by parentheses to avoid interpretation of
exclamation points. This is useful when executing the
.I uucp
command on a remote system.
+
+A request to execute an empty command (e.g.,
+.I uux sys!)
+will create a poll file for the specified system.
.SH OPTIONS
The following options may be given to
.I uux.
diff --git a/gnu/libexec/uucp/uux/uux.c b/gnu/libexec/uucp/uux/uux.c
index c5e7c20..4990585 100644
--- a/gnu/libexec/uucp/uux/uux.c
+++ b/gnu/libexec/uucp/uux/uux.c
@@ -1,7 +1,7 @@
/* uux.c
Prepare to execute a command on a remote system.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uux_rcsid[] = "$Id: uux.c,v 1.5 1994/10/02 23:09:41 ache Exp $";
+const char uux_rcsid[] = "$Id: uux.c,v 1.81 1995/08/02 01:25:17 ian Rel $";
#endif
#include "uudefs.h"
@@ -54,8 +54,24 @@ const char uux_rcsid[] = "$Id: uux.c,v 1.5 1994/10/02 23:09:41 ache Exp $";
operators. */
#define ZSHELLNONREDIRSEPS ";&*| \t"
-/* The name of the execute file. */
-const char *zXxqt_name;
+/* Whether this execution is occurring on the local system. */
+static boolean fXxqtlocal;
+
+/* The execution system. */
+static struct uuconf_system sXxqtsys;
+
+/* The name of local system from the point of view of the execution
+ system. */
+static const char *zXxqtloc;
+
+/* The job grade to use. */
+static char bXgrade = BDEFAULT_UUX_GRADE;
+
+/* The temporary file name of the execute file. */
+static char abXxqt_tname[CFILE_NAME_LEN];
+
+/* The name of the execute file on the remote system. */
+static char abXxqt_xname[CFILE_NAME_LEN];
/* The execute file we are creating. */
static FILE *eXxqt_file;
@@ -77,10 +93,7 @@ static void uxhelp P((void));
static void uxadd_xqt_line P((int bchar, const char *z1, const char *z2));
static void uxadd_send_file P((const char *zfrom, const char *zto,
const char *zoptions, const char *ztemp,
- const char *zforward,
- const struct uuconf_system *qxqtsys,
- const char *zxqtloc,
- int bgrade));
+ const char *zforward));
static void uxcopy_stdin P((FILE *e));
static void uxrecord_file P((const char *zfile));
static void uxabort P((void));
@@ -128,8 +141,6 @@ main (argc, argv)
const char *zconfig = NULL;
/* -j: output job id. */
boolean fjobid = FALSE;
- /* -g: job grade. */
- char bgrade = BDEFAULT_UUX_GRADE;
/* -l: link file to spool directory. */
boolean flink = FALSE;
/* -n: do not notify upon command completion. */
@@ -148,7 +159,6 @@ main (argc, argv)
pointer puuconf;
int iuuconf;
const char *zlocalname;
- const char *zxqtloc;
int i;
size_t clen;
char *zargs;
@@ -158,14 +168,10 @@ main (argc, argv)
char *zexclam;
boolean fgetcwd;
const char *zuser;
- struct uuconf_system sxqtsys;
- boolean fxqtlocal;
char *zforward;
char **pzargs;
int calloc_args;
int cargs;
- char abxqt_tname[CFILE_NAME_LEN];
- char abxqt_xname[CFILE_NAME_LEN];
const char *zinput_from;
const char *zinput_to;
const char *zinput_temp;
@@ -175,6 +181,7 @@ main (argc, argv)
struct uuconf_system slocalsys;
boolean fneedshell;
char *zfullcmd;
+ boolean fpoll;
char aboptions[10];
boolean fexit;
@@ -186,7 +193,7 @@ main (argc, argv)
opterr = 0;
while (1)
{
- while (getopt_long (argc, argv, "+a::bcCg:I:jlnprs:Wvx:z",
+ while (getopt_long (argc, argv, "+a:bcCg:I:jlnprs:Wvx:z",
asXlongopts, (int *) NULL) != EOF)
;
if (optind >= argc || strcmp (argv[optind], "-") != 0)
@@ -227,7 +234,7 @@ main (argc, argv)
break;
case 'I':
- /* Configuration file name. */
+ /* Configuration file name. */
if (fsysdep_other_config (optarg))
zconfig = optarg;
break;
@@ -239,7 +246,7 @@ main (argc, argv)
case 'g':
/* Set job grade. */
- bgrade = optarg[0];
+ bXgrade = optarg[0];
break;
case 'l':
@@ -308,7 +315,7 @@ main (argc, argv)
case 'v':
/* Print version and exit. */
- printf ("%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -329,10 +336,10 @@ main (argc, argv)
}
}
- if (! UUCONF_GRADE_LEGAL (bgrade))
+ if (! UUCONF_GRADE_LEGAL (bXgrade))
{
ulog (LOG_ERROR, "Ignoring illegal grade");
- bgrade = BDEFAULT_UUX_GRADE;
+ bXgrade = BDEFAULT_UUX_GRADE;
}
if (optind == argc)
@@ -399,7 +406,10 @@ main (argc, argv)
calloc_args * sizeof (char *));
}
- clen = strcspn (zarg, ZSHELLSEPS);
+ if (*zarg == '(')
+ clen = strlen (zarg);
+ else
+ clen = strcspn (zarg, ZSHELLSEPS);
if (clen > 0)
{
pzargs[cargs] = zbufalc (clen + 1);
@@ -501,7 +511,7 @@ main (argc, argv)
if (zexclam == NULL)
{
zsys = zlocalname;
- fxqtlocal = TRUE;
+ fXxqtlocal = TRUE;
zforward = NULL;
}
else
@@ -509,7 +519,7 @@ main (argc, argv)
*zexclam = '\0';
zsys = zcmd;
zcmd = zexclam + 1;
- fxqtlocal = FALSE;
+ fXxqtlocal = FALSE;
/* See if we must forward this command through other systems
(e.g. uux a!b!cmd). */
@@ -526,40 +536,24 @@ main (argc, argv)
}
}
- if (fxqtlocal)
- sxqtsys = slocalsys;
+ if (fXxqtlocal)
+ sXxqtsys = slocalsys;
else
{
- iuuconf = uuconf_system_info (puuconf, zsys, &sxqtsys);
+ iuuconf = uuconf_system_info (puuconf, zsys, &sXxqtsys);
if (iuuconf != UUCONF_SUCCESS)
{
if (iuuconf != UUCONF_NOT_FOUND)
ulog_uuconf (LOG_FATAL, puuconf, iuuconf);
- if (! funknown_system (puuconf, zsys, &sxqtsys))
+ if (! funknown_system (puuconf, zsys, &sXxqtsys))
ulog (LOG_FATAL, "%s: System not found", zsys);
}
}
/* Get the local name the remote system know us as. */
- zxqtloc = sxqtsys.uuconf_zlocalname;
- if (zxqtloc == NULL)
- zxqtloc = zlocalname;
-
- /* We can send this as an E command if the execution is on a
- different, directly connected, system and the only file used is
- the standard input and comes from this system. This is true of
- the common cases of rmail and rnews. We get an execute file name
- here in case we need it. */
- if (fxqtlocal)
- zXxqt_name = zsysdep_xqt_file_name ();
- else
- zXxqt_name = zsysdep_data_file_name (&sxqtsys, zxqtloc, bgrade, TRUE,
- abxqt_tname, (char *) NULL,
- abxqt_xname);
- if (zXxqt_name == NULL)
- uxabort ();
-
- uxrecord_file (zXxqt_name);
+ zXxqtloc = sXxqtsys.uuconf_zlocalname;
+ if (zXxqtloc == NULL)
+ zXxqtloc = zlocalname;
/* Look through the arguments. Any argument containing an
exclamation point character is interpreted as a file name, and is
@@ -649,8 +643,8 @@ main (argc, argv)
/* Check if the file is already on the execution system. */
if (flocal)
- fonxqt = fxqtlocal;
- else if (fxqtlocal)
+ fonxqt = fXxqtlocal;
+ else if (fXxqtlocal)
fonxqt = FALSE;
else if (zforward == NULL ? zforw != NULL : zforw == NULL)
fonxqt = FALSE;
@@ -658,16 +652,16 @@ main (argc, argv)
&& zforw != NULL
&& strcmp (zforward, zforw) != 0)
fonxqt = FALSE;
- else if (strcmp (zsystem, sxqtsys.uuconf_zname) == 0)
+ else if (strcmp (zsystem, sXxqtsys.uuconf_zname) == 0)
fonxqt = TRUE;
- else if (sxqtsys.uuconf_pzalias == NULL)
+ else if (sXxqtsys.uuconf_pzalias == NULL)
fonxqt = FALSE;
else
{
char **pzal;
fonxqt = FALSE;
- for (pzal = sxqtsys.uuconf_pzalias; *pzal != NULL; pzal++)
+ for (pzal = sXxqtsys.uuconf_pzalias; *pzal != NULL; pzal++)
{
if (strcmp (zsystem, *pzal) == 0)
{
@@ -679,7 +673,7 @@ main (argc, argv)
/* Turn the file into an absolute path. */
if (flocal)
- zfile = zsysdep_local_file_cwd (zfile, sxqtsys.uuconf_zpubdir,
+ zfile = zsysdep_local_file_cwd (zfile, sXxqtsys.uuconf_zpubdir,
(boolean *) NULL);
else if (fexpand)
zfile = zsysdep_add_cwd (zfile);
@@ -692,8 +686,8 @@ main (argc, argv)
if (flocal)
{
if (! fin_directory_list (zfile,
- sxqtsys.uuconf_pzremote_receive,
- sxqtsys.uuconf_zpubdir, TRUE,
+ sXxqtsys.uuconf_pzremote_receive,
+ sXxqtsys.uuconf_zpubdir, TRUE,
FALSE, (const char *) NULL))
ulog (LOG_FATAL, "Not permitted to create %s", zfile);
}
@@ -747,7 +741,7 @@ main (argc, argv)
if (fonxqt)
uxadd_xqt_line ('O', zfile, (const char *) NULL);
else if (flocal)
- uxadd_xqt_line ('O', zfile, zxqtloc);
+ uxadd_xqt_line ('O', zfile, zXxqtloc);
else
uxadd_xqt_line ('O', zfile, zsystem);
pzargs[i] = NULL;
@@ -781,12 +775,12 @@ main (argc, argv)
if (! fsysdep_access (zfile))
uxabort ();
- zdata = zsysdep_data_file_name (&sxqtsys, zxqtloc, bgrade, FALSE,
+ zdata = zsysdep_data_file_name (&sXxqtsys, zXxqtloc, bXgrade, FALSE,
abtname, abdname, (char *) NULL);
if (zdata == NULL)
uxabort ();
- if (fcopy || flink || fxqtlocal)
+ if (fcopy || flink || fXxqtlocal)
{
boolean fdid;
@@ -814,7 +808,7 @@ main (argc, argv)
efile = esysdep_user_fopen (zfile, TRUE, TRUE);
if (! ffileisopen (efile))
uxabort ();
- if (! fcopy_open_file (efile, zdata, FALSE, TRUE))
+ if (! fcopy_open_file (efile, zdata, FALSE, TRUE, TRUE))
uxabort ();
(void) ffileclose (efile);
}
@@ -829,8 +823,8 @@ main (argc, argv)
/* Make sure the daemon can access the file. */
if (! fsysdep_daemon_access (zfile))
uxabort ();
- if (! fin_directory_list (zfile, sxqtsys.uuconf_pzlocal_send,
- sxqtsys.uuconf_zpubdir, TRUE,
+ if (! fin_directory_list (zfile, sXxqtsys.uuconf_pzlocal_send,
+ sXxqtsys.uuconf_zpubdir, TRUE,
TRUE, zuser))
ulog (LOG_FATAL, "Not permitted to send from %s",
zfile);
@@ -838,7 +832,7 @@ main (argc, argv)
zuse = zfile;
}
- if (fxqtlocal)
+ if (fXxqtlocal)
{
if (finput)
uxadd_xqt_line ('I', zuse, (char *) NULL);
@@ -861,8 +855,7 @@ main (argc, argv)
uxadd_send_file (zuse, abdname,
finputcopied ? "C" : "c",
- abtname, zforward, &sxqtsys,
- zxqtloc, bgrade);
+ abtname, zforward);
zbase = zsysdep_base_name (zfile);
if (zbase == NULL)
uxabort ();
@@ -933,7 +926,7 @@ main (argc, argv)
/* We must request the file from the remote system to
this one. */
- zdata = zsysdep_data_file_name (&slocalsys, zxqtloc, bgrade,
+ zdata = zsysdep_data_file_name (&slocalsys, zXxqtloc, bXgrade,
FALSE, abtname, (char *) NULL,
(char *) NULL);
if (zdata == NULL)
@@ -945,7 +938,7 @@ main (argc, argv)
spool directory; normally such requests are rejected.
This privilege is easy to abuse. */
s.bcmd = 'R';
- s.bgrade = bgrade;
+ s.bgrade = bXgrade;
s.pseq = NULL;
s.zfrom = zfile;
s.zto = zbufcpy (abtname);
@@ -958,7 +951,7 @@ main (argc, argv)
s.zcmd = NULL;
s.ipos = 0;
- zjobid = zsysdep_spool_commands (&sfromsys, bgrade, 1, &s);
+ zjobid = zsysdep_spool_commands (&sfromsys, bXgrade, 1, &s);
if (zjobid == NULL)
uxabort ();
@@ -978,7 +971,7 @@ main (argc, argv)
zcall_system = zbufcpy (sfromsys.uuconf_zname);
}
- if (fxqtlocal)
+ if (fXxqtlocal)
{
/* Tell the command execution to wait until the file
has been received, and tell it the real file
@@ -1009,8 +1002,8 @@ main (argc, argv)
/* Now we must arrange to forward the file on to the
execution system. We need to get a name to give
the file on the execution system (abxtname). */
- zdata = zsysdep_data_file_name (&sxqtsys, zxqtloc,
- bgrade, TRUE, abxtname,
+ zdata = zsysdep_data_file_name (&sXxqtsys, zXxqtloc,
+ bXgrade, TRUE, abxtname,
(char *) NULL,
(char *) NULL);
if (zdata == NULL)
@@ -1032,12 +1025,14 @@ main (argc, argv)
fprintf (e, "U %s %s\n", zsysdep_login_name (),
zlocalname);
fprintf (e, "F %s %s\n", abtname, zbase);
- fprintf (e, "C uucp -C -W -d -g %c %s %s!", bgrade,
- zbase, sxqtsys.uuconf_zname);
+ fprintf (e, "C uucp -C -W -d -g %c %s %s!", bXgrade,
+ zbase, sXxqtsys.uuconf_zname);
if (zforward != NULL)
fprintf (e, "%s!", zforward);
fprintf (e, "%s\n", abxtname);
+ if (! fstdiosync (e, zxqt))
+ ulog (LOG_FATAL, "fsync failed");
if (fclose (e) != 0)
ulog (LOG_FATAL, "fclose: %s", strerror (errno));
@@ -1068,7 +1063,7 @@ main (argc, argv)
char abdname[CFILE_NAME_LEN];
FILE *e;
- zdata = zsysdep_data_file_name (&sxqtsys, zxqtloc, bgrade, FALSE,
+ zdata = zsysdep_data_file_name (&sXxqtsys, zXxqtloc, bXgrade, FALSE,
abtname, abdname, (char *) NULL);
if (zdata == NULL)
uxabort ();
@@ -1082,11 +1077,13 @@ main (argc, argv)
uxcopy_stdin (e);
+ if (! fstdiosync (e, zdata))
+ ulog (LOG_FATAL, "fsync failed");
eXclose = NULL;
if (fclose (e) != 0)
ulog (LOG_FATAL, "fclose: %s", strerror (errno));
- if (fxqtlocal)
+ if (fXxqtlocal)
uxadd_xqt_line ('I', abtname, (const char *) NULL);
else
{
@@ -1135,6 +1132,8 @@ main (argc, argv)
}
}
+ fpoll = FALSE;
+
/* If we haven't written anything to the execution file yet, and we
have a standard input file, and we're not forwarding, then every
other option can be handled in an E command. */
@@ -1145,7 +1144,7 @@ main (argc, argv)
/* Set up an E command. */
s.bcmd = 'E';
- s.bgrade = bgrade;
+ s.bgrade = bXgrade;
s.pseq = NULL;
s.zuser = zuser;
s.zfrom = zinput_from;
@@ -1170,7 +1169,7 @@ main (argc, argv)
s.cbytes = -1;
s.zcmd = zfullcmd;
s.ipos = 0;
-
+
++cXcmds;
pasXcmds = (struct scmd *) xrealloc ((pointer) pasXcmds,
cXcmds * sizeof (struct scmd));
@@ -1178,18 +1177,26 @@ main (argc, argv)
uxadd_name (zinput_from);
}
+ else if (*zfullcmd == '\0'
+ && eXxqt_file == NULL
+ && zinput_from == NULL
+ && cXcmds == 0)
+ {
+ /* As a special case, if we are asked to execute an empty
+ command, we create a poll file instead. */
+ fpoll = TRUE;
+ }
else
{
/* Finish up the execute file. */
- uxadd_xqt_line ('U', zuser, zxqtloc);
+ uxadd_xqt_line ('U', zuser, zXxqtloc);
if (zinput_from != NULL)
{
uxadd_xqt_line ('F', zinput_to, (char *) NULL);
uxadd_xqt_line ('I', zinput_to, (char *) NULL);
uxadd_send_file (zinput_from, zinput_to,
finputcopied ? "C" : "c",
- zinput_temp, zforward, &sxqtsys, zxqtloc,
- bgrade);
+ zinput_temp, zforward);
}
if (fno_ack)
uxadd_xqt_line ('N', (const char *) NULL, (const char *) NULL);
@@ -1200,15 +1207,17 @@ main (argc, argv)
if (fneedshell)
uxadd_xqt_line ('e', (const char *) NULL, (const char *) NULL);
uxadd_xqt_line ('C', zfullcmd, (const char *) NULL);
+ if (! fstdiosync (eXxqt_file, "execution file"))
+ ulog (LOG_FATAL, "fsync failed");
if (fclose (eXxqt_file) != 0)
ulog (LOG_FATAL, "fclose: %s", strerror (errno));
eXxqt_file = NULL;
/* If the execution is to occur on another system, we must now
arrange to copy the execute file to this system. */
- if (! fxqtlocal)
- uxadd_send_file (abxqt_tname, abxqt_xname, "C", abxqt_tname,
- zforward, &sxqtsys, zxqtloc, bgrade);
+ if (! fXxqtlocal)
+ uxadd_send_file (abXxqt_tname, abXxqt_xname, "C", abXxqt_tname,
+ zforward);
}
/* If we got a signal, get out before spooling anything. */
@@ -1216,16 +1225,17 @@ main (argc, argv)
uxabort ();
/* From here on in, it's too late. We don't call uxabort. */
- if (cXcmds > 0)
+ if (cXcmds > 0 || fpoll)
{
char *zjobid;
- if (! sxqtsys.uuconf_fcall_transfer
- && ! sxqtsys.uuconf_fcalled_transfer)
+ if (! fpoll
+ && ! sXxqtsys.uuconf_fcall_transfer
+ && ! sXxqtsys.uuconf_fcalled_transfer)
ulog (LOG_FATAL, "Not permitted to transfer files to or from %s",
- sxqtsys.uuconf_zname);
+ sXxqtsys.uuconf_zname);
- zjobid = zsysdep_spool_commands (&sxqtsys, bgrade, cXcmds, pasXcmds);
+ zjobid = zsysdep_spool_commands (&sXxqtsys, bXgrade, cXcmds, pasXcmds);
if (zjobid == NULL)
{
ulog_close ();
@@ -1245,26 +1255,47 @@ main (argc, argv)
else
{
fcall_any = TRUE;
- zcall_system = zbufcpy (sxqtsys.uuconf_zname);
+ zcall_system = zbufcpy (sXxqtsys.uuconf_zname);
}
}
- /* If all that worked, make a log file entry. All log file reports
- up to this point went to stderr. */
- ulog_to_file (puuconf, TRUE);
- ulog_system (sxqtsys.uuconf_zname);
- ulog_user (zuser);
-
- if (zXnames == NULL)
- ulog (LOG_NORMAL, "Queuing %s", zfullcmd);
- else
- ulog (LOG_NORMAL, "Queuing %s (%s)", zfullcmd, zXnames);
+ if (! fpoll)
+ {
+ /* If all that worked, make a log file entry. All log file
+ reports up to this point went to stderr. */
+ ulog_to_file (puuconf, TRUE);
+ ulog_system (sXxqtsys.uuconf_zname);
+ ulog_user (zuser);
+
+ if (zXnames == NULL)
+ ulog (LOG_NORMAL, "Queuing %s", zfullcmd);
+ else
+ ulog (LOG_NORMAL, "Queuing %s (%s)", zfullcmd, zXnames);
- ulog_close ();
+ ulog_close ();
+ }
if (! fuucico
|| (zcall_system == NULL && ! fcall_any))
- fexit = TRUE;
+ {
+ if (! fXxqtlocal || ! fuucico)
+ fexit = TRUE;
+ else
+ {
+ char *zconfigarg;
+
+ if (zconfig == NULL)
+ zconfigarg = NULL;
+ else
+ {
+ zconfigarg = zbufalc (sizeof "-I" + strlen (zconfig));
+ sprintf (zconfigarg, "-I%s", zconfig);
+ }
+
+ fexit = fsysdep_run (FALSE, "uuxqt", zconfigarg,
+ (const char *) NULL);
+ }
+ }
else
{
const char *zcicoarg;
@@ -1303,7 +1334,7 @@ main (argc, argv)
static void
uxhelp ()
{
- printf ("Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
printf ("Usage: %s [options] [-] command\n", zProgram);
printf (" -,-p,--stdin: Read standard input for standard input of command\n");
@@ -1345,7 +1376,20 @@ uxadd_xqt_line (bchar, z1, z2)
{
if (eXxqt_file == NULL)
{
- eXxqt_file = esysdep_fopen (zXxqt_name, FALSE, FALSE, TRUE);
+ const char *zxqt_name;
+
+ if (fXxqtlocal)
+ zxqt_name = zsysdep_xqt_file_name ();
+ else
+ zxqt_name = zsysdep_data_file_name (&sXxqtsys, zXxqtloc, bXgrade, TRUE,
+ abXxqt_tname, (char *) NULL,
+ abXxqt_xname);
+ if (zxqt_name == NULL)
+ uxabort ();
+
+ uxrecord_file (zxqt_name);
+
+ eXxqt_file = esysdep_fopen (zxqt_name, FALSE, FALSE, TRUE);
if (eXxqt_file == NULL)
uxabort ();
}
@@ -1361,16 +1405,12 @@ uxadd_xqt_line (bchar, z1, z2)
/* Add a file to be sent to the execute system. */
static void
-uxadd_send_file (zfrom, zto, zoptions, ztemp, zforward, qxqtsys, zxqtloc,
- bgrade)
+uxadd_send_file (zfrom, zto, zoptions, ztemp, zforward)
const char *zfrom;
const char *zto;
const char *zoptions;
const char *ztemp;
const char *zforward;
- const struct uuconf_system *qxqtsys;
- const char *zxqtloc;
- int bgrade;
{
struct scmd s;
@@ -1390,8 +1430,8 @@ uxadd_send_file (zfrom, zto, zoptions, ztemp, zforward, qxqtsys, zxqtloc,
if (zbase == NULL)
uxabort ();
- zxqt = zsysdep_data_file_name (qxqtsys, zxqtloc, bgrade, TRUE, abtname,
- abdname, abxname);
+ zxqt = zsysdep_data_file_name (&sXxqtsys, zXxqtloc, bXgrade, TRUE,
+ abtname, abdname, abxname);
if (zxqt == NULL)
uxabort ();
e = esysdep_fopen (zxqt, FALSE, FALSE, TRUE);
@@ -1399,19 +1439,21 @@ uxadd_send_file (zfrom, zto, zoptions, ztemp, zforward, qxqtsys, zxqtloc,
uxabort ();
uxrecord_file (zxqt);
- fprintf (e, "U %s %s\n", zsysdep_login_name (), zxqtloc);
+ fprintf (e, "U %s %s\n", zsysdep_login_name (), zXxqtloc);
fprintf (e, "F %s %s\n", abdname, zbase);
fprintf (e, "C uucp -C -W -d -g %c %s %s!%s\n",
- bgrade, zbase, zforward, zto);
+ bXgrade, zbase, zforward, zto);
ubuffree (zbase);
+ if (! fstdiosync (e, zxqt))
+ ulog (LOG_FATAL, "fsync failed");
if (fclose (e) != 0)
ulog (LOG_FATAL, "fclose: %s", strerror (errno));
/* Send the execution file. */
s.bcmd = 'S';
- s.bgrade = bgrade;
+ s.bgrade = bXgrade;
s.pseq = NULL;
s.zfrom = zbufcpy (abtname);
s.zto = zbufcpy (abxname);
@@ -1437,7 +1479,7 @@ uxadd_send_file (zfrom, zto, zoptions, ztemp, zforward, qxqtsys, zxqtloc,
}
s.bcmd = 'S';
- s.bgrade = bgrade;
+ s.bgrade = bXgrade;
s.pseq = NULL;
s.zfrom = zbufcpy (zfrom);
s.zto = zbufcpy (zto);
diff --git a/gnu/libexec/uucp/uuxqt/uuxqt.8 b/gnu/libexec/uucp/uuxqt/uuxqt.8
index b762d84..94aa559 100644
--- a/gnu/libexec/uucp/uuxqt/uuxqt.8
+++ b/gnu/libexec/uucp/uuxqt/uuxqt.8
@@ -1,5 +1,5 @@
-''' $Id: uuxqt.8,v 1.2 1994/05/07 18:14:41 ache Exp $
-.TH uuxqt 8 "Taylor UUCP 1.05"
+''' $Id: uuxqt.8,v 1.8 1995/06/26 22:38:55 ian Rel $
+.TH uuxqt 8 "Taylor UUCP 1.06"
.SH NAME
uuxqt \- UUCP execution daemon
.SH SYNOPSIS
@@ -64,8 +64,8 @@ is equivalent to
.B \-\-debug abnormal,chat.
The debugging output is sent to the debugging file, usually one of
-/var/spool/uucp/Debug, /var/spool/uucp/DEBUG, or
-/var/spool/uucp/.Admin/audit.local.
+/var/spool/uucp/Debug, /usr/spool/uucp/DEBUG, or
+/usr/spool/uucp/.Admin/audit.local.
.TP 5
.B \-I file, \-\-config
Set configuration file to use. This option may not be available,
diff --git a/gnu/libexec/uucp/uuxqt/uuxqt.c b/gnu/libexec/uucp/uuxqt/uuxqt.c
index 825f8a5..99c7db4 100644
--- a/gnu/libexec/uucp/uuxqt/uuxqt.c
+++ b/gnu/libexec/uucp/uuxqt/uuxqt.c
@@ -1,7 +1,7 @@
/* uuxqt.c
Run uux commands.
- Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor
+ Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
@@ -17,16 +17,16 @@
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.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The author of the program may be contacted at ian@airs.com or
- c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139.
+ c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
-const char uuxqt_rcsid[] = "$Id: uuxqt.c,v 1.3 1994/10/22 03:51:36 ache Exp $";
+const char uuxqt_rcsid[] = "$Id: uuxqt.c,v 1.82 1995/07/19 04:22:26 ian Rel $";
#endif
#include <errno.h>
@@ -59,6 +59,8 @@ static void uqdo_xqt_file P((pointer puuconf, const char *zfile,
const char *zlocalname,
const char *zcmd, boolean *pfprocessed));
static void uqcleanup P((const char *zfile, int iflags));
+static int isave_files P((const struct uuconf_system *, const char *zmail,
+ const char *zfile, int iclean));
static boolean fqforward P((const char *zfile, char **pzallowed,
const char *zlog, const char *zmail));
@@ -126,7 +128,7 @@ main (argc, argv)
case 'v':
/* Print version and exit. */
- printf ("%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@@ -248,13 +250,13 @@ main (argc, argv)
/* Look for each execute file, and run it. */
- if (! fsysdep_get_xqt_init ())
+ if (! fsysdep_get_xqt_init (zdosys))
{
ulog_close ();
usysdep_exit (FALSE);
}
- while ((z = zsysdep_get_xqt (&zgetsys, &ferr)) != NULL)
+ while ((z = zsysdep_get_xqt (zdosys, &zgetsys, &ferr)) != NULL)
{
const char *zloc;
boolean fprocessed;
@@ -342,7 +344,7 @@ main (argc, argv)
ubuffree (zgetsys);
}
- usysdep_get_xqt_free ();
+ usysdep_get_xqt_free (zdosys);
}
while (fany && ! FGOT_SIGNAL ());
@@ -363,7 +365,7 @@ main (argc, argv)
static void
uqhelp ()
{
- printf ("Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
+ printf ("Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
printf ("Usage: %s [-c,--command cmd] [-s,--system system]\n", zProgram);
printf (" -c,--command cmd: Set type of command to execute\n");
@@ -658,7 +660,7 @@ iqset (puuconf, argc, argv, pvar, pinfo)
int argc;
char **argv;
pointer pvar;
- pointer pinfo;
+ pointer pinfo;
{
boolean *pf = (boolean *) pvar;
@@ -674,8 +676,9 @@ iqset (puuconf, argc, argv, pvar, pinfo)
#define REMOVE_FILE (01)
#define REMOVE_NEEDED (02)
#define FREE_QINPUT (04)
-#define FREE_OUTPUT (010)
-#define FREE_MAIL (020)
+#define REMOVE_QINPUT (010)
+#define FREE_OUTPUT (020)
+#define FREE_MAIL (040)
/* Process an execute file. The zfile argument is the name of the
execute file. The zbase argument is the base name of zfile. The
@@ -1072,6 +1075,8 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
(void) fsysdep_mail (zmail, "Execution failed", i, az);
}
+ iclean = isave_files (qsys, zmail, zfile, iclean);
+
uqcleanup (zfile, iclean);
return;
}
@@ -1118,6 +1123,8 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
(void) fsysdep_mail (zmail, "Execution failed", i, az);
}
+ iclean = isave_files (qsys, zmail, zfile, iclean);
+
uqcleanup (zfile, iclean);
return;
}
@@ -1152,6 +1159,8 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
{
zQinput = zreal;
iclean |= FREE_QINPUT;
+ if (fspool)
+ iclean |= REMOVE_QINPUT;
}
if (zreal == NULL
@@ -1161,7 +1170,7 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
(const char *) NULL)))
{
ulog (LOG_ERROR, "Not permitted to read %s", zQinput);
-
+
if (zmail != NULL && ! fQno_ack)
{
const char *az[20];
@@ -1190,7 +1199,7 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
&& strcmp (zQoutsys, zlocalname) != 0)
{
char *zdata;
-
+
/* The output file is destined for some other system, so we must
use a temporary file to catch standard output. */
if (strcmp (zQoutsys, qsys->uuconf_zname) == 0)
@@ -1240,7 +1249,7 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
else
{
boolean fok;
-
+
qoutsys = NULL;
/* If we permitted the standard output to be redirected into
@@ -1278,7 +1287,7 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
if (! fok)
{
ulog (LOG_ERROR, "Not permitted to write to %s", zQoutfile);
-
+
if (zmail != NULL && ! fQno_ack)
{
const char *az[20];
@@ -1345,6 +1354,11 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
{
ubuffree (zfullcmd);
+ (void) fsysdep_move_uuxqt_files (cQfiles, (const char **) azQfiles,
+ (const char **) azQfiles_to,
+ FALSE, iQlock_seq,
+ (char **) NULL);
+
if (ftemp)
{
ulog (LOG_NORMAL, "Will retry later (%s)", zbase);
@@ -1355,10 +1369,6 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
(void) remove (zerror);
ubuffree (zerror);
}
- (void) fsysdep_move_uuxqt_files (cQfiles, (const char **) azQfiles,
- (const char **) azQfiles_to,
- FALSE, iQlock_seq,
- (char **) NULL);
uqcleanup (zfile, iclean &~ (REMOVE_FILE | REMOVE_NEEDED));
*pfprocessed = FALSE;
return;
@@ -1424,6 +1434,8 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
if (qoutsys != NULL)
(void) remove (zoutput);
+
+ iclean = isave_files (qsys, zmail, zfile, iclean);
}
else
{
@@ -1486,6 +1498,127 @@ uqdo_xqt_file (puuconf, zfile, zbase, qsys, zlocalname, zcmd, pfprocessed)
uqcleanup (zfile, iclean);
}
+/* If we have enough disk space, save the data files so that the UUCP
+ administrator can examine them. Send a mail message listing the
+ saved files. */
+
+static int
+isave_files (qsys, zmail, zfile, iclean)
+ const struct uuconf_system *qsys;
+ const char *zmail;
+ const char *zfile;
+ int iclean;
+{
+ long cspace;
+ char *zsavecmd;
+ char **pzsave;
+ int c;
+ int ifile;
+ char *zsaveinput;
+ const char **pz;
+ int i;
+
+ /* Save the files if there is 1.5 times the amount of required free
+ space. */
+ cspace = csysdep_bytes_free (zfile);
+ if (cspace == -1)
+ cspace = FREE_SPACE_DELTA;
+ cspace -= qsys->uuconf_cfree_space + qsys->uuconf_cfree_space / 2;
+ if (cspace < 0)
+ return iclean;
+
+ zsavecmd = zsysdep_save_failed_file (zfile);
+ if (zsavecmd == NULL)
+ return iclean;
+
+ c = 1;
+
+ pzsave = (char **) xmalloc (cQfiles * sizeof (char *));
+ for (ifile = 0; ifile < cQfiles; ifile++)
+ {
+ if (azQfiles[ifile] != NULL)
+ {
+ ++c;
+ pzsave[ifile] = zsysdep_save_failed_file (azQfiles[ifile]);
+ if (pzsave[ifile] == NULL)
+ {
+ ubuffree (zsavecmd);
+ for (i = 0; i < ifile; i++)
+ if (azQfiles[i] != NULL)
+ ubuffree (pzsave[i]);
+ xfree ((pointer) pzsave);
+ return iclean;
+ }
+ }
+ }
+
+ zsaveinput = NULL;
+ if ((iclean & REMOVE_QINPUT) != 0
+ && fsysdep_file_exists (zQinput))
+ {
+ zsaveinput = zsysdep_save_failed_file (zQinput);
+ if (zsaveinput == NULL)
+ {
+ ubuffree (zsavecmd);
+ for (i = 0; i < cQfiles; i++)
+ if (azQfiles[i] != NULL)
+ ubuffree (pzsave[i]);
+ xfree ((pointer) pzsave);
+ return iclean;
+ }
+ }
+
+ pz = (const char **) xmalloc ((20 + 2 * cQfiles) * sizeof (char *));
+ i = 0;
+
+ pz[i++] = "A UUCP execution request failed:\n\t";
+ pz[i++] = zQcmd;
+ if (zmail != NULL)
+ {
+ pz[i++] = "\nThe request was made by\n\t";
+ pz[i++] = zmail;
+ }
+ else
+ {
+ pz[i++] = "\nThe request came from system\n\t";
+ pz[i++] = qsys->uuconf_zname;
+ }
+ if (c == 1 && zsaveinput == NULL)
+ pz[i++] = "\nThe following file has been saved:\n\t";
+ else
+ pz[i++] = "\nThe following files have been saved:\n\t";
+ pz[i++] = zsavecmd;
+ for (ifile = 0; ifile < cQfiles; ifile++)
+ {
+ if (azQfiles[ifile] != NULL)
+ {
+ pz[i++] = "\n\t";
+ pz[i++] = pzsave[ifile];
+ }
+ }
+ if (zsaveinput != NULL)
+ {
+ pz[i++] = "\n\t";
+ pz[i++] = zsaveinput;
+ }
+ pz[i++] = "\n";
+
+ (void) fsysdep_mail (OWNER,
+ "UUCP execution files saved after failure",
+ i, pz);
+
+ xfree ((pointer) pz);
+
+ ubuffree (zsavecmd);
+ for (ifile = 0; ifile < cQfiles; ifile++)
+ if (azQfiles[ifile] != NULL)
+ ubuffree (pzsave[ifile]);
+ xfree ((pointer) pzsave);
+ ubuffree (zsaveinput);
+
+ return iclean &~ (REMOVE_FILE | REMOVE_NEEDED);
+}
+
/* Clean up the results of uqdo_xqt_file. */
static void
@@ -1514,6 +1647,8 @@ uqcleanup (zfile, iflags)
if (azQfiles[i] != NULL)
(void) remove (azQfiles[i]);
}
+ if ((iflags & REMOVE_QINPUT) != 0)
+ (void) remove (zQinput);
}
if ((iflags & FREE_QINPUT) != 0)
OpenPOWER on IntegriCloud