From owner-freebsd-doc Sat Mar 30 23:30:11 2002 Delivered-To: freebsd-doc@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5AA9837B41E for ; Sat, 30 Mar 2002 23:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2V7U1p15561; Sat, 30 Mar 2002 23:30:01 -0800 (PST) (envelope-from gnats) Received: from lists.blarg.net (lists.blarg.net [206.124.128.17]) by hub.freebsd.org (Postfix) with ESMTP id 07F3C37B41E for ; Sat, 30 Mar 2002 23:21:34 -0800 (PST) Received: from thig.blarg.net (thig.blarg.net [206.124.128.18]) by lists.blarg.net (Postfix) with ESMTP id B7BC6BD2F for ; Sat, 30 Mar 2002 23:21:33 -0800 (PST) Received: from localhost.localdomain ([206.124.139.115]) by thig.blarg.net (8.9.3/8.9.3) with ESMTP id XAA08669 for ; Sat, 30 Mar 2002 23:21:33 -0800 Received: (from jojo@localhost) by localhost.localdomain (8.11.6/8.11.3) id g2V7Jre42696; Sat, 30 Mar 2002 23:19:53 -0800 (PST) (envelope-from swear@blarg.net) Message-Id: <898z89b3vr.z89@localhost.localdomain> Date: 30 Mar 2002 23:19:52 -0800 From: "Gary W. Swearingen" Reply-To: swear@blarg.net To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/36563: fdisk(8) program doesn't honor -t (test) when using -I. Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 ". ================ >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