parmelee@cornell.UUCP (Larry Parmelee) (12/13/85)
Subject: uux bug with long system names + Fix
Index: /usr/src/usr.bin/uucp/uux.c 4.3BSD beta
Description:
When your uucp system name is longer than 7 characters, and
uux takes its input from stdin, uux tries to change the
processing grade of a temporary file, but misses the proper
character, screwing up the sequence number instead. This can
cause a number of data files to be sent into the same file on
the remote system.
Repeat-By:
Make your system name something like tanstaafl (9 characters).
Issue a few uux commands which take their input from stdin,
and look at the control files generated:
::::::::::::::
file: C.cornellC00f4
::::::::::::::
S D.tanstaaB00f2 D.tanstaaB00S2 bill - D.tanstaaB00f2 0666
S D.tanstaaX00f0 X.tanstaaC00f3 bill - D.tanstaaX00f0 0666
::::::::::::::
file: C.cornellC00g4
::::::::::::::
S D.tanstaaB00g2 D.tanstaaB00S2 bill - D.tanstaaB00g2 0666
S D.tanstaaX00g0 X.tanstaaC00g3 bill - D.tanstaaX00g0 0666
Note that the local data file gets sent into the same remote
file name "D.tanstaaB00S2" both times. Say your favorite mantra.
Fix:
Here's a context diff. Maybe patch will work. No promises,
though.
*** /tmp/d12452 Fri Dec 13 13:58:11 1985
--- uux.c Fri Dec 13 13:47:05 1985
***************
*** 188,194 ****
fclose(fpd);
strcpy(tfile, dfile);
if (strcmp(local, xsys) != SAME) {
! tfile[strlen(local) + 2] = 'S';
GENSEND(fpc, dfile, tfile, User, "", dfile);
cflag++;
}
--- 188,197 ----
fclose(fpd);
strcpy(tfile, dfile);
if (strcmp(local, xsys) != SAME) {
! int slen = strlen(local);
! if (slen > SYSNSIZE)
! slen = SYSNSIZE;
! tfile[slen + 2] = 'S';
GENSEND(fpc, dfile, tfile, User, "", dfile);
cflag++;
}