From 71cd3ccb891aeb2336821a46a0d3f63b36f4eaf1 Mon Sep 17 00:00:00 2001 From: Vreixo Formoso Date: Sat, 29 Dec 2007 16:34:17 +0100 Subject: [PATCH] Check access to file contents before adding it to public iso tree. --- src/stream.c | 6 ++++++ src/tree.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/stream.c b/src/stream.c index c828773..3d1c34f 100644 --- a/src/stream.c +++ b/src/stream.c @@ -159,6 +159,12 @@ int iso_file_source_stream_new(IsoFileSource *src, IsoStream **stream) if (S_ISDIR(info.st_mode)) { return ISO_FILE_IS_DIR; } + + /* check for read access to contents */ + r = iso_file_source_access(src); + if (r < 0) { + return r; + } str = malloc(sizeof(IsoStream)); if (str == NULL) { diff --git a/src/tree.c b/src/tree.c index a7c9f82..dae8221 100644 --- a/src/tree.c +++ b/src/tree.c @@ -462,8 +462,8 @@ int iso_add_dir_aux(IsoImage *image, IsoDir *parent, IsoFileSource *dir) result = builder->create_node(builder, image, file, &new); if (result < 0) { - iso_msg_debug(image, "Error %d when adding file %s", result, - iso_file_source_get_path(file)); + iso_msg_note(image, LIBISO_FILE_IGNORED, "Error %d when adding " + "file %s", result, iso_file_source_get_path(file)); if (image->recOpts->report) { action = image->recOpts->report(file, result, flag);