diff options
Diffstat (limited to 'shlibs/blkid')
-rw-r--r-- | shlibs/blkid/src/cache.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/adaptec_raid.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/cramfs.c | 4 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/ext.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/gfs.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/hpfs.c | 6 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/iso9660.c | 4 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/luks.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/ntfs.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/nvidia_raid.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/reiserfs.c | 4 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/romfs.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/silicon_raid.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/squashfs.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/swap.c | 4 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/sysv.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/udf.c | 18 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/ufs.c | 11 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/vfat.c | 19 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/via_raid.c | 4 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/xfs.c | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/probers/zfs.c | 2 |
22 files changed, 56 insertions, 44 deletions
diff --git a/shlibs/blkid/src/cache.c b/shlibs/blkid/src/cache.c index acdf96dd..19941ff0 100644 --- a/shlibs/blkid/src/cache.c +++ b/shlibs/blkid/src/cache.c @@ -110,7 +110,7 @@ char *blkid_get_cache_filename(struct blkid_config *conf) else { struct blkid_config *c = blkid_read_config(NULL); if (!c) - filename = blkid_strdup(BLKID_CONFIG_FILE); + filename = blkid_strdup(BLKID_CACHE_FILE); else { filename = c->cachefile; /* already allocated */ c->cachefile = NULL; diff --git a/shlibs/blkid/src/probers/adaptec_raid.c b/shlibs/blkid/src/probers/adaptec_raid.c index 5e8b3a75..fd1fc718 100644 --- a/shlibs/blkid/src/probers/adaptec_raid.c +++ b/shlibs/blkid/src/probers/adaptec_raid.c @@ -67,7 +67,7 @@ struct adaptec_metadata { uint32_t raidtbl; uint16_t raidline; uint8_t res9[0xF6]; -}; +} __attribute__((packed)); #define AD_SIGNATURE "DPTM" #define AD_MAGIC 0x37FC4D1E diff --git a/shlibs/blkid/src/probers/cramfs.c b/shlibs/blkid/src/probers/cramfs.c index 0ea124b3..428ef501 100644 --- a/shlibs/blkid/src/probers/cramfs.c +++ b/shlibs/blkid/src/probers/cramfs.c @@ -30,9 +30,9 @@ struct cramfs_super uint32_t edition; uint32_t blocks; uint32_t files; - } info; + } __attribute__((packed)) info; uint8_t name[16]; -}; +} __attribute__((packed)); static int probe_cramfs(blkid_probe pr, const struct blkid_idmag *mag) { diff --git a/shlibs/blkid/src/probers/ext.c b/shlibs/blkid/src/probers/ext.c index c27411d2..26490f3a 100644 --- a/shlibs/blkid/src/probers/ext.c +++ b/shlibs/blkid/src/probers/ext.c @@ -76,7 +76,7 @@ struct ext2_super_block { uint64_t s_mmp_block; uint32_t s_raid_stripe_width; uint32_t s_reserved[163]; -}; +} __attribute__((packed)); /* magic string */ #define EXT_SB_MAGIC "\123\357" diff --git a/shlibs/blkid/src/probers/gfs.c b/shlibs/blkid/src/probers/gfs.c index 584561cf..c716643b 100644 --- a/shlibs/blkid/src/probers/gfs.c +++ b/shlibs/blkid/src/probers/gfs.c @@ -56,7 +56,7 @@ struct gfs2_sb { struct gfs2_inum __pad3; /* Was quota inode in gfs1 */ struct gfs2_inum __pad4; /* Was licence inode in gfs1 */ uint8_t sb_uuid[16]; /* The UUID maybe 0 for backwards compat */ -}; +} __attribute__((packed)); static int probe_gfs(blkid_probe pr, const struct blkid_idmag *mag) { diff --git a/shlibs/blkid/src/probers/hpfs.c b/shlibs/blkid/src/probers/hpfs.c index 2f5f0d19..9e1219c4 100644 --- a/shlibs/blkid/src/probers/hpfs.c +++ b/shlibs/blkid/src/probers/hpfs.c @@ -39,20 +39,20 @@ struct hpfs_boot_block uint8_t sig_hpfs[8]; uint8_t pad[448]; uint8_t magic[2]; -}; +} __attribute__((packed)); struct hpfs_super_block { uint8_t magic[4]; uint8_t magic1[4]; uint8_t version; -}; +} __attribute__((packed)); struct hpfs_spare_super { uint8_t magic[4]; uint8_t magic1[4]; -}; +} __attribute__((packed)); #define HPFS_SB_OFFSET 0x2000 diff --git a/shlibs/blkid/src/probers/iso9660.c b/shlibs/blkid/src/probers/iso9660.c index 1ebcccf0..16d232ae 100644 --- a/shlibs/blkid/src/probers/iso9660.c +++ b/shlibs/blkid/src/probers/iso9660.c @@ -30,7 +30,7 @@ struct iso_volume_descriptor { unsigned char unused[8]; unsigned char space_size[8]; unsigned char escape_sequences[8]; -}; +} __attribute__((packed)); #define ISO_SUPERBLOCK_OFFSET 0x8000 #define ISO_SECTOR_SIZE 0x800 @@ -47,7 +47,7 @@ struct high_sierra_volume_descriptor { unsigned char unused1; unsigned char system_id[32]; unsigned char volume_id[32]; -}; +} __attribute__((packed)); /* returns 1 if the begin of @ascii is equal to @utf16 string. */ diff --git a/shlibs/blkid/src/probers/luks.c b/shlibs/blkid/src/probers/luks.c index 2fe4ff3b..5e5f4ff3 100644 --- a/shlibs/blkid/src/probers/luks.c +++ b/shlibs/blkid/src/probers/luks.c @@ -37,7 +37,7 @@ struct luks_phdr { uint8_t mkDigestSalt[LUKS_SALTSIZE]; uint32_t mkDigestIterations; uint8_t uuid[UUID_STRING_L]; -}; +} __attribute__((packed)); static int probe_luks(blkid_probe pr, const struct blkid_idmag *mag) { diff --git a/shlibs/blkid/src/probers/ntfs.c b/shlibs/blkid/src/probers/ntfs.c index 55a186a3..8d183c68 100644 --- a/shlibs/blkid/src/probers/ntfs.c +++ b/shlibs/blkid/src/probers/ntfs.c @@ -27,7 +27,7 @@ struct ntfs_super_block { uint8_t reserved2[3]; uint64_t volume_serial; uint16_t checksum; -}; +} __attribute__((packed)); struct master_file_table_record { uint32_t magic; diff --git a/shlibs/blkid/src/probers/nvidia_raid.c b/shlibs/blkid/src/probers/nvidia_raid.c index 76361763..8bdd2414 100644 --- a/shlibs/blkid/src/probers/nvidia_raid.c +++ b/shlibs/blkid/src/probers/nvidia_raid.c @@ -21,7 +21,7 @@ struct nv_metadata { uint32_t size; uint32_t chksum; uint16_t version; -}; +} __attribute__((packed)); #define NVIDIA_SIGNATURE "NVIDIA" diff --git a/shlibs/blkid/src/probers/reiserfs.c b/shlibs/blkid/src/probers/reiserfs.c index f9a46787..6d9e2b92 100644 --- a/shlibs/blkid/src/probers/reiserfs.c +++ b/shlibs/blkid/src/probers/reiserfs.c @@ -28,7 +28,7 @@ struct reiserfs_super_block { uint32_t rs_dummy4[5]; unsigned char rs_uuid[16]; char rs_label[16]; -}; +} __attribute__((packed)); struct reiser4_super_block { unsigned char rs4_magic[16]; @@ -36,7 +36,7 @@ struct reiser4_super_block { unsigned char rs4_uuid[16]; unsigned char rs4_label[16]; uint64_t rs4_dummy2; -}; +} __attribute__((packed)); static int probe_reiser(blkid_probe pr, const struct blkid_idmag *mag) { diff --git a/shlibs/blkid/src/probers/romfs.c b/shlibs/blkid/src/probers/romfs.c index b5c20ab7..e70db090 100644 --- a/shlibs/blkid/src/probers/romfs.c +++ b/shlibs/blkid/src/probers/romfs.c @@ -21,7 +21,7 @@ struct romfs_super_block { unsigned char ros_magic[8]; uint32_t ros_dummy1[2]; unsigned char ros_volume[16]; -}; +} __attribute__((packed)); static int probe_romfs(blkid_probe pr, const struct blkid_idmag *mag) { diff --git a/shlibs/blkid/src/probers/silicon_raid.c b/shlibs/blkid/src/probers/silicon_raid.c index a65d79a8..01adafa7 100644 --- a/shlibs/blkid/src/probers/silicon_raid.c +++ b/shlibs/blkid/src/probers/silicon_raid.c @@ -35,7 +35,7 @@ struct silicon_metadata { uint16_t vendor_id; uint16_t minor_ver; uint16_t major_ver; -}; +} __attribute__((packed)); #define SILICON_MAGIC 0x2F000000 diff --git a/shlibs/blkid/src/probers/squashfs.c b/shlibs/blkid/src/probers/squashfs.c index 74f53bfb..e83ca6d9 100644 --- a/shlibs/blkid/src/probers/squashfs.c +++ b/shlibs/blkid/src/probers/squashfs.c @@ -26,7 +26,7 @@ struct sqsh_super_block { uint32_t directory_table_start_2; uint16_t s_major; uint16_t s_minor; -}; +} __attribute__((packed)); static int probe_squashfs(blkid_probe pr, const struct blkid_idmag *mag) { diff --git a/shlibs/blkid/src/probers/swap.c b/shlibs/blkid/src/probers/swap.c index 86eb94c6..14f74aca 100644 --- a/shlibs/blkid/src/probers/swap.c +++ b/shlibs/blkid/src/probers/swap.c @@ -28,7 +28,7 @@ struct swap_header_v1_2 { unsigned char volume[16]; uint32_t padding[117]; uint32_t badpages[1]; -}; +} __attribute__((packed)); #define PAGESIZE_MIN 0xff6 /* 4086 (arm, i386, ...) */ #define PAGESIZE_MAX 0xfff6 /* 65526 (ia64) */ @@ -118,7 +118,7 @@ const struct blkid_idinfo swap_idinfo = const struct blkid_idinfo swsuspend_idinfo = { - .name = "swsupend", + .name = "swsuspend", .usage = BLKID_USAGE_OTHER, .probefunc = probe_swsuspend, .magics = diff --git a/shlibs/blkid/src/probers/sysv.c b/shlibs/blkid/src/probers/sysv.c index 933163a2..096d9e32 100644 --- a/shlibs/blkid/src/probers/sysv.c +++ b/shlibs/blkid/src/probers/sysv.c @@ -39,7 +39,7 @@ struct xenix_super_block { uint8_t s_fill[371]; uint32_t s_magic; uint32_t s_type; -}; +} __attribute__((packed)); #define SYSV_NICINOD 100 diff --git a/shlibs/blkid/src/probers/udf.c b/shlibs/blkid/src/probers/udf.c index 5f4046d6..42f7aa12 100644 --- a/shlibs/blkid/src/probers/udf.c +++ b/shlibs/blkid/src/probers/udf.c @@ -28,28 +28,32 @@ struct volume_descriptor { uint16_t crc; uint16_t crc_len; uint32_t location; - } tag; + } __attribute__((packed)) tag; + union { struct anchor_descriptor { uint32_t length; uint32_t location; - } anchor; + } __attribute__((packed)) anchor; + struct primary_descriptor { uint32_t seq_num; uint32_t desc_num; struct dstring { uint8_t clen; uint8_t c[31]; - } ident; - } primary; - } type; -}; + } __attribute__((packed)) ident; + } __attribute__((packed)) primary; + + } __attribute__((packed)) type; + +} __attribute__((packed)); struct volume_structure_descriptor { uint8_t type; uint8_t id[5]; uint8_t version; -}; +} __attribute__((packed)); #define UDF_VSD_OFFSET 0x8000 diff --git a/shlibs/blkid/src/probers/ufs.c b/shlibs/blkid/src/probers/ufs.c index fe9870d8..27f3533c 100644 --- a/shlibs/blkid/src/probers/ufs.c +++ b/shlibs/blkid/src/probers/ufs.c @@ -117,7 +117,7 @@ struct ufs_super_block { uint64_t fs_csaddr; int64_t fs_pendingblocks; int32_t fs_pendinginodes; - } fs_u2; + } __attribute__((packed)) fs_u2; } fs_u11; union { struct { @@ -153,17 +153,22 @@ struct ufs_super_block { int32_t fs_rotbloff; uint32_t fs_magic; uint8_t fs_space[1]; -}; +} __attribute__((packed)); #define UFS_MAGIC 0x00011954 #define UFS2_MAGIC 0x19540119 #define UFS_MAGIC_FEA 0x00195612 #define UFS_MAGIC_LFN 0x00095014 +#define UFS_MAGIC_SEC 0x00612195 +#define UFS_MAGIC_4GB 0x05231994 static int probe_ufs(blkid_probe pr, const struct blkid_idmag *mag) { int offsets[] = { 0, 8, 64, 256 }; - int mags[] = { UFS2_MAGIC, UFS_MAGIC, UFS_MAGIC_FEA, UFS_MAGIC_LFN }; + int mags[] = { + UFS2_MAGIC, UFS_MAGIC, UFS_MAGIC_FEA, UFS_MAGIC_LFN, + UFS_MAGIC_SEC, UFS_MAGIC_4GB + }; int i; uint32_t magic; struct ufs_super_block *ufs; diff --git a/shlibs/blkid/src/probers/vfat.c b/shlibs/blkid/src/probers/vfat.c index a83175c0..a70ccd9b 100644 --- a/shlibs/blkid/src/probers/vfat.c +++ b/shlibs/blkid/src/probers/vfat.c @@ -45,9 +45,9 @@ struct vfat_super_block { /* 43*/ unsigned char vs_serno[4]; /* 47*/ unsigned char vs_label[11]; /* 52*/ unsigned char vs_magic[8]; -/* 5a*/ unsigned char vs_dummy2[164]; -/*1fe*/ unsigned char vs_pmagic[2]; -}; +/* 5a*/ unsigned char vs_dummy2[0x1fe - 0x5a]; +/*1fe*/ unsigned char vs_pmagic[2]; +} __attribute__((packed)); /* Yucky misaligned values */ struct msdos_super_block { @@ -69,9 +69,9 @@ struct msdos_super_block { /* 27*/ unsigned char ms_serno[4]; /* 2b*/ unsigned char ms_label[11]; /* 36*/ unsigned char ms_magic[8]; -/* 3d*/ unsigned char ms_dummy2[192]; -/*1fe*/ unsigned char ms_pmagic[2]; -}; +/* 3e*/ unsigned char ms_dummy2[0x1fe - 0x3e]; +/*1fe*/ unsigned char ms_pmagic[2]; +} __attribute__((packed)); struct vfat_dir_entry { uint8_t name[11]; @@ -85,7 +85,7 @@ struct vfat_dir_entry { uint16_t date_write; uint16_t cluster_low; uint32_t size; -}; +} __attribute__((packed)); struct fat32_fsinfo { uint8_t signature1[4]; @@ -94,7 +94,7 @@ struct fat32_fsinfo { uint32_t free_clusters; uint32_t next_cluster; uint32_t reserved2[4]; -}; +} __attribute__((packed)); /* maximum number of clusters */ #define FAT12_MAX 0xFF4 @@ -143,6 +143,9 @@ static int probe_fat_nomagic(blkid_probe pr, const struct blkid_idmag *mag) if (!ms) return -1; + if (ms->ms_pmagic[0] != 0x55 || ms->ms_pmagic[1] != 0xAA) + return 1; + /* heads check */ if (ms->ms_heads == 0) return 1; diff --git a/shlibs/blkid/src/probers/via_raid.c b/shlibs/blkid/src/probers/via_raid.c index 22022fdd..d4237799 100644 --- a/shlibs/blkid/src/probers/via_raid.c +++ b/shlibs/blkid/src/probers/via_raid.c @@ -27,10 +27,10 @@ struct via_metadata { uint32_t capacity_low; uint32_t capacity_high; uint32_t serial_checksum; - } array; + } __attribute__((packed)) array; uint32_t serial_checksum[8]; uint8_t checksum; -}; +} __attribute__((packed)); #define VIA_SIGNATURE 0xAA55 diff --git a/shlibs/blkid/src/probers/xfs.c b/shlibs/blkid/src/probers/xfs.c index fa7914e2..c53dc39d 100644 --- a/shlibs/blkid/src/probers/xfs.c +++ b/shlibs/blkid/src/probers/xfs.c @@ -32,7 +32,7 @@ struct xfs_super_block { uint64_t xs_icount; uint64_t xs_ifree; uint64_t xs_fdblocks; -}; +} __attribute__((packed)); static int probe_xfs(blkid_probe pr, const struct blkid_idmag *mag) { diff --git a/shlibs/blkid/src/probers/zfs.c b/shlibs/blkid/src/probers/zfs.c index 7d39034f..11b1b000 100644 --- a/shlibs/blkid/src/probers/zfs.c +++ b/shlibs/blkid/src/probers/zfs.c @@ -24,7 +24,7 @@ struct zfs_uberblock { uint64_t ub_guid_sum; /* sum of all vdev guids */ uint64_t ub_timestamp; /* UTC time of last sync */ /*blkptr_t ub_rootbp;*/ /* MOS objset_phys_t */ -}; +} __attribute__((packed)); static int probe_zfs(blkid_probe pr, const struct blkid_idmag *mag) { |