Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830919); site haring.UUCP Path: utzoo!linus!philabs!mcvax!haring!jim From: jim@haring.UUCP (Jim McKie) Newsgroups: net.bugs.4bsd Subject: /etc/rmt protocol botch Message-ID: <121@haring.UUCP> Date: Tue, 20-Dec-83 09:05:59 EST Article-I.D.: haring.121 Posted: Tue Dec 20 09:05:59 1983 Date-Received: Thu, 22-Dec-83 01:04:25 EST Organization: CWI, Amsterdam Lines: 35 The following is a bug report on a botch in the remote magtape protocol described in RMT(8). I found this when writing a set of routines (topen, tread, twrite, etc.) for a program to let us do remote tape-to-tape copies. Jim McKie Centrum voor Wiskunde en Informatica ..mcvax!jim --------------------------------------------------------------------------- Subject: /etc/rmt protocol botch Index: /usr/src/etc/rmt.c 4.2BSD Description: The remote magtape protocol described in RMT(8) is not followed by the module "/etc/rmt" with respect to the 'S' command. Repeat-By: Write a short program which creates a connection to the /etc/rmt on another machine then try an 'S' command - you will not get a valid response back (i.e. 'A') if the operation was successfull. /etc/rmt will send back the contents of a successfull MTIOCGET ioctl BEFORE it sends back the 'A' response. Fix: Change the two lines in the code for the 'S' command from (void) write(1, (char *)&mtget, sizeof (mtget)); goto respond; to (void) sprintf(resp, "A%d\n", rval); (void) write(1, resp, strlen(resp)); (void) write(1, (char *)&mtget, sizeof (mtget)); goto top; Another (fairly benign) bug is that all arrays declared of size 'SSIZE' should be of size 'SSIZE+1', to deal with one of the terminating conditions of the 'for' loop in the function 'gets'.