From 7bb4eaf46dc3dd63f3549770a9993eed3377475e Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Date: Tue, 8 Jan 2008 17:33:06 +0100 Subject: [PATCH] Little improves to image reading. --- demo/iso_read.c | 2 +- src/fs_image.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/demo/iso_read.c b/demo/iso_read.c index e70fbd8..bbc63c7 100644 --- a/demo/iso_read.c +++ b/demo/iso_read.c @@ -119,7 +119,7 @@ int main(int argc, char **argv) 0, /* preferjoliet */ 0, /* uid; */ 0, /* gid; */ - 0, /* mode */ + 0444, /* mode */ NULL /* input_charset */ }; diff --git a/src/fs_image.c b/src/fs_image.c index 552bc21..5a3c407 100644 --- a/src/fs_image.c +++ b/src/fs_image.c @@ -734,7 +734,17 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent, return ISO_UNSUPPORTED_ECMA119; } - //TODO check for unsupported extended attribs? + /* + * Check for extended attributes, that are not supported. Note that even + * if we don't support them, it is easy to ignore them. + */ + if (record->len_xa[0]) { + iso_msg_fatal(fsdata->messenger, LIBISO_IMG_UNSUPPORTED, + "Unsupported image. This image has at least one file with " + "Extended Attributes, that are not supported"); + return ISO_UNSUPPORTED_ECMA119; + } + //TODO check for other flags? /* @@ -942,7 +952,15 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent, /* remove trailing version number */ len = strlen(name); if (len > 2 && name[len-2] == ';' && name[len-1] == '1') { - name[len-2] = '\0'; + if (len > 3 && name[len-3] == '.') { + /* + * the "." is mandatory, so in most cases is included only + * for standard compliance + */ + name[len-3] = '\0'; + } else { + name[len-2] = '\0'; + } } } }