Ignore invalid reiserfs UUIDs (#684115)

On Fedora up to and including Fedora 16 and Red Hat and CentOS up to the
current 6.3 release the UUID of an unmounted reiserfs file system is
displayed as "<no" and a GTK markup warning is written to the terminal.

This was because the reiserfs-utils package isn't linked with libuuid
support so reiserfs file systems were created with a Nil UUID (all
zeros).  To read the UUID GParted first tries to retrieve the UUID from
the blkid command output via the FS_Info cache.  Secondly it tries the
reiserfs file system specific read_uuid() method which uses the first
space separated word following the text "UUID:", hence it gets "<no".

    # debugreiserfs /dev/sda15 2> /dev/null | grep UUID
    UUID: <no libuuid installed>

In September 2012 Red Hat bug 660285 "reiserfstune compiled without UUID
support" was fixed for Fedora 16 and later releases.  On Fedora with
this fix applied GParted will display the Nil UUID (all zeros) for a
previously created reiserfs file system rather than suppressing it.

Only accept valid, none Nil UUIDs in the reiserfs file system specific
read_uuid() method.

Bug #684115 - Reiserfs UUID reading issues on Fedora and CentOS
This commit is contained in:
Mike Fleetwood 2012-09-15 21:39:14 +01:00 committed by Curtis Gedak
parent 08367aca0d
commit eca986c96d
2 changed files with 4 additions and 1 deletions

View File

@ -35,6 +35,9 @@
#include <vector> #include <vector>
#define UUID_STRING_LENGTH 36 #define UUID_STRING_LENGTH 36
//Match RFC 4122 UUID strings. Exclude Nil UUID (all zeros) by excluding
// zero from the version field nibble.
#define RFC4122_NONE_NIL_UUID_REGEXP "[[:xdigit:]]{8}-[[:xdigit:]]{4}-[1-9a-fA-F][[:xdigit:]]{3}-[[:xdigit:]]{4}-[[:xdigit:]]{12}"
namespace GParted namespace GParted
{ {

View File

@ -129,7 +129,7 @@ void reiserfs::read_uuid( Partition & partition )
{ {
if ( ! Utils::execute_command( "reiserfstune " + partition .get_path(), output, error, true ) ) if ( ! Utils::execute_command( "reiserfstune " + partition .get_path(), output, error, true ) )
{ {
partition .uuid = Utils::regexp_label( output, "^UUID:[[:blank:]]*([^[:space:]]*)" ) ; partition .uuid = Utils::regexp_label( output, "^UUID:[[:blank:]]*(" RFC4122_NONE_NIL_UUID_REGEXP ")" ) ;
} }
else else
{ {