hal/hald/linux/volume_id volume_id.c, 1.45.2.3, 1.45.2.4 volume_id.h,
1.23.2.2, 1.23.2.3
Kay Sievers
kay at freedesktop.org
Tue Jan 11 18:05:33 PST 2005
Update of /cvs/hal/hal/hald/linux/volume_id
In directory gabe:/tmp/cvs-serv10348/linux/volume_id
Modified Files:
Tag: hal-0_4-stable-branch
volume_id.c volume_id.h
Log Message:
2005-01-12 Kay Sievers <kay.sievers at vrfy.org>
* hald/linux/volume_id/volume_id.c: (probe_iso9660): Patch from
Leon Breedt <bitserf at gmail.com> which fixes a bug with the recently
added joliet descriptor reading. Bug discovery and initial fix from
foser <foser at gentoo.org>.
* hald/linux/volume_id/volume_id.h: Next version.
Index: volume_id.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.c,v
retrieving revision 1.45.2.3
retrieving revision 1.45.2.4
diff -u -d -r1.45.2.3 -r1.45.2.4
--- volume_id.c 10 Jan 2005 16:12:29 -0000 1.45.2.3
+++ volume_id.c 12 Jan 2005 02:05:31 -0000 1.45.2.4
@@ -1251,10 +1251,14 @@
return -1;
if (strncmp(is->iso.id, "CD001", 5) == 0) {
+ char root_label[VOLUME_ID_LABEL_SIZE+1];
int vd_offset;
int i;
int found_svd;
+ memset(root_label, 0, sizeof(root_label));
+ strncpy(root_label, is->iso.volume_id, sizeof(root_label)-1);
+
found_svd = 0;
vd_offset = ISO_VD_OFFSET;
for (i = 0; i < ISO_VD_MAX; i++) {
@@ -1263,23 +1267,20 @@
if (is == NULL || is->iso.type == ISO_VD_END)
break;
if (is->iso.type == ISO_VD_SUPPLEMENTARY) {
- dbg("found ISO supplementary VD at offset 0x%x", off + vd_offset);
+ dbg("found ISO supplementary VD at offset 0x%llx", off + vd_offset);
+ set_label_raw(id, is->iso.volume_id, 32);
+ set_label_unicode16(id, is->iso.volume_id, BE, 32);
found_svd = 1;
break;
}
vd_offset += ISO_SECTOR_SIZE;
}
- if (!found_svd) {
- is = (union iso_super_block *)
- get_buffer(id, off + ISO_SUPERBLOCK_OFFSET, 0x200);
- if (is == NULL)
- return -1;
- set_label_raw(id, is->iso.volume_id, 32);
- set_label_string(id, is->iso.volume_id, 32);
- } else {
- set_label_raw(id, is->iso.volume_id, 32);
- set_label_unicode16(id, is->iso.volume_id, BE, 32);
+ if (!found_svd ||
+ (found_svd && !strncmp(root_label, id->label, 16)))
+ {
+ set_label_raw(id, root_label, 32);
+ set_label_string(id, root_label, 32);
}
goto found;
}
Index: volume_id.h
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.h,v
retrieving revision 1.23.2.2
retrieving revision 1.23.2.3
diff -u -d -r1.23.2.2 -r1.23.2.3
--- volume_id.h 10 Jan 2005 16:12:29 -0000 1.23.2.2
+++ volume_id.h 12 Jan 2005 02:05:31 -0000 1.23.2.3
@@ -21,7 +21,7 @@
#ifndef _VOLUME_ID_H_
#define _VOLUME_ID_H_
-#define VOLUME_ID_VERSION 27
+#define VOLUME_ID_VERSION 28
#define VOLUME_ID_LABEL_SIZE 64
#define VOLUME_ID_UUID_SIZE 16
More information about the hal-commit
mailing list