[Bug 124246] grubby fatal error: unable to find a suitable template

bugzilla at redhat.com bugzilla at redhat.com
Thu Jul 16 21:13:22 UTC 2009


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=124246


Eric Sandeen <esandeen at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |esandeen at redhat.com,
                   |                            |katzj at redhat.com




--- Comment #41 from Eric Sandeen <esandeen at redhat.com>  2009-07-16 17:13:16 EDT ---
I'm hitting this in rawhide.  It looks like getpathbyspec() is fubar.

(disclaimer: despite owning blkid for 3 years I managed to never -really- look
at it until it was dispatched to util-linux-ng \o/ !)

Anyway, getpathbyspec() is doing:

    if (!strncmp(device, "LABEL=", 6))
        return blkid_get_tag_value(blkid, "LABEL", device+6);
    else if (!strncmp(device, "UUID=", 5))
        return blkid_get_tag_value(blkid, "UUID", device+5);

but blkid_get_tag_value() returns the value of the tag specified in the 2nd arg
for the device in the 3rd arg.  But we're passing in the UUID or the LABEL
value itself in the 3rd arg.  So then blkid is going off trying to access
"899c0289-ec5b-4143-8856-fc9eb0b8f798" and read it.

Replacing the above with:

Index: grubby-7.0/grubby.c
===================================================================
--- grubby-7.0.orig/grubby.c
+++ grubby-7.0/grubby.c
@@ -427,11 +427,7 @@ static char * getpathbyspec(char *device
     if (!blkid)
         blkid_get_cache(&blkid, NULL);

-    if (!strncmp(device, "LABEL=", 6))
-        return blkid_get_tag_value(blkid, "LABEL", device+6);
-    else if (!strncmp(device, "UUID=", 5))
-        return blkid_get_tag_value(blkid, "UUID", device+5);
-    return device;
+    return blkid_get_devname(blkid, device, NULL);
 }

 static enum lineType_e getTypeByKeyword(char * keyword, 

seems to work for me; blkid_get_devname(cache, token, <value>) returns the name
of the device matching the token TOKEN=value string, or the device itself if
"token" isn't a name, value pair.

Probably requires more testing, etc etc.

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.




More information about the fedora-triage-list mailing list