Don't bother decoding a partition's c/h/s start or end from the MBR read from
authorkrw <krw@openbsd.org>
Mon, 18 Oct 2021 20:27:32 +0000 (20:27 +0000)
committerkrw <krw@openbsd.org>
Mon, 18 Oct 2021 20:27:32 +0000 (20:27 +0000)
disk.

The decoded values were overwritten by an invocation of PRT_fix_CHS() before
they were used.

sbin/fdisk/part.c

index d65255b..3dd5ee8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: part.c,v 1.109 2021/10/18 16:12:02 krw Exp $  */
+/*     $OpenBSD: part.c,v 1.110 2021/10/18 20:27:32 krw Exp $  */
 
 /*
  * Copyright (c) 1997 Tobias Weingartner
@@ -274,15 +274,7 @@ PRT_parse(const struct dos_partition *dp, const uint64_t lba_self,
        uint32_t                t;
 
        prt->prt_flag = dp->dp_flag;
-       prt->prt_shead = dp->dp_shd;
-
-       prt->prt_ssect = (dp->dp_ssect) & 0x3F;
-       prt->prt_scyl = ((dp->dp_ssect << 2) & 0xFF00) | dp->dp_scyl;
-
        prt->prt_id = dp->dp_typ;
-       prt->prt_ehead = dp->dp_ehd;
-       prt->prt_esect = (dp->dp_esect) & 0x3F;
-       prt->prt_ecyl = ((dp->dp_esect << 2) & 0xFF00) | dp->dp_ecyl;
 
        if ((prt->prt_id == DOSPTYP_EXTEND) || (prt->prt_id == DOSPTYP_EXTENDL))
                off = lba_firstembr;