Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Sep 2000 23:23:32 +0200 (CEST)
From:      Christian Weisgerber <naddy@mips.inka.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/21232: "restore -s" broken on 64-bit archs
Message-ID:  <200009122123.e8CLNWF81866@ganerc.mips.inka.de>

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

>Number:         21232
>Category:       bin
>Synopsis:       "restore -s" broken on 64-bit archs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 12 14:30:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Christian Weisgerber
>Release:        FreeBSD 5.0-CURRENT alpha
>Organization:
>Environment:

alpha, tape

>Description:

"restore -s <number>" fails with
"ioctl MTFSF: Inappropriate ioctl for device".

The relevant ioctl() in restore/tape.c unexpectedly casts the
request argument to int.  This leads to sign extension on the alpha,
resulting in 0xFFFFFFFF80086D01 being passed instead of 0x80086D01
(MTFSF).

>How-To-Repeat:

restore -is 1

>Fix:

Index: restore/tape.c
===================================================================
RCS file: /home/ncvs/src/sbin/restore/tape.c,v
retrieving revision 1.17
diff -u -r1.17 tape.c
--- restore/tape.c	2000/07/16 23:22:15	1.17
+++ restore/tape.c	2000/09/12 20:40:10
@@ -497,7 +497,7 @@
 		rmtioctl(MTFSF, dumpnum - 1);
 	else
 #endif
-		if (ioctl(mt, (int)MTIOCTOP, (char *)&tcom) < 0)
+		if (ioctl(mt, MTIOCTOP, (char *)&tcom) < 0)
 			fprintf(stderr, "ioctl MTFSF: %s\n", strerror(errno));
 }
 

>Release-Note:
>Audit-Trail:
>Unformatted:


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?200009122123.e8CLNWF81866>