]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: export PTMAGIC also if only PTTYPE requested
authorKarel Zak <kzak@redhat.com>
Tue, 15 Nov 2011 11:49:31 +0000 (12:49 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 15 Nov 2011 11:49:31 +0000 (12:49 +0100)
Reported-by: David Zeuthen <davidz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/gpt.c
libblkid/src/partitions/ultrix.c

index bee6e26f4d8489e06530f98c761de214e26fd2e3..0e44f6e8294ca24ce725c82551c7b2ef0f86f66d 100644 (file)
@@ -315,6 +315,10 @@ static int probe_gpt_pt(blkid_probe pr,
 
        blkid_probe_use_wiper(pr, lba * blkid_probe_get_size(pr), 8);
 
+       blkid_probe_set_magic(pr, lba << 9,
+                             sizeof(GPT_HEADER_SIGNATURE_STR) - 1,
+                             (unsigned char *) GPT_HEADER_SIGNATURE_STR);
+
        if (blkid_partitions_need_typeonly(pr))
                /* caller does not ask for details about partitions */
                return 0;
@@ -327,10 +331,6 @@ static int probe_gpt_pt(blkid_probe pr,
        if (!tab)
                goto err;
 
-       blkid_probe_set_magic(pr, lba << 9,
-                             sizeof(GPT_HEADER_SIGNATURE_STR) - 1,
-                             (unsigned char *) GPT_HEADER_SIGNATURE_STR);
-
        ssf = blkid_probe_get_sectorsize(pr) / 512;
 
        fu = le64_to_cpu(h->first_usable_lba);
index dd18fe3dac2dfe39b7f9f7b5d40731ab340c9169..fb195f646b0c2f60c1093f3b8f30b62dcfcb835c 100644 (file)
@@ -52,6 +52,10 @@ static int probe_ultrix_pt(blkid_probe pr,
        if (l->pt_magic != ULTRIX_MAGIC || l->pt_valid != 1)
                goto nothing;
 
+       blkid_probe_set_magic(pr, (ULTRIX_SECTOR << 9) + ULTRIX_OFFSET,
+                       sizeof(ULTRIX_MAGIC_STR) - 1,
+                       (unsigned char *) ULTRIX_MAGIC_STR);
+
        if (blkid_partitions_need_typeonly(pr))
                /* caller does not ask for details about partitions */
                return 0;
@@ -64,10 +68,6 @@ static int probe_ultrix_pt(blkid_probe pr,
        if (!tab)
                goto err;
 
-       blkid_probe_set_magic(pr, (ULTRIX_SECTOR << 9) + ULTRIX_OFFSET,
-                       sizeof(ULTRIX_MAGIC_STR) - 1,
-                       (unsigned char *) ULTRIX_MAGIC_STR);
-
        for (i = 0; i < ULTRIX_MAXPARTITIONS; i++) {
                if (!l->pt_part[i].pi_nblocks)
                         blkid_partlist_increment_partno(ls);