Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KjvrF-0002YG-Ui for mharc-grub-devel@gnu.org; Sun, 28 Sep 2008 08:58:41 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjvrD-0002WB-ST for grub-devel@gnu.org; Sun, 28 Sep 2008 08:58:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjvrB-0002VI-0s for grub-devel@gnu.org; Sun, 28 Sep 2008 08:58:38 -0400 Received: from [199.232.76.173] (port=53481 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjvrA-0002VF-UY for grub-devel@gnu.org; Sun, 28 Sep 2008 08:58:36 -0400 Received: from aybabtu.com ([69.60.117.155]:34890) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kjvr9-0005ow-Qz for grub-devel@gnu.org; Sun, 28 Sep 2008 08:58:36 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1KjveB-0007RP-QI for grub-devel@gnu.org; Sun, 28 Sep 2008 14:45:15 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Kjvp2-0005eb-7i for grub-devel@gnu.org; Sun, 28 Sep 2008 14:56:24 +0200 Date: Sun, 28 Sep 2008 14:56:24 +0200 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20080928125623.GA21669@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] iso uuid created vs modified X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2008 12:58:40 -0000 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, It seems our ISO UUID code was checking for modified date rather than created date as the source suggests. I believe this is the right thing to do (since theoretically two different images could share creation date), so my patch just renames it (and adds the real field for creation date while at it). -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all." --UugvWAfsgieZRqgk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="iso_uuid.diff" Index: fs/iso9660.c =================================================================== --- fs/iso9660.c (revision 1878) +++ fs/iso9660.c (working copy) @@ -93,8 +93,9 @@ grub_uint32_t path_table; grub_uint8_t unused5[12]; struct grub_iso9660_dir rootdir; - grub_uint8_t unused6[641]; + grub_uint8_t unused6[624]; struct grub_iso9660_date created; + struct grub_iso9660_date modified; } __attribute__ ((packed)); /* A single entry in the path table. */ @@ -840,14 +841,14 @@ data = grub_iso9660_mount (disk); if (data) { - if (! data->voldesc.created.year[0] && ! data->voldesc.created.year[1] - && ! data->voldesc.created.year[2] && ! data->voldesc.created.year[3] - && ! data->voldesc.created.month[0] && ! data->voldesc.created.month[1] - && ! data->voldesc.created.day[0] && ! data->voldesc.created.day[1] - && ! data->voldesc.created.hour[0] && ! data->voldesc.created.hour[1] - && ! data->voldesc.created.minute[0] && ! data->voldesc.created.minute[1] - && ! data->voldesc.created.second[0] && ! data->voldesc.created.second[1] - && ! data->voldesc.created.hundredth[0] && ! data->voldesc.created.hundredth[1]) + if (! data->voldesc.modified.year[0] && ! data->voldesc.modified.year[1] + && ! data->voldesc.modified.year[2] && ! data->voldesc.modified.year[3] + && ! data->voldesc.modified.month[0] && ! data->voldesc.modified.month[1] + && ! data->voldesc.modified.day[0] && ! data->voldesc.modified.day[1] + && ! data->voldesc.modified.hour[0] && ! data->voldesc.modified.hour[1] + && ! data->voldesc.modified.minute[0] && ! data->voldesc.modified.minute[1] + && ! data->voldesc.modified.second[0] && ! data->voldesc.modified.second[1] + && ! data->voldesc.modified.hundredth[0] && ! data->voldesc.modified.hundredth[1]) { grub_error (GRUB_ERR_BAD_NUMBER, "No creation date in filesystem to generate UUID."); *uuid = NULL; @@ -856,14 +857,14 @@ { *uuid = grub_malloc (sizeof ("YYYY-MM-DD-HH-mm-ss-hh")); grub_sprintf (*uuid, "%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c", - data->voldesc.created.year[0], data->voldesc.created.year[1], - data->voldesc.created.year[2], data->voldesc.created.year[3], - data->voldesc.created.month[0], data->voldesc.created.month[1], - data->voldesc.created.day[0], data->voldesc.created.day[1], - data->voldesc.created.hour[0], data->voldesc.created.hour[1], - data->voldesc.created.minute[0], data->voldesc.created.minute[1], - data->voldesc.created.second[0], data->voldesc.created.second[1], - data->voldesc.created.hundredth[0], data->voldesc.created.hundredth[1]); + data->voldesc.modified.year[0], data->voldesc.modified.year[1], + data->voldesc.modified.year[2], data->voldesc.modified.year[3], + data->voldesc.modified.month[0], data->voldesc.modified.month[1], + data->voldesc.modified.day[0], data->voldesc.modified.day[1], + data->voldesc.modified.hour[0], data->voldesc.modified.hour[1], + data->voldesc.modified.minute[0], data->voldesc.modified.minute[1], + data->voldesc.modified.second[0], data->voldesc.modified.second[1], + data->voldesc.modified.hundredth[0], data->voldesc.modified.hundredth[1]); } } else --UugvWAfsgieZRqgk--