All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iso uuid created vs modified
@ 2008-09-28 12:56 Robert Millan
  2008-09-28 15:21 ` Robert Millan
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Millan @ 2008-09-28 12:56 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]


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."

[-- Attachment #2: iso_uuid.diff --]
[-- Type: text/x-diff, Size: 3195 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-28 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-28 12:56 [PATCH] iso uuid created vs modified Robert Millan
2008-09-28 15:21 ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.