Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2000 11:43:56 -0800 (PST)
From:      Matthew Jacob <mjacob@feral.com>
To:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: i386/14946: rmt - remote magtape protocol
Message-ID:  <Pine.BSF.4.05.10002071138340.79272-100000@semuta.feral.com>
In-Reply-To: <Pine.BSF.4.05.10002071033370.79272-100000@semuta.feral.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Upon further examination of the problem, I believe that a much smaller change
will be sufficient until we decide (if we decide) move to RMT protocol version
1 from version 0:

--------
Index: rmt.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/rmt/rmt.c,v
retrieving revision 1.6
diff -u -r1.6 rmt.c
--- rmt.c	1999/08/28 01:19:32	1.6
+++ rmt.c	2000/02/07 19:40:34
@@ -184,9 +184,11 @@
 		  if (ioctl(tape, MTIOCGET, (char *)&mtget) < 0)
 			goto ioerror;
 		  rval = sizeof (mtget);
+		  if (rval > 24)	/* original mtget structure size */
+			rval = 24;
 		  (void)sprintf(resp, "A%d\n", rval);
 		  (void)write(1, resp, strlen(resp));
-		  (void)write(1, (char *)&mtget, sizeof (mtget));
+		  (void)write(1, (char *)&mtget, rval);
 		  goto top;
 		}
 
-------

There is no need to change dump or restore because they don't use rmtstatus at
all right now. The reason why the above is fine is that for version 0 RMT
protocol, the actual contents of the status structure must be undefined
(they're binary, after all), so as long as the size is acceptable, it must in
fact be 'good' status.

Comments? I've tried this for both dump/restore from/to a Solaris 2.7 system
and it seems to work.

-matt





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.10002071138340.79272-100000>