Uucp incorrectly chooses 't' protocol (1 of 2)
Chuck Privitera
crp at ccivax.UUCP
Thu May 2 04:09:08 AEST 1985
Index: usr.bin/uucp/cico.c 4.2BSD FIX
Description:
The (self proclaimed kludgy) IsTcpIp flag is initialized
in uucpdefs.[ch] (depending on what version of uucp you
have) to 0 and in cico.c to 1 if the line is determined
to be to a TCP/IP host. However, once it is set to 1, it
never gets cleared. Thus, running the uucp queue with jobs
queued to TCP/IP machines as well as to non-TCP/IP machines
AND the TCP/IP machine(s) get called first, when uucico gets
to the non-TCP/IP machine it will incorrectly choose the
't' protocol (if the other machine supports it).
Repeat-By:
Queue a job to a tcp/ip host and to a non-tcp/ip host such
that the non-tcp/ip site will be called last. If you don't
talk to any TCP/IP machines, you can add a line like:
Localhost Any TCP uucp Localhost login: uucp
To your L.sys file and a line like:
TCP ttyXX unused 9600 TCP
To your L-devices file. Then queue something to Localhost
(or whatever) and to a non-tcp/ip machine (who is gauranteed
to be called second, and supports the 't' protocol) with
uucp -r so the job is only queued. Then run uucico by hand
with debugging turned on so you can see the protocol selection
and everything. Notice that the 't' protocol will also
be selected for the non-tcp/ip site.
If the non-tcp/ip site has a version of the 't' protocol
compatible with yours (there was a substantial change
to the 't' protocol sometime around last July), the
conversation will probably succeed, if not you will probably
get a core dump in trddata() (because previously the total
transmission byte count was sent at the beginning of the
conversation, and now a byte count is sent at the front of
each buffer). Even if the conversation goes OK, the integrity
of the data cannot be guaranteed because nobody was checking
for integrity (normally, the 'g' protocol or TCP ensures
data integrity, but TCP wasn't really the transport
mechanism, the tty driver was.)
Fix:
The fix is simple, just explicitly reset the IsTcpIp flag
if it is determined that the new connection is to a non-tcp/ip
site. A diff listing of the old and new code follows (line
numbers are probably off). See the next article to find out
what you can do to protect yourself from remote sites with
this problem.
RCS file: RCS/cico.c,v
retrieving revision 1.30
diff -c3 -r1.30 cico.c
*** /tmp/,RCSt1003841 Wed May 1 14:07:27 1985
--- cico.c Wed May 1 10:47:01 1985
***************
*** 1,5
#ifndef lint
! static char *RcsId = "@(#) $Header: cico.c,v 1.30 85/03/17 17:42:51 rick Exp $";
/* from: @(#)cico.c 5.3 (Berkeley) 10/3/83 */
#endif !lint
--- 1,5 -----
#ifndef lint
! static char *RcsId = "@(#) $Header: cico.c,v 1.31 85/05/01 10:42:33 root Exp $";
/* from: @(#)cico.c 5.3 (Berkeley) 10/3/83 */
#endif !lint
***************
*** 499,505
if (isatty(Ifn) == 0) {
IsTcpIp = 1;
DEBUG(4, "TCPIP connection -- ioctl-s disabled\n", CNULL);
! }
#endif
if (setjmp(Sjbuf))
--- 499,506 -----
if (isatty(Ifn) == 0) {
IsTcpIp = 1;
DEBUG(4, "TCPIP connection -- ioctl-s disabled\n", CNULL);
! } else
! IsTcpIp = 0;
#endif
if (setjmp(Sjbuf))
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list