return -1;
if (blkid_probe_sprintf_version(pr, "%u", ad->resver) != 0)
return -1;
-
+ if (blkid_probe_set_magic(pr, off, sizeof(ad->b0idcode),
+ (unsigned char *) &ad->b0idcode))
+ return -1;
return 0;
}
int i;
struct ddf_header *ddf = NULL;
char version[DDF_REV_LENGTH + 1];
+ uint64_t off;
if (pr->size < 0x30000)
return -1;
for (i = 0; i < ARRAY_SIZE(hdrs); i++) {
- uint64_t off = ((pr->size / 0x200) - hdrs[i]) * 0x200;
+ off = ((pr->size / 0x200) - hdrs[i]) * 0x200;
ddf = (struct ddf_header *) blkid_probe_get_buffer(pr,
off,
if (blkid_probe_set_version(pr, version) != 0)
return -1;
+ if (blkid_probe_set_magic(pr, off,
+ sizeof(ddf->signature),
+ (unsigned char *) ddf->signature))
+ return -1;
return 0;
}
#include <errno.h>
#include <ctype.h>
#include <inttypes.h>
+#include <stddef.h>
#include "superblocks.h"
return -1;
md = (struct md_on_disk_08 *)
- blkid_probe_get_buffer(pr,
- off,
- sizeof(struct md_on_disk_08));
+ blkid_probe_get_buffer(pr,
+ off,
+ sizeof(struct md_on_disk_08));
if (!md)
return -1;
blkid_probe_set_version(pr, "v08");
+ if (blkid_probe_set_magic(pr,
+ off + offsetof(struct md_on_disk_08, magic),
+ sizeof(md->magic),
+ (unsigned char *) &md->magic))
+ return -1;
+
return 0;
}
magic = le32_to_cpu(hpt->magic);
if (magic != HPT45X_MAGIC_OK && magic != HPT45X_MAGIC_BAD)
return -1;
+ if (blkid_probe_set_magic(pr, off, sizeof(hpt->magic),
+ (unsigned char *) &hpt->magic))
+ return -1;
return 0;
}
if (blkid_probe_sprintf_version(pr, "%6s",
&isw->sig[sizeof(ISW_SIGNATURE)-1]) != 0)
return -1;
-
+ if (blkid_probe_set_magic(pr, off, sizeof(isw->sig),
+ (unsigned char *) isw->sig))
+ return -1;
return 0;
}
if (blkid_probe_sprintf_version(pr, "%u.%u",
jm->major_version, jm->minor_version) != 0)
return -1;
-
+ if (blkid_probe_set_magic(pr, off, sizeof(jm->signature),
+ (unsigned char *) jm->signature))
+ return -1;
return 0;
}
if (blkid_probe_set_uuid(pr, (unsigned char *) uuid.bytes) != 0)
return -1;
-
+ if (blkid_probe_set_magic(pr, off, sizeof(mdp0->md_magic),
+ (unsigned char *) &mdp0->md_magic))
+ return -1;
return 0;
}
if (blkid_probe_set_label(pr, mdp1->set_name,
sizeof(mdp1->set_name)) != 0)
return -1;
-
+ if (blkid_probe_set_magic(pr, off, sizeof(mdp1->magic),
+ (unsigned char *) &mdp1->magic))
+ return -1;
return 0;
}
if (memcmp(lsi->sig, LSI_SIGNATURE, sizeof(LSI_SIGNATURE)-1) != 0)
return -1;
-
+ if (blkid_probe_set_magic(pr, off, sizeof(lsi->sig),
+ (unsigned char *) lsi->sig))
+ return -1;
return 0;
}
if (memcmp(nv->vendor, NVIDIA_SIGNATURE, sizeof(NVIDIA_SIGNATURE)-1) != 0)
return -1;
-
if (blkid_probe_sprintf_version(pr, "%u", le16_to_cpu(nv->version)) != 0)
return -1;
-
+ if (blkid_probe_set_magic(pr, off, sizeof(nv->vendor),
+ (unsigned char *) nv->vendor))
+ return -1;
return 0;
}
return -1;
if (memcmp(pdc->sig, PDC_SIGNATURE,
- sizeof(PDC_SIGNATURE) - 1) == 0)
+ sizeof(PDC_SIGNATURE) - 1) == 0) {
+
+ if (blkid_probe_set_magic(pr, off, sizeof(pdc->sig),
+ (unsigned char *) pdc->sig))
+ return -1;
return 0;
+ }
}
return -1;
}
#include <errno.h>
#include <ctype.h>
#include <stdint.h>
+#include <stddef.h>
#include "superblocks.h"
le16_to_cpu(sil->major_ver),
le16_to_cpu(sil->minor_ver)) != 0)
return -1;
-
+ if (blkid_probe_set_magic(pr,
+ off + offsetof(struct silicon_metadata, magic),
+ sizeof(sil->magic),
+ (unsigned char *) &sil->magic))
+ return -1;
return 0;
}
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
+#include <stddef.h>
#include "superblocks.h"
if (sb->s_magic == cpu_to_le32(0xfd187e20) ||
sb->s_magic == cpu_to_be32(0xfd187e20)) {
- blkid_probe_set_label(pr, sb->s_fname, sizeof(sb->s_fname));
+
+ if (blkid_probe_set_label(pr, sb->s_fname,
+ sizeof(sb->s_fname)))
+ return -1;
+
+ if (blkid_probe_set_magic(pr,
+ off + offsetof(struct sysv_super_block,
+ s_magic),
+ sizeof(sb->s_magic),
+ (unsigned char *) &sb->s_magic))
+ return -1;
+
return 0;
}
}
#include <errno.h>
#include <ctype.h>
#include <stdint.h>
+#include <stddef.h>
#include "superblocks.h"
} else
blkid_probe_set_version(pr, "1");
+ if (blkid_probe_set_magic(pr,
+ (offsets[i] * 1024) +
+ offsetof(struct ufs_super_block, fs_magic),
+ sizeof(ufs->fs_magic),
+ (unsigned char *) &ufs->fs_magic))
+ return -1;
+
return 0;
}
return -1;
if (blkid_probe_sprintf_version(pr, "%u", v->version_number) != 0)
return -1;
+ if (blkid_probe_set_magic(pr, off,
+ sizeof(v->signature),
+ (unsigned char *) &v->signature))
+ return -1;
return 0;
}
zfs_extract_guid_name(pr, offset);
+ if (blkid_probe_set_magic(pr, offset,
+ sizeof(ub->ub_magic),
+ (unsigned char *) &ub->ub_magic))
+ return -1;
+
return 0;
}