GNU bug report logs - #31111
Partition table wrongly identified as "atari"

Previous Next

Package: parted;

Reported by: bouke_1 <bouke_1 <at> zonnet.nl>

Date: Mon, 9 Apr 2018 14:22:01 UTC

Severity: normal

Done: Phil Susi <psusi <at> ubuntu.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: bouke_1 <bouke_1 <at> zonnet.nl>
To: bug-parted <at> gnu.org
Subject: Re: bug#31111: Partition table wrongly identified as "atari"
Date: Tue, 10 Apr 2018 13:59:05 +0200
I quickly looked through the atari_probe routine in the Atari patch 
code, and I may have found the logic error. At the bottom:

     } /* no XGM so try ICD */
+         else if (atr_part_valid (&table.icd_part[0], rs_hd_size)
+                  && atr_part_known (&table.icd_part[0], 
atr_known_icd_pid)) {
+               for (i = 1; i < N_ICD; i++) {
+                       if (atr_part_trash (&table.icd_part[i], 
rs_hd_size))
+                               return 0;
+               }
+       }
+
+       return 1;
+ }

Correct me if I'm wrong (I know little about partitioning and less about 
atari disks), but it looks if the partition (or whatever) does not check 
out as "XGM" and either atr_part_valid  or atr_part_known  returns 
false, the routine will return 1 (meaning: this checks out as an atari 
disk).

In order to reach this part, only a few things need to check out (in the 
top part of the routine): three id values need to be alphanumeric and a 
couple of sizes need to be realistic (i.e., in my case, between 0 and 
500G). That does not seem like something that can never happen by 
coincidence for a non-atari disk.

I would guess it may be a good idea to add another "else return 0;" line 
so that if the disk is neither "XGM" nor "ICD" (whatever that may mean), 
it is not detected as atari disk.

I have the neither the stomach nor the means or the time to look into 
this but if I can assist in any way please let me know.

Bouke




This bug report was last modified 7 years and 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.