diff options
-rw-r--r-- | NEWS | 14 | ||||
-rw-r--r-- | gptcl.cc | 8 |
2 files changed, 15 insertions, 7 deletions
@@ -1,12 +1,20 @@ 0.8.10 (?/??/2014): ------------------- +- Fixed bug that caused incorrect partition number to be displayed by + sgdisk in error messages when the user specified a non-existent partition + for inclusion in a hybrid MBR or conversion to a conventional MBR. + - Fixed new (in 0.8.9) bug that caused a failure to create more than one hybridized partition when creating a hybrid MBR. -- Fixed bug that caused gdisk to create hybridized partitions that ended - above the 2^32 sector point with incorrect end values. The program now - refuses to create such hybridized partitions at all. +- Fixed bug that caused gdisk and sgdisk to create hybridized partitions + that ended above the 2^32 sector point with incorrect end values. The + program now refuses to create such hybridized partitions at all. (A case + could be made for allowing creation of such partitions so long as the + start sector is below 2^32 and the size is under 2^32, but as a practical + matter, many OSes flake out with such partitions, so I'm erring on the + side of caution on this one.) 0.8.9 (2/17/2014): ------------------ @@ -1,7 +1,7 @@ /* Implementation of GPTData class derivative with popt-based command line processing - Copyright (C) 2010-2013 Roderick W. Smith + Copyright (C) 2010-2014 Roderick W. Smith This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -467,14 +467,14 @@ int GPTDataCL::BuildMBR(char* argument, int isHybrid) { int numParts, allOK = 1, i, origPartNum; MBRPart newPart; BasicMBRData newMBR; - + if (argument != NULL) { numParts = CountColons(argument) + 1; if (numParts <= (4 - isHybrid)) { newMBR.SetDisk(GetDisk()); for (i = 0; i < numParts; i++) { origPartNum = GetInt(argument, i + 1) - 1; - if (IsUsedPartNum(origPartNum)) { + if (IsUsedPartNum(origPartNum) && partitions[origPartNum].IsSizedForMBR()) { newPart.SetInclusion(PRIMARY); newPart.SetLocation(operator[](origPartNum).GetFirstLBA(), operator[](origPartNum).GetLengthLBA()); @@ -482,7 +482,7 @@ int GPTDataCL::BuildMBR(char* argument, int isHybrid) { newPart.SetType((uint8_t)(operator[](origPartNum).GetHexType() / 0x0100)); newMBR.AddPart(i + isHybrid, newPart); } else { - cerr << "Partition " << origPartNum << " does not exist! Aborting operation!\n"; + cerr << "Original partition " << origPartNum + 1 << " does not exist or is too big! Aborting operation!\n"; allOK = 0; } // if/else } // for |