Date: 30 Mar 2002 23:19:52 -0800 From: "Gary W. Swearingen" <swear@blarg.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/36563: fdisk(8) program doesn't honor -t (test) when using -I. Message-ID: <898z89b3vr.z89@localhost.localdomain>
next in thread | raw e-mail | index | archive | help
>Number: 36563
>Category: docs
>Synopsis: fdisk(8) program doesn't honor -t (test) when using -I.
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Mar 30 23:30:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Gary W. Swearingen
>Release: FreeBSD 4.5-STABLE i386
>Organization:
none
>Environment:
n/a
================
>Description:
The fdisk(8) program's man page says it doesn't write the partition
table when the -t option is used, but it does do so if the -I option is
also used, or at least that seems clear to me from the -I code in the
"main" function in "/usr/src/sbin/i386/fdisk/fdisk.c" and following the
functions calls to write_s0 and write_disk which don't use the "t_flag"
to protect against writing the partition table.
(The .../pc98/... version doesn't have a -I option.)
================
>How-To-Repeat:
If you have a free disk that can have all it's data destroyed,
you could try "fdisk -I -t <disk-to-wipe-out>".
================
>Fix:
(untested)
--- /usr/src/sbin/i386/fdisk/fdisk.c Sat Mar 2 15:58:41 2002
+++ /tmp/fdisk.c Sat Mar 30 23:16:14 2002
@@ -346,7 +346,10 @@
dos(partp);
if (v_flag)
print_s0(-1);
- write_s0();
+ if (!t_flag)
+ {
+ write_s0();
+ }
exit(0);
}
if (f_flag)
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?898z89b3vr.z89>
