[comp.mail.uucp] UUPC/DECUS UUCP interaction bug.

munroe@thehulk.dmc.com (Dick Munroe, Doyle Munroe Consultants, Inc.) (05/30/90)

In article <27@thehulk.dmc.com>, munroe@thehulk.dmc.com (Dick Munroe, Doyle Munroe Consultants, Inc.) writes:
> All implementations of UUPC send the following during the initial
> g protocol handshake:
> 
> 	\000\020 handshake message \000
> 
> While not, strictly speaking, a violation of g protocol (as I
> understand it) it does give some uucico implementations a
> problem, notably DECUS UUCP, which is where I ran into it.
> 
> I plan to fix the uucico in DECUS UUCP but it was easier to fix
> the UUPC implementation (because I understand it better, not due
> to any flaw in DECUS UUCP).
> 
As promised, here is the fix for DECUS UUCP.

Attached are the SLP files for the versions of CALLS.C and UUCICO.C
that shipped with DECUS UUCP V1.1 that implements this fix.  It
has been tested against UUPC and the UUCP running on uunet.

Use it in good health.
--------------- cut here for call.slp -----------------------------
-    2
 *
 * 0.000 Dick Munroe	28-May-90
 *	Fix getstring to operate properly on g protocol framed strings.
-  774,  776
 * Read a framed, null-terminated string for the protocol initialization 
 * sequence.  String starts with character following the first DLE (0x10)
 * character and goes until the next null character.
-  785
	 "Scanning for DLE (getstring), rcvd");

	while ( ((data = xgetc(10)) != EOF))
	{
		data &= 0x7f ;		/* Trim to 7 bits */
		charlog (&data, 1, DB_LGI, (char *)NULL);
		if (data == 0x10)
		{
			goto DLE_seen ;
		} ;			/* End if */
	} ;				/* End while */

	/*
	** There was no DLE character in the data stream within the
	** timeout period.  This means there was no frame and, by implication,
	** no string.
	*/

	DEBUG(DB_LGI, "\nTimeout in Getstring while scanning for DLE\n", 0);
	return FAIL;

	DLE_seen :

	charlog((char *)NULL, 0, DB_LGI, 
-  805,  808
	}
	DEBUG(DB_LGI, "\nTimeout in Getstring while collecting string\n", 0);
/
--------------- cut here for uucico.slp ---------------------------
-   33
 *
 * 0.000 Dick Munroe 29-May-90
 *	A minor reorganization of the protocol handshake to get the DLE
 *	scan working in getstring.
-  643,  645
	if (getstring(msgbuf, MAX_STRING) != SUCCESS)  
	{
-  649,  653
	} ;

	if (strncmp( msgbuf, "Shere", 5 ) != SAME)
	{
-  657,  657
	} ;				/* End if */
-  661,  662
	if (msgbuf[5] == '=') 
	{
		if (strcmp(Hostname, &msgbuf[6]) != SAME) 
		{
-  667,  667
	} 
	else if (msgbuf[5] != '\0') 
	{
-  671,  671
	} ;				/* End if */
/

-- 
Dick Munroe				Internet: munroe@thehulk.dmc.com
Doyle Munroe Consultants, Inc.		UUCP: ...uunet!thehulk!munroe
267 Cox St.				Office: (508) 568-1618
Hudson, Ma.				FAX: (508) 562-1133
-- 
Dick Munroe				Internet: munroe@thehulk.dmc.com
Doyle Munroe Consultants, Inc.		UUCP: ...uunet!thehulk!munroe
267 Cox St.				Office: (508) 568-1618
Hudson, Ma.				FAX: (508) 562-1133