Merge lp:~pali/ubuntu/precise/util-linux/bug-1164683 into lp:ubuntu/precise/util-linux

Proposed by Pali
Status: Approved
Approved by: Marc Deslauriers
Approved revision: 89
Proposed branch: lp:~pali/ubuntu/precise/util-linux/bug-1164683
Merge into: lp:ubuntu/precise/util-linux
Diff against target: 102 lines (+39/-17)
3 files modified
AUTHORS (+1/-0)
debian/changelog (+6/-0)
libblkid/src/superblocks/udf.c (+32/-17)
To merge this branch: bzr merge lp:~pali/ubuntu/precise/util-linux/bug-1164683
Reviewer Review Type Date Requested Status
Marc Deslauriers Approve
Review via email: mp+221227@code.launchpad.net

Description of the change

Correctly read udf label with blocksize < 2048 (LP: #1164683)

To post a comment you must log in.
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Looks good. ACK. Uploaded for processing by the SRU team. Thanks!

review: Approve

Unmerged revisions

89. By Pali

Correctly read udf label with blocksize < 2048 (LP: #1164683)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2011-12-16 22:53:42 +0000
+++ AUTHORS 2014-05-28 13:11:43 +0000
@@ -282,4 +282,5 @@
282 Yann Droneaud <yann@droneaud.fr>282 Yann Droneaud <yann@droneaud.fr>
283 Yoshihiro Takahashi <ytakahashi@miraclelinux.com>283 Yoshihiro Takahashi <ytakahashi@miraclelinux.com>
284 Yu Zhiguo <yuzg@cn.fujitsu.com>284 Yu Zhiguo <yuzg@cn.fujitsu.com>
285 Zachary Catlin <z@zc.is>
285 Zdenek Behan <rain@matfyz.cz>286 Zdenek Behan <rain@matfyz.cz>
286287
=== modified file 'debian/changelog'
--- debian/changelog 2012-03-30 04:22:22 +0000
+++ debian/changelog 2014-05-28 13:11:43 +0000
@@ -1,3 +1,9 @@
1util-linux (2.20.1-1ubuntu3.1) precise; urgency=low
2
3 * Correctly read udf label with blocksize < 2048 (LP: #1164683)
4
5 -- Pali Rohár <pali.rohar@gmail.com> Wed, 28 May 2014 15:06:34 +0200
6
1util-linux (2.20.1-1ubuntu3) precise; urgency=low7util-linux (2.20.1-1ubuntu3) precise; urgency=low
28
3 * Build-depend on gettext:any for cross-building support.9 * Build-depend on gettext:any for cross-building support.
410
=== modified file 'libblkid/src/superblocks/udf.c'
--- libblkid/src/superblocks/udf.c 2011-11-03 15:38:23 +0000
+++ libblkid/src/superblocks/udf.c 2014-05-28 13:11:43 +0000
@@ -63,17 +63,25 @@
63 struct volume_descriptor *vd;63 struct volume_descriptor *vd;
64 struct volume_structure_descriptor *vsd;64 struct volume_structure_descriptor *vsd;
65 unsigned int bs;65 unsigned int bs;
66 unsigned int pbs[2];
66 unsigned int b;67 unsigned int b;
67 unsigned int type;68 unsigned int type;
68 unsigned int count;69 unsigned int count;
69 unsigned int loc;70 unsigned int loc;
7071 unsigned int i;
71 /* search Volume Sequence Descriptor (VSD) to get the logical72
72 * block size of the volume */73 /* The block size of a UDF filesystem is that of the underlying
73 for (bs = 0x800; bs < 0x8000; bs += 0x800) {74 * storage; we check later on for the special case of image files,
75 * which may have the 2048-byte block size of optical media. */
76 pbs[0] = blkid_probe_get_sectorsize(pr);
77 pbs[1] = 0x800;
78
79 /* check for a Volume Structure Descriptor (VSD); each is
80 * 2048 bytes long */
81 for (b = 0; b < 0x8000; b += 0x800) {
74 vsd = (struct volume_structure_descriptor *)82 vsd = (struct volume_structure_descriptor *)
75 blkid_probe_get_buffer(pr,83 blkid_probe_get_buffer(pr,
76 UDF_VSD_OFFSET + bs,84 UDF_VSD_OFFSET + b,
77 sizeof(*vsd));85 sizeof(*vsd));
78 if (!vsd)86 if (!vsd)
79 return 1;87 return 1;
@@ -87,7 +95,7 @@
87 for (b = 0; b < 64; b++) {95 for (b = 0; b < 64; b++) {
88 vsd = (struct volume_structure_descriptor *)96 vsd = (struct volume_structure_descriptor *)
89 blkid_probe_get_buffer(pr,97 blkid_probe_get_buffer(pr,
90 UDF_VSD_OFFSET + ((blkid_loff_t) b * bs),98 UDF_VSD_OFFSET + ((blkid_loff_t) b * 0x800),
91 sizeof(*vsd));99 sizeof(*vsd));
92 if (!vsd)100 if (!vsd)
93 return -1;101 return -1;
@@ -101,17 +109,24 @@
101 return -1;109 return -1;
102110
103anchor:111anchor:
104 /* read Anchor Volume Descriptor (AVDP) */112 /* read Anchor Volume Descriptor (AVDP), checking block size */
105 vd = (struct volume_descriptor *)113 for (i = 0; i < 2; i++) {
106 blkid_probe_get_buffer(pr, 256 * bs, sizeof(*vd));114 vd = (struct volume_descriptor *)
107 if (!vd)115 blkid_probe_get_buffer(pr, 256 * pbs[i], sizeof(*vd));
108 return -1;116 if (!vd)
109117 return -1;
110 type = le16_to_cpu(vd->tag.id);118
111 if (type != 2) /* TAG_ID_AVDP */119 type = le16_to_cpu(vd->tag.id);
112 return 0;120 if (type == 2) /* TAG_ID_AVDP */
113121 goto real_blksz;
114 /* get desriptor list address and block count */122 }
123 return 0;
124
125real_blksz:
126 /* Use the actual block size from here on out */
127 bs = pbs[i];
128
129 /* get descriptor list address and block count */
115 count = le32_to_cpu(vd->type.anchor.length) / bs;130 count = le32_to_cpu(vd->type.anchor.length) / bs;
116 loc = le32_to_cpu(vd->type.anchor.location);131 loc = le32_to_cpu(vd->type.anchor.location);
117132

Subscribers

People subscribed via source and target branches

to all changes: