From 8714d5293e7622f82affbab5025e406ed21ac545 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 21 May 2007 15:53:29 +0000 Subject: [PATCH] Remove DIOCWLABEL operation. Doing it destroyed the purpose of having write protected areas in the first place. This also solves an issue bootstrapping from older versions of DragonFly since the ioctl has moved to a different header file. Users can write-enable the label area with disklabel -W/-N if the issue comes up. Note: In DragonFly 1.9 and later, the MBR and disklabel areas are only write protected when accessed via a slice or partition. Access to these areas via the raw disk (e.g. ad0) is no long write-protected. Reported-by: Hasso Tepper , YONETANI Tomokazu --- bin/dd/dd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/bin/dd/dd.c b/bin/dd/dd.c index e9b1c5943a..55d56eeb09 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -37,14 +37,13 @@ * @(#) Copyright (c) 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)dd.c 8.5 (Berkeley) 4/2/94 * $FreeBSD: src/bin/dd/dd.c,v 1.27.2.3 2001/08/01 01:37:35 obrien Exp $ - * $DragonFly: src/bin/dd/dd.c,v 1.7 2007/05/20 23:21:32 dillon Exp $ + * $DragonFly: src/bin/dd/dd.c,v 1.8 2007/05/21 15:53:29 dillon Exp $ */ #include #include #include #include -#include #include #include @@ -214,14 +213,8 @@ getfdtype(IO *io) } else { if (type & D_TAPE) io->flags |= ISTAPE; - else if (type & (D_DISK | D_MEM)) { - if (type & D_DISK) { - const int one = 1; - - ioctl(io->fd, DIOCWLABEL, &one); - } + else if (type & (D_DISK | D_MEM)) io->flags |= ISSEEK; - } if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0) io->flags |= ISCHR; } -- 2.11.4.GIT