Browse Source

Replace per Image messenger with a global one, and use image id instead.

release-1.5.4.branch
Vreixo Formoso 14 years ago
parent
commit
df5aa263ec
  1. 4
      demo/ecma119_tree.c
  2. 9
      demo/iso.c
  3. 6
      demo/iso_grow.c
  4. 7
      demo/iso_modify.c
  5. 5
      demo/iso_ms.c
  6. 15
      demo/iso_read.c
  7. 8
      demo/tree.c
  8. 35
      src/ecma119.c
  9. 20
      src/ecma119_tree.c
  10. 16
      src/eltorito.c
  11. 10
      src/filesrc.c
  12. 109
      src/fs_image.c
  13. 3
      src/fs_image.h
  14. 14
      src/image.c
  15. 4
      src/image.h
  16. 25
      src/iso1999.c
  17. 28
      src/joliet.c
  18. 31
      src/libisofs.h
  19. 79
      src/messages.c
  20. 18
      src/messages.h
  21. 2
      src/rockridge.c
  22. 3
      src/rockridge.h
  23. 11
      src/rockridge_read.c
  24. 15
      src/tree.c

4
demo/ecma119_tree.c

@ -94,12 +94,13 @@ int main(int argc, char **argv)
return 1;
}
iso_init();
iso_set_msgs_severities("NEVER", "ALL", "");
result = iso_image_new("volume_id", &image);
if (result < 0) {
printf ("Error creating image\n");
return 1;
}
iso_image_set_msgs_severities(image, "NEVER", "ALL", "");
result = iso_tree_add_dir_rec(image, iso_image_get_root(image), argv[1]);
if (result < 0) {
@ -130,5 +131,6 @@ int main(int argc, char **argv)
free(ecma119->input_charset);
free(ecma119);
iso_image_unref(image);
iso_finish();
return 0;
}

9
demo/iso.c

@ -126,13 +126,19 @@ int main(int argc, char **argv)
if (!fd) {
err(1, "error opening output file");
}
result = iso_init();
if (result < 0) {
printf ("Can't initialize libisofs\n");
return 1;
}
iso_set_msgs_severities("NEVER", "ALL", "");
result = iso_image_new(volid, &image);
if (result < 0) {
printf ("Error creating image\n");
return 1;
}
iso_image_set_msgs_severities(image, "NEVER", "ALL", "");
iso_tree_set_follow_symlinks(image, 0);
iso_tree_set_ignore_hidden(image, 0);
iso_tree_set_ignore_special(image, 0);
@ -171,5 +177,6 @@ int main(int argc, char **argv)
free(burn_src);
iso_image_unref(image);
iso_finish();
return 0;
}

6
demo/iso_grow.c

@ -64,6 +64,7 @@ int main(int argc, char **argv)
0, /* block */
0, /* norock */
0, /* nojoliet */
0, /* noiso1999 */
0, /* preferjoliet */
0, /* uid; */
0, /* gid; */
@ -75,6 +76,9 @@ int main(int argc, char **argv)
usage(argv);
return 1;
}
iso_init();
iso_set_msgs_severities("NEVER", "ALL", "");
/* create the image context */
result = iso_image_new("volume_id", &image);
@ -82,7 +86,6 @@ int main(int argc, char **argv)
printf ("Error creating image\n");
return 1;
}
iso_image_set_msgs_severities(image, "NEVER", "ALL", "");
iso_tree_set_follow_symlinks(image, 0);
iso_tree_set_ignore_hidden(image, 0);
iso_tree_set_stop_on_error(image, 0);
@ -214,6 +217,7 @@ int main(int argc, char **argv)
exit_cleanup:;
burn_drive_release(drives[0].drive, 0);
burn_finish();
iso_finish();
exit(ret);
}

7
demo/iso_modify.c

@ -31,6 +31,7 @@ int main(int argc, char **argv)
1, /* level */
1, /* rockridge */
0, /* joliet */
0, /* iso1999 */
0, /* omit_version_numbers */
0, /* allow_deep_paths */
0, /* allow_longer_paths */
@ -58,6 +59,7 @@ int main(int argc, char **argv)
0, /* block */
0, /* norock */
0, /* nojoliet */
0, /* noiso1999 */
0, /* preferjoliet */
0, /* uid; */
0, /* gid; */
@ -74,6 +76,9 @@ int main(int argc, char **argv)
if (!fd) {
err(1, "error opening output file");
}
iso_init();
iso_set_msgs_severities("NEVER", "ALL", "");
/* create the data source to accesss previous image */
result = iso_data_source_new_from_file(argv[1], &src);
@ -88,7 +93,6 @@ int main(int argc, char **argv)
printf ("Error creating image\n");
return 1;
}
iso_image_set_msgs_severities(image, "NEVER", "ALL", "");
iso_tree_set_follow_symlinks(image, 0);
iso_tree_set_ignore_hidden(image, 0);
iso_tree_set_stop_on_error(image, 0);
@ -123,5 +127,6 @@ int main(int argc, char **argv)
free(burn_src);
iso_image_unref(image);
iso_finish();
return 0;
}

5
demo/iso_ms.c

@ -76,6 +76,9 @@ int main(int argc, char **argv)
if (!fd) {
err(1, "error opening output file");
}
iso_init();
iso_set_msgs_severities("NEVER", "ALL", "");
/* create the data source to accesss previous image */
result = iso_data_source_new_from_file(argv[3], &src);
@ -90,7 +93,6 @@ int main(int argc, char **argv)
printf ("Error creating image\n");
return 1;
}
iso_image_set_msgs_severities(image, "NEVER", "ALL", "");
iso_tree_set_follow_symlinks(image, 0);
iso_tree_set_ignore_hidden(image, 0);
iso_tree_set_stop_on_error(image, 0);
@ -128,5 +130,6 @@ int main(int argc, char **argv)
free(burn_src);
iso_image_unref(image);
iso_finish();
return 0;
}

15
demo/iso_read.c

@ -10,7 +10,6 @@
#include <string.h>
#include <limits.h>
#include "messages.h"
#include "libisofs.h"
#include "fs_image.h"
@ -111,7 +110,6 @@ int main(int argc, char **argv)
IsoImageFilesystem *fs;
IsoDataSource *src;
IsoFileSource *root;
struct libiso_msgs *messenger;
struct iso_read_opts opts = {
0, /* block */
0, /* norock */
@ -129,13 +127,8 @@ int main(int argc, char **argv)
return 1;
}
result = libiso_msgs_new(&messenger, 0);
if (result <= 0) {
printf ("Can't create messenger\n");
return 1;
}
libiso_msgs_set_severities(messenger, LIBISO_MSGS_SEV_NEVER,
LIBISO_MSGS_SEV_ALL, "", 0);
iso_init();
iso_set_msgs_severities("NEVER", "ALL", "");
result = iso_data_source_new_from_file(argv[1], &src);
if (result < 0) {
@ -143,7 +136,7 @@ int main(int argc, char **argv)
return 1;
}
result = iso_image_filesystem_new(src, &opts, messenger, &fs);
result = iso_image_filesystem_new(src, &opts, 1, &fs);
if (result < 0) {
printf ("Error creating filesystem\n");
return 1;
@ -176,6 +169,6 @@ int main(int argc, char **argv)
fs->close(fs);
iso_filesystem_unref((IsoFilesystem*)fs);
iso_data_source_unref(src);
libiso_msgs_destroy(&messenger, 0);
iso_finish();
return 0;
}

8
demo/tree.c

@ -4,6 +4,7 @@
#include "libisofs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -35,7 +36,7 @@ print_dir(IsoDir *dir, int level)
int i;
IsoDirIter *iter;
IsoNode *node;
char sp[level * 2 + 1];
char *sp = alloca(level * 2 + 1);
for (i = 0; i < level * 2; i += 2) {
sp[i] = '|';
@ -80,14 +81,15 @@ int main(int argc, char **argv)
printf ("You need to specify a valid path\n");
return 1;
}
iso_init();
iso_set_msgs_severities("NEVER", "ALL", "");
result = iso_image_new("volume_id", &image);
if (result < 0) {
printf ("Error creating image\n");
return 1;
}
iso_image_set_msgs_severities(image, "NEVER", "ALL", "");
result = iso_tree_add_dir_rec(image, iso_image_get_root(image), argv[1]);
if (result < 0) {

35
src/ecma119.c

@ -202,13 +202,12 @@ int ecma119_writer_compute_data_blocks(IsoImageWriter *writer)
target = writer->target;
/* compute position of directories */
iso_msg_debug(target->image->messenger,
"Computing position of dir structure");
iso_msg_debug(target->image->id, "Computing position of dir structure");
target->ndirs = 0;
calc_dir_pos(target, target->root);
/* compute length of pathlist */
iso_msg_debug(target->image->messenger, "Computing length of pathlist");
iso_msg_debug(target->image->id, "Computing length of pathlist");
path_table_size = calc_path_table_size(target->root);
/* compute location for path tables */
@ -313,7 +312,7 @@ int ecma119_writer_write_vol_desc(IsoImageWriter *writer)
t = writer->target;
image = t->image;
iso_msg_debug(image->messenger, "Write Primary Volume Descriptor");
iso_msg_debug(image->id, "Write Primary Volume Descriptor");
memset(&vol, 0, sizeof(struct ecma119_pri_vol_desc));
@ -550,7 +549,7 @@ int write_path_tables(Ecma119Image *t)
size_t i, j, cur;
Ecma119Node **pathlist;
iso_msg_debug(t->image->messenger, "Writing ISO Path tables");
iso_msg_debug(t->image->id, "Writing ISO Path tables");
/* allocate temporal pathlist */
pathlist = malloc(sizeof(void*) * t->ndirs);
@ -638,8 +637,7 @@ int ecma119_writer_create(Ecma119Image *target)
/* add this writer to image */
target->writers[target->nwriters++] = writer;
iso_msg_debug(target->image->messenger,
"Creating low level ECMA-119 tree...");
iso_msg_debug(target->image->id, "Creating low level ECMA-119 tree...");
ret = ecma119_tree_create(target);
if (ret < 0) {
return ret;
@ -740,7 +738,7 @@ void *write_function(void *arg)
IsoImageWriter *writer;
Ecma119Image *target = (Ecma119Image*)arg;
iso_msg_debug(target->image->messenger, "Starting image writing...");
iso_msg_debug(target->image->id, "Starting image writing...");
target->bytes_written = (off_t) 0;
target->percent_written = 0;
@ -755,7 +753,7 @@ void *write_function(void *arg)
}
/* write volume descriptors, one per writer */
iso_msg_debug(target->image->messenger, "Write volume descriptors");
iso_msg_debug(target->image->id, "Write volume descriptors");
for (i = 0; i < target->nwriters; ++i) {
writer = target->writers[i];
res = writer->write_vol_desc(writer);
@ -792,7 +790,7 @@ void *write_function(void *arg)
pthread_exit(NULL);
write_error: ;
iso_msg_fatal(target->image->messenger, LIBISO_WRITE_ERROR,
iso_msg_fatal(target->image->id, LIBISO_WRITE_ERROR,
"Image write error, code %d", res);
iso_ring_buffer_writer_close(target->buffer, 1);
pthread_exit(NULL);
@ -997,7 +995,7 @@ int ecma119_image_new(IsoImage *src, Ecma119WriteOpts *opts, Ecma119Image **img)
writer = target->writers[i];
ret = writer->write_vol_desc(writer);
if (ret < 0) {
iso_msg_debug(target->image->messenger,
iso_msg_debug(target->image->id,
"Error writing overwrite volume descriptors");
goto target_cleanup;
}
@ -1010,7 +1008,7 @@ int ecma119_image_new(IsoImage *src, Ecma119WriteOpts *opts, Ecma119Image **img)
/* copy the volume descriptors to the overwrite buffer... */
ret = iso_ring_buffer_read(target->buffer, buf, voldesc_size);
if (ret < 0) {
iso_msg_debug(target->image->messenger,
iso_msg_debug(target->image->id,
"Error reading overwrite volume descriptors");
goto target_cleanup;
}
@ -1039,7 +1037,7 @@ int ecma119_image_new(IsoImage *src, Ecma119WriteOpts *opts, Ecma119Image **img)
ret = pthread_create(&(target->wthread), &(target->th_attr),
write_function, (void *) target);
if (ret != 0) {
iso_msg_fatal(target->image->messenger, LIBISO_THREAD_ERROR,
iso_msg_fatal(target->image->id, LIBISO_THREAD_ERROR,
"Cannot create writer thread");
ret = ISO_THREAD_ERROR;
goto target_cleanup;
@ -1070,8 +1068,7 @@ static int bs_read(struct burn_source *bs, unsigned char *buf, int size)
return size;
} else if (ret < 0) {
/* error */
iso_msg_fatal(t->image->messenger, LIBISO_READ_ERROR,
"Error reading buffer");
iso_msg_fatal(t->image->id, LIBISO_READ_ERROR, "Error reading buffer");
return -1;
} else {
/* EOF */
@ -1095,8 +1092,8 @@ static void bs_free_data(struct burn_source *bs)
/* wait until writer thread finishes */
pthread_join(target->wthread, NULL);
iso_msg_debug(target->image->messenger, "Writer thread joined");
iso_msg_debug(target->image->messenger,
iso_msg_debug(target->image->id, "Writer thread joined");
iso_msg_debug(target->image->id,
"Ring buffer was %d times full and %d times empty",
iso_ring_buffer_get_times_full(target->buffer),
iso_ring_buffer_get_times_empty(target->buffer));
@ -1174,8 +1171,8 @@ int iso_write(Ecma119Image *target, void *buf, size_t count)
/* only report in 5% chunks */
if (percent >= target->percent_written + 5) {
iso_msg_debug(target->image->messenger,
"Processed %u of %u KB (%d %%)", kbw, kbt, percent);
iso_msg_debug(target->image->id, "Processed %u of %u KB (%d %%)",
kbw, kbt, percent);
target->percent_written = percent;
}
}

20
src/ecma119_tree.c

@ -35,7 +35,7 @@ int get_iso_name(Ecma119Image *img, IsoNode *iso, char **name)
ret = str2ascii(img->input_charset, iso->name, &ascii_name);
if (ret < 0) {
iso_msg_debug(img->image->messenger, "Can't convert %s", iso->name);
iso_msg_debug(img->image->id, "Can't convert %s", iso->name);
return ret;
}
@ -163,7 +163,7 @@ int create_file(Ecma119Image *img, IsoFile *iso, Ecma119Node **node)
size = iso_stream_get_size(iso->stream);
if (size > (off_t)0xffffffff) {
iso_msg_note(img->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(img->image->id, LIBISO_FILE_IGNORED,
"File \"%s\" can't be added to image because is "
"greater than 4GB", iso->node.name);
return 0;
@ -298,13 +298,13 @@ int create_tree(Ecma119Image *image, IsoNode *iso, Ecma119Node **tree,
max_path = pathlen + 1 + (iso_name ? strlen(iso_name) : 0);
if (!image->rockridge) {
if ((iso->type == LIBISO_DIR && depth > 8) && !image->allow_deep_paths) {
iso_msg_note(image->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(image->image->id, LIBISO_FILE_IGNORED,
"File \"%s\" can't be added, because directory depth "
"is greater than 8.", iso->name);
free(iso_name);
return 0;
} else if (max_path > 255 && !image->allow_longer_paths) {
iso_msg_note(image->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(image->image->id, LIBISO_FILE_IGNORED,
"File \"%s\" can't be added, because path length "
"is greater than 255 characters", iso->name);
free(iso_name);
@ -321,7 +321,7 @@ int create_tree(Ecma119Image *image, IsoNode *iso, Ecma119Node **tree,
ret = create_symlink(image, (IsoSymlink*)iso, &node);
} else {
/* symlinks are only supported when RR is enabled */
iso_msg_note(image->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(image->image->id, LIBISO_FILE_IGNORED,
"File \"%s\" ignored. Symlinks need RockRidge extensions.",
iso->name);
ret = 0;
@ -332,7 +332,7 @@ int create_tree(Ecma119Image *image, IsoNode *iso, Ecma119Node **tree,
ret = create_special(image, (IsoSpecial*)iso, &node);
} else {
/* symlinks are only supported when RR is enabled */
iso_msg_note(image->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(image->image->id, LIBISO_FILE_IGNORED,
"File \"%s\" ignored. Special files need RockRidge extensions.",
iso->name);
ret = 0;
@ -343,7 +343,7 @@ int create_tree(Ecma119Image *image, IsoNode *iso, Ecma119Node **tree,
ret = create_boot_cat(image, (IsoBoot*)iso, &node);
} else {
/* log and ignore */
iso_msg_note(image->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(image->image->id, LIBISO_FILE_IGNORED,
"El-Torito catalog found on a image without El-Torito.",
iso->name);
ret = 0;
@ -571,7 +571,7 @@ int mangle_single_dir(Ecma119Image *img, Ecma119Node *dir, int max_file_len,
ret = ISO_MEM_ERROR;
goto mangle_cleanup;
}
iso_msg_debug(img->image->messenger,
iso_msg_debug(img->image->id,
"\"%s\" renamed to \"%s\"",
children[k]->iso_name, new);
@ -822,10 +822,10 @@ int ecma119_tree_create(Ecma119Image *img)
}
img->root = root;
iso_msg_debug(img->image->messenger, "Sorting the low level tree...");
iso_msg_debug(img->image->id, "Sorting the low level tree...");
sort_tree(root);
iso_msg_debug(img->image->messenger, "Mangling names...");
iso_msg_debug(img->image->id, "Mangling names...");
ret = mangle_tree(img, 1);
if (ret < 0) {
return ret;

16
src/eltorito.c

@ -208,7 +208,7 @@ int create_image(IsoImage *image, const char *image_path,
boot_media_type = 3; /* 2.88 meg diskette */
break;
default:
iso_msg_sorry(image->messenger, LIBISO_EL_TORITO_WRONG_IMG,
iso_msg_sorry(image->id, LIBISO_EL_TORITO_WRONG_IMG,
"Invalid image size %d Kb. Must be one of 1.2, 1.44"
"or 2.88 Mb", iso_stream_get_size(stream) / 1024);
return ISO_BOOT_IMAGE_NOT_VALID;
@ -227,21 +227,21 @@ int create_image(IsoImage *image, const char *image_path,
/* read the MBR on disc and get the type of the partition */
ret = iso_stream_open(stream);
if (ret < 0) {
iso_msg_sorry(image->messenger, LIBISO_EL_TORITO_WRONG_IMG,
iso_msg_sorry(image->id, LIBISO_EL_TORITO_WRONG_IMG,
"Can't open image file.");
return ret;
}
ret = iso_stream_read(stream, &mbr, sizeof(mbr));
iso_stream_close(stream);
if (ret != sizeof(mbr)) {
iso_msg_sorry(image->messenger, LIBISO_EL_TORITO_WRONG_IMG,
iso_msg_sorry(image->id, LIBISO_EL_TORITO_WRONG_IMG,
"Can't read MBR from image file.");
return ret < 0 ? ret : ISO_FILE_READ_ERROR;
}
/* check valid MBR signature */
if ( mbr.sign1 != 0x55 || mbr.sign2 != 0xAA ) {
iso_msg_sorry(image->messenger, LIBISO_EL_TORITO_WRONG_IMG,
iso_msg_sorry(image->id, LIBISO_EL_TORITO_WRONG_IMG,
"Invalid MBR. Wrong signature.");
return ISO_BOOT_IMAGE_NOT_VALID;
}
@ -252,7 +252,7 @@ int create_image(IsoImage *image, const char *image_path,
if (mbr.partition[i].type != 0) {
/* it's an used partition */
if (used_partition != -1) {
iso_msg_sorry(image->messenger, LIBISO_EL_TORITO_WRONG_IMG,
iso_msg_sorry(image->id, LIBISO_EL_TORITO_WRONG_IMG,
"Invalid MBR. At least 2 partitions: %d and "
"%d, are being used\n", used_partition, i);
return ISO_BOOT_IMAGE_NOT_VALID;
@ -746,7 +746,7 @@ int eltorito_writer_write_vol_desc(IsoImageWriter *writer)
t = writer->target;
cat = t->catalog;
iso_msg_debug(t->image->messenger, "Write El-Torito boot record");
iso_msg_debug(t->image->id, "Write El-Torito boot record");
memset(&vol, 0, sizeof(struct ecma119_boot_rec_vol_desc));
vol.vol_desc_type[0] = 0;
@ -769,7 +769,7 @@ void patch_boot_image(uint8_t *buf, Ecma119Image *t, size_t imgsize)
size_t offset;
if (imgsize < 64) {
iso_msg_warn(t->image->messenger, LIBISO_ISOLINUX_CANT_PATCH,
iso_msg_warn(t->image->id, LIBISO_ISOLINUX_CANT_PATCH,
"Isolinux image too small. We won't patch it.");
return;
}
@ -787,7 +787,7 @@ void patch_boot_image(uint8_t *buf, Ecma119Image *t, size_t imgsize)
}
if (offset != imgsize) {
/* file length not multiple of 4 */
iso_msg_warn(t->image->messenger, LIBISO_ISOLINUX_CANT_PATCH,
iso_msg_warn(t->image->id, LIBISO_ISOLINUX_CANT_PATCH,
"Unexpected isolinux image length. Patch might not work.");
}

10
src/filesrc.c

@ -253,7 +253,7 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
t = writer->target;
filelist = writer->data;
iso_msg_debug(t->image->messenger, "Writing Files...");
iso_msg_debug(t->image->id, "Writing Files...");
i = 0;
while ((file = filelist[i++]) != NULL) {
@ -272,7 +272,7 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
* 0's to image
*/
char *name = iso_stream_get_name(file->stream);
iso_msg_sorry(t->image->messenger, LIBISO_FILE_CANT_WRITE,
iso_msg_sorry(t->image->id, LIBISO_FILE_CANT_WRITE,
"File \"%s\" can't be opened. Filling with 0s.", name);
free(name);
memset(buffer, 0, BLOCK_SIZE);
@ -302,17 +302,17 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
char *name = iso_stream_get_name(file->stream);
if (res < 0) {
/* error */
iso_msg_sorry(t->image->messenger, LIBISO_FILE_CANT_WRITE,
iso_msg_sorry(t->image->id, LIBISO_FILE_CANT_WRITE,
"Read error in file %s.", name);
} else {
/* eof */
iso_msg_sorry(t->image->messenger, LIBISO_FILE_CANT_WRITE,
iso_msg_sorry(t->image->id, LIBISO_FILE_CANT_WRITE,
"Premature end of file %s.", name);
}
free(name);
/* fill with 0s */
iso_msg_sorry(t->image->messenger, LIBISO_FILE_CANT_WRITE,
iso_msg_sorry(t->image->id, LIBISO_FILE_CANT_WRITE,
"Filling with 0");
memset(buffer, 0, BLOCK_SIZE);
while (b++ < nblocks) {

109
src/fs_image.c

@ -67,7 +67,7 @@ typedef struct
gid_t gid; /**< Default uid when no RR */
mode_t mode; /**< Default mode when no RR (only permissions) */
struct libiso_msgs *messenger;
int msgid;
char *input_charset; /**< Input charset for RR names */
char *local_charset; /**< For RR names, will be set to the locale one */
@ -342,7 +342,7 @@ int read_dir(ImageFileSourceData *data)
if (data->parent == NULL && record->len_fi[0] == 8
&& !strncmp((char*)record->file_id, "RR_MOVED", 8)) {
iso_msg_debug(fsdata->messenger, "Skipping RR_MOVE entry.");
iso_msg_debug(fsdata->msgid, "Skipping RR_MOVE entry.");
tlen += record->len_dr[0];
pos += record->len_dr[0];
@ -713,7 +713,7 @@ char *get_name(_ImageFsData *fsdata, const char *str, size_t len)
if (ret == 1) {
return name;
} else {
iso_msg_sorry(fsdata->messenger, LIBISO_CHARSET_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_CHARSET_ERROR,
"Charset conversion error. Can't convert %s from %s to %s",
str, fsdata->input_charset, fsdata->local_charset);
/* fallback */
@ -773,7 +773,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
/* check for unsupported multiextend */
if (record->flags[0] & 0x80) {
iso_msg_fatal(fsdata->messenger, LIBISO_IMG_UNSUPPORTED,
iso_msg_fatal(fsdata->msgid, LIBISO_IMG_UNSUPPORTED,
"Unsupported image. This image makes use of Multi-Extend"
" features, that are not supported at this time. If you "
"need support for that, please request us this feature.");
@ -782,7 +782,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
/* check for unsupported interleaved mode */
if (record->file_unit_size[0] || record->interleave_gap_size[0]) {
iso_msg_fatal(fsdata->messenger, LIBISO_IMG_UNSUPPORTED,
iso_msg_fatal(fsdata->msgid, LIBISO_IMG_UNSUPPORTED,
"Unsupported image. This image has at least one file recorded "
"in interleaved mode. We don't support this mode, as we think "
"it's not used. If you're reading this, then we're wrong :) "
@ -795,7 +795,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
* 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,
iso_msg_fatal(fsdata->msgid, LIBISO_IMG_UNSUPPORTED,
"Unsupported image. This image has at least one file with "
"Extended Attributes, that are not supported");
return ISO_UNSUPPORTED_ECMA119;
@ -816,7 +816,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
iter = susp_iter_new(fsdata->src, record, fsdata->len_skp,
fsdata->messenger);
fsdata->msgid);
if (iter == NULL) {
return ISO_MEM_ERROR;
}
@ -831,20 +831,20 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
ret = read_rr_PX(sue, &atts);
if (ret < 0) {
/* notify and continue */
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"Invalid PX entry");
}
} else if (SUSP_SIG(sue, 'T', 'F')) {
ret = read_rr_TF(sue, &atts);
if (ret < 0) {
/* notify and continue */
iso_msg_warn(fsdata->messenger, LIBISO_RR_WARNING,
iso_msg_warn(fsdata->msgid, LIBISO_RR_WARNING,
"Invalid TF entry");
}
} else if (SUSP_SIG(sue, 'N', 'M')) {
if (name != NULL && namecont == 0) {
/* ups, RR standard violation */
iso_msg_warn(fsdata->messenger, LIBISO_RR_WARNING,
iso_msg_warn(fsdata->msgid, LIBISO_RR_WARNING,
"New NM entry found without previous"
"CONTINUE flag. Ignored");
continue;
@ -852,13 +852,13 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
ret = read_rr_NM(sue, &name, &namecont);
if (ret < 0) {
/* notify and continue */
iso_msg_warn(fsdata->messenger, LIBISO_RR_WARNING,
iso_msg_warn(fsdata->msgid, LIBISO_RR_WARNING,
"Invalid NM entry");
}
} else if (SUSP_SIG(sue, 'S', 'L')) {
if (linkdest != NULL && linkdestcont == 0) {
/* ups, RR standard violation */
iso_msg_warn(fsdata->messenger, LIBISO_RR_WARNING,
iso_msg_warn(fsdata->msgid, LIBISO_RR_WARNING,
"New SL entry found without previous"
"CONTINUE flag. Ignored");
continue;
@ -866,7 +866,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
ret = read_rr_SL(sue, &linkdest, &linkdestcont);
if (ret < 0) {
/* notify and continue */
iso_msg_warn(fsdata->messenger, LIBISO_RR_WARNING,
iso_msg_warn(fsdata->msgid, LIBISO_RR_WARNING,
"Invalid SL entry");
}
} else if (SUSP_SIG(sue, 'R', 'E')) {
@ -887,7 +887,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
*/
relocated_dir = iso_read_bb(sue->data.CL.child_loc, 4, NULL);
if (relocated_dir == 0) {
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"Invalid SL entry, no child location");
ret = ISO_WRONG_RR;
break;
@ -896,11 +896,11 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
ret = read_rr_PN(sue, &atts);
if (ret < 0) {
/* notify and continue */
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"Invalid PN entry");
}
} else if (SUSP_SIG(sue, 'S', 'F')) {
iso_msg_sorry(fsdata->messenger, LIBISO_RR_UNSUPPORTED,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_UNSUPPORTED,
"Sparse files not supported.");
ret = ISO_UNSUPPORTED_RR;
break;
@ -914,7 +914,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
*/
if (parent != NULL) {
/* notify and continue */
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"SP entry found in a directory entry other "
"than '.' entry of root node");
}
@ -926,13 +926,13 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
*/
if (parent != NULL) {
/* notify and continue */
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"ER entry found in a directory entry other "
"than '.' entry of root node");
}
continue;
} else {
iso_msg_hint(fsdata->messenger, LIBISO_SUSP_UNHANLED,
iso_msg_hint(fsdata->msgid, LIBISO_SUSP_UNHANLED,
"Unhandled SUSP entry %c%c.", sue->sig[0], sue->sig[1]);
}
}
@ -942,21 +942,21 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
/* check for RR problems */
if (ret < 0) {
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"Error parsing RR entries");
} else if (!relocated_dir && atts.st_mode == (mode_t) 0 ) {
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR, "Mandatory Rock "
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR, "Mandatory Rock "
"Ridge PX entry is not present or it contains invalid values.");
ret = ISO_WRONG_RR;
} else {
/* ensure both name and link dest are finished */
if (namecont != 0) {
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"Incomplete RR name, last NM entry continues");
ret = ISO_WRONG_RR;
}
if (linkdestcont != 0) {
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"Incomplete link destination, last SL entry continues");
ret = ISO_WRONG_RR;
}
@ -974,7 +974,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
ret = strconv(name, fsdata->input_charset, fsdata->local_charset,
&newname);
if (ret < 0) {
iso_msg_sorry(fsdata->messenger, LIBISO_CHARSET_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_CHARSET_ERROR,
"Charset conversion error. Can't convert %s from %s to %s",
name, fsdata->input_charset, fsdata->local_charset);
free(newname);
@ -991,7 +991,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
ret = strconv(linkdest, fsdata->input_charset,
fsdata->local_charset, &newlinkdest);
if (ret < 0) {
iso_msg_sorry(fsdata->messenger, LIBISO_CHARSET_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_CHARSET_ERROR,
"Charset conversion error. Can't convert %s from %s to %s",
linkdest, fsdata->input_charset, fsdata->local_charset);
free(newlinkdest);
@ -1022,7 +1022,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
if (record->len_fi[0] == 1 && record->file_id[0] == 0) {
/* "." entry, we can call this for root node, so... */
if (!(atts.st_mode & S_IFDIR)) {
iso_msg_sorry(fsdata->messenger, LIBISO_WRONG_IMG,
iso_msg_sorry(fsdata->msgid, LIBISO_WRONG_IMG,
"Wrong ISO file name. \".\" not dir");
return ISO_WRONG_ECMA119;
}
@ -1030,7 +1030,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
name = get_name(fsdata, (char*)record->file_id, record->len_fi[0]);
if (name == NULL) {
iso_msg_sorry(fsdata->messenger, LIBISO_WRONG_IMG,
iso_msg_sorry(fsdata->msgid, LIBISO_WRONG_IMG,
"Can't retrieve file name");
return ISO_WRONG_ECMA119;
}
@ -1114,7 +1114,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
//TODO more sanity checks!!
if (S_ISLNK(atts.st_mode) && (linkdest == NULL)) {
iso_msg_sorry(fsdata->messenger, LIBISO_RR_ERROR,
iso_msg_sorry(fsdata->msgid, LIBISO_RR_ERROR,
"Link without destination.");
free(name);
return ISO_WRONG_RR;
@ -1413,7 +1413,7 @@ int read_root_susp_entries(_ImageFsData *data, uint32_t block)
* In that case, we need to set info->len_skp to 15!!
*/
iter = susp_iter_new(data->src, record, data->len_skp, data->messenger);
iter = susp_iter_new(data->src, record, data->len_skp, data->msgid);
if (iter == NULL) {
return ISO_MEM_ERROR;
}
@ -1425,7 +1425,7 @@ int read_root_susp_entries(_ImageFsData *data, uint32_t block)
susp_iter_free(iter);
return ret;
} else if (ret == 0 || !SUSP_SIG(sue, 'S', 'P') ) {
iso_msg_debug(data->messenger, "SUSP/RR is not being used.");
iso_msg_debug(data->msgid, "SUSP/RR is not being used.");
susp_iter_free(iter);
return ISO_SUCCESS;
}
@ -1434,13 +1434,13 @@ int read_root_susp_entries(_ImageFsData *data, uint32_t block)
if (sue->version[0] != 1 || sue->data.SP.be[0] != 0xBE
|| sue->data.SP.ef[0] != 0xEF) {
iso_msg_sorry(data->messenger, LIBISO_SUSP_WRONG, "SUSP SP system use "
iso_msg_sorry(data->msgid, LIBISO_SUSP_WRONG, "SUSP SP system use "
"entry seems to be wrong. Ignoring Rock Ridge Extensions.");
susp_iter_free(iter);
return ISO_SUCCESS;
}
iso_msg_debug(data->messenger, "SUSP/RR is being used.");
iso_msg_debug(data->msgid, "SUSP/RR is being used.");
/*
* The LEN_SKP field, defined in IEEE 1281, SUSP. 5.3, specifies the
@ -1469,7 +1469,7 @@ int read_root_susp_entries(_ImageFsData *data, uint32_t block)
if (SUSP_SIG(sue, 'E', 'R')) {
if (data->rr_version) {
iso_msg_warn(data->messenger, LIBISO_SUSP_MULTIPLE_ER,
iso_msg_warn(data->msgid, LIBISO_SUSP_MULTIPLE_ER,
"More than one ER has found. This is not supported. "
"It will be ignored, but can cause problems. "
"Please notify us about this.");
@ -1482,7 +1482,7 @@ int read_root_susp_entries(_ImageFsData *data, uint32_t block)
if ( sue->data.ER.len_id[0] == 10 &&
!strncmp((char*)sue->data.ER.ext_id, "RRIP_1991A", 10) ) {
iso_msg_debug(data->messenger,
iso_msg_debug(data->msgid,
"Suitable Rock Ridge ER found. Version 1.10.");
data->rr_version = RR_EXT_110;
@ -1491,12 +1491,12 @@ int read_root_susp_entries(_ImageFsData *data, uint32_t block)
|| (sue->data.ER.len_id[0] == 9 &&
!strncmp((char*)sue->data.ER.ext_id, "IEEE_1282", 9)) ) {
iso_msg_debug(data->messenger,
iso_msg_debug(data->msgid,
"Suitable Rock Ridge ER found. Version 1.12.");
data->rr_version = RR_EXT_112;
//TODO check also version?
} else {
iso_msg_warn(data->messenger, LIBISO_SUSP_MULTIPLE_ER,
iso_msg_warn(data->msgid, LIBISO_SUSP_MULTIPLE_ER,
"Not Rock Ridge ER found.\n"
"That will be ignored, but can cause problems in "
"image reading. Please notify us about this");
@ -1585,7 +1585,7 @@ int read_el_torito_boot_catalog(_ImageFsData *data, uint32_t block)
if ( (ve->header_id[0] != 1) || (ve->key_byte1[0] != 0x55)
|| (ve->key_byte2[0] != 0xAA) ) {
iso_msg_sorry(data->messenger, LIBISO_EL_TORITO_WRONG,
iso_msg_sorry(data->msgid, LIBISO_EL_TORITO_WRONG,
"Wrong or damaged El-Torito Catalog. El-Torito info "
"will be ignored.");
return ISO_WRONG_EL_TORITO;
@ -1593,7 +1593,7 @@ int read_el_torito_boot_catalog(_ImageFsData *data, uint32_t block)
/* check for a valid platform */
if (ve->platform_id[0] != 0) {
iso_msg_hint(data->messenger, LIBISO_EL_TORITO_UNHANLED,
iso_msg_hint(data->msgid, LIBISO_EL_TORITO_UNHANLED,
"Unsupported El-Torito platform. Only 80x86 is "
"supported. El-Torito info will be ignored.");
return ISO_WRONG_EL_TORITO;
@ -1618,8 +1618,7 @@ int read_el_torito_boot_catalog(_ImageFsData *data, uint32_t block)
}
int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
struct libiso_msgs *messenger,
IsoImageFilesystem **fs)
int msgid, IsoImageFilesystem **fs)
{
int ret;
uint32_t block;
@ -1654,7 +1653,7 @@ int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
data->gid = opts->gid;
data->uid = opts->uid;
data->mode = opts->mode & ~S_IFMT;
data->messenger = messenger;
data->msgid = msgid;
setlocale(LC_CTYPE, "");
data->local_charset = strdup(nl_langinfo(CODESET));
@ -1705,7 +1704,7 @@ int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
|| strncmp((char*)vol->boot_sys_id,
"EL TORITO SPECIFICATION", 23)) {
iso_msg_hint(data->messenger, LIBISO_BOOT_VD_UNHANLED,
iso_msg_hint(data->msgid, LIBISO_BOOT_VD_UNHANLED,
"Unsupported Boot Vol. Desc. Only El-Torito "
"Specification, Version 1.0 Volume "
"Descriptors are supported. Ignoring boot info");
@ -1729,7 +1728,7 @@ int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
sup->esc_sequences[2] == 0x45) ) {
/* it's a Joliet Sup. Vol. Desc. */
iso_msg_debug(data->messenger, "Found Joliet extensions");
iso_msg_debug(data->msgid, "Found Joliet extensions");
data->joliet = 1;
root = (struct ecma119_dir_record*)sup->root_dir_record;
data->svd_root_block = iso_read_bb(root->block, 4, NULL);
@ -1744,14 +1743,14 @@ int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
* It is an Enhanced Volume Descriptor, image is an
* ISO 9660:1999
*/
iso_msg_debug(data->messenger, "Found ISO 9660:1999");
iso_msg_debug(data->msgid, "Found ISO 9660:1999");
data->iso1999 = 1;
root = (struct ecma119_dir_record*)sup->root_dir_record;
data->evd_root_block = iso_read_bb(root->block, 4, NULL);
//TODO an ISO 9660:1999 tree can also have RR extensions.
// What about this?
} else {
iso_msg_hint(data->messenger, LIBISO_UNSUPPORTED_VD,
iso_msg_hint(data->msgid, LIBISO_UNSUPPORTED_VD,
"Unsupported Sup. Vol. Desc found.");
}
}
@ -1763,7 +1762,7 @@ int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
*/
break;
default:
iso_msg_hint(data->messenger, LIBISO_UNSUPPORTED_VD,
iso_msg_hint(data->msgid, LIBISO_UNSUPPORTED_VD,
"Ignoring Volume descriptor %x.", buffer[0]);
break;
}
@ -1788,29 +1787,29 @@ int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
/* RR extensions are available */
if (!opts->nojoliet && opts->preferjoliet && data->joliet) {
/* if user prefers joliet, that is used */
iso_msg_debug(data->messenger, "Reading Joliet extensions.");
iso_msg_debug(data->msgid, "Reading Joliet extensions.");
data->input_charset = strdup("UCS-2BE");
data->rr = RR_EXT_NO;
data->iso_root_block = data->svd_root_block;
} else {
/* RR will be used */
iso_msg_debug(data->messenger, "Reading Rock Ridge extensions.");
iso_msg_debug(data->msgid, "Reading Rock Ridge extensions.");
data->iso_root_block = data->pvd_root_block;
}
} else {
/* RR extensions are not available */
if (!opts->nojoliet && data->joliet) {
/* joliet will be used */
iso_msg_debug(data->messenger, "Reading Joliet extensions.");
iso_msg_debug(data->msgid, "Reading Joliet extensions.");
data->input_charset = strdup("UCS-2BE");
data->iso_root_block = data->svd_root_block;
} else if (!opts->noiso1999 && data->iso1999) {
/* we will read ISO 9660:1999 */
iso_msg_debug(data->messenger, "Reading ISO-9660:1999 tree.");
iso_msg_debug(data->msgid, "Reading ISO-9660:1999 tree.");
data->iso_root_block = data->evd_root_block;
} else {
/* default to plain iso */
iso_msg_debug(data->messenger, "Reading plain ISO-9660 tree.");
iso_msg_debug(data->msgid, "Reading plain ISO-9660 tree.");
data->iso_root_block = data->pvd_root_block;
data->input_charset = strdup("ASCII");
}
@ -1873,7 +1872,7 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
if (fsdata->eltorito && data->block == fsdata->catblock) {
if (image->bootcat->node != NULL) {
iso_msg_hint(image->messenger, LIBISO_EL_TORITO_UNHANLED,
iso_msg_hint(image->id, LIBISO_EL_TORITO_UNHANLED,
"More than one catalog node has been found. "
"We will continue, but that could lead to "
"problems");
@ -1929,8 +1928,8 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
if (fsdata->eltorito && data->block == fsdata->imgblock) {
/* it is boot image node */
if (image->bootcat->image->image != NULL) {
iso_msg_hint(image->messenger, LIBISO_EL_TORITO_UNHANLED,
"More than one image node has been found. ");
iso_msg_hint(image->id, LIBISO_EL_TORITO_UNHANLED,
"More than one image node has been found. ");
} else {
/* and set the image node */
image->bootcat->image->image = file;
@ -2130,7 +2129,7 @@ int iso_image_import(IsoImage *image, IsoDataSource *src,
return ISO_NULL_POINTER;
}
ret = iso_image_filesystem_new(src, opts, image->messenger, &fs);
ret = iso_image_filesystem_new(src, opts, image->id, &fs);
if (ret < 0) {
return ret;
}

3
src/fs_image.h

@ -44,8 +44,7 @@ struct Iso_Image_Filesystem
};
int iso_image_filesystem_new(IsoDataSource *src, struct iso_read_opts *opts,
struct libiso_msgs *messenger,
IsoImageFilesystem **fs);
int msgid, IsoImageFilesystem **fs);
const char *iso_image_fs_get_volset_id(IsoImageFilesystem *fs);

14
src/image.c

@ -57,27 +57,16 @@ int iso_image_new(const char *name, IsoImage **image)
return ISO_MEM_ERROR;
}
/* create message messenger */
res = libiso_msgs_new(&img->messenger, 0);
if (res <= 0) {
iso_node_builder_unref(img->builder);
iso_filesystem_unref(img->fs);
free(img);
return ISO_MEM_ERROR;
}
libiso_msgs_set_severities(img->messenger, LIBISO_MSGS_SEV_NEVER,
LIBISO_MSGS_SEV_FATAL, name, 0);
/* fill image fields */
res = iso_node_new_root(&img->root);
if (res < 0) {
libiso_msgs_destroy(&img->messenger, 0);
iso_node_builder_unref(img->builder);
iso_filesystem_unref(img->fs);
free(img);
return res;
}
img->refcount = 1;
img->id = iso_message_id++;
if (name != NULL) {
img->volset_id = strdup(name);
@ -105,7 +94,6 @@ void iso_image_unref(IsoImage *image)
if (--image->refcount == 0) {
/* we need to free the image */
iso_node_unref((IsoNode*)image->root);
libiso_msgs_destroy(&image->messenger, 0);
iso_node_builder_unref(image->builder);
iso_filesystem_unref(image->fs);
el_torito_boot_catalog_free(image->bootcat);

4
src/image.h

@ -108,8 +108,8 @@ struct Iso_Image
/* el-torito boot catalog */
struct el_torito_boot_catalog *bootcat;
/* message messenger for the image */
struct libiso_msgs *messenger;
/* image identifier, for message origin identifier */
int id;
/**
* Default filesystem to use when adding files to the image tree.

25
src/iso1999.c

@ -34,7 +34,7 @@ char *get_iso1999_name(Ecma119Image *t, const char *str)
} else {
ret = strconv(str, t->input_charset, t->output_charset, &name);
if (ret < 0) {
iso_msg_sorry(t->image->messenger, LIBISO_CHARSET_ERROR,
iso_msg_sorry(t->image->id, LIBISO_CHARSET_ERROR,
"Charset conversion error. Can't convert %s from %s to %s",
str, t->input_charset, t->output_charset);
@ -108,7 +108,7 @@ int create_node(Ecma119Image *t, IsoNode *iso, Iso1999Node **node)
size = iso_stream_get_size(file->stream);
if (size > (off_t)0xffffffff) {
iso_msg_note(t->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(t->image->id, LIBISO_FILE_IGNORED,
"File \"%s\" can't be added to image because is "
"greater than 4GB", iso->name);
free(n);
@ -171,7 +171,7 @@ int create_tree(Ecma119Image *t, IsoNode *iso, Iso1999Node **tree, int pathlen)
iso_name = get_iso1999_name(t, iso->name);
max_path = pathlen + 1 + (iso_name ? strlen(iso_name): 0);
if (!t->allow_longer_paths && max_path > 255) {
iso_msg_note(t->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(t->image->id, LIBISO_FILE_IGNORED,
"File \"%s\" can't be added to ISO 9660:1999 tree, "
"because its path length is larger than 255", iso->name);
free(iso_name);
@ -216,7 +216,7 @@ int create_tree(Ecma119Image *t, IsoNode *iso, Iso1999Node **tree, int pathlen)
ret = create_node(t, iso, &node);
} else {
/* log and ignore */
iso_msg_note(t->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(t->image->id, LIBISO_FILE_IGNORED,
"El-Torito catalog found on a image without El-Torito.",
iso->name);
ret = 0;
@ -224,7 +224,7 @@ int create_tree(Ecma119Image *t, IsoNode *iso, Iso1999Node **tree, int pathlen)
break;
case LIBISO_SYMLINK:
case LIBISO_SPECIAL:
iso_msg_note(t->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(t->image->id, LIBISO_FILE_IGNORED,
"Can't add %s to ISO 9660:1999 tree. This kind of files "
"can only be added to a Rock Ridget tree. Skipping.",
iso->name);
@ -296,10 +296,10 @@ int iso1999_tree_create(Ecma119Image *t)
/* the ISO 9660:1999 tree is stored in Ecma119Image target */
t->iso1999_root = root;
iso_msg_debug(t->image->messenger, "Sorting the ISO 9660:1999 tree...");
iso_msg_debug(t->image->id, "Sorting the ISO 9660:1999 tree...");
sort_tree(root);
//iso_msg_debug(t->image->messenger, "Mangling ISO 9660:1999 names...");
//iso_msg_debug(t->image->id, "Mangling ISO 9660:1999 names...");
// FIXME ret = mangle_tree(t, 1);
return ISO_SUCCESS;
@ -408,14 +408,13 @@ int iso1999_writer_compute_data_blocks(IsoImageWriter *writer)
t = writer->target;
/* compute position of directories */
iso_msg_debug(t->image->messenger,
iso_msg_debug(t->image->id,
"Computing position of ISO 9660:1999 dir structure");
t->iso1999_ndirs = 0;
calc_dir_pos(t, t->iso1999_root);
/* compute length of pathlist */
iso_msg_debug(t->image->messenger,
"Computing length of ISO 9660:1999 pathlist");
iso_msg_debug(t->image->id, "Computing length of ISO 9660:1999 pathlist");
path_table_size = calc_path_table_size(t->iso1999_root);
/* compute location for path tables */
@ -507,7 +506,7 @@ int iso1999_writer_write_vol_desc(IsoImageWriter *writer)
t = writer->target;
image = t->image;
iso_msg_debug(image->messenger, "Write Enhanced Vol Desc (ISO 9660:1999)");
iso_msg_debug(image->id, "Write Enhanced Vol Desc (ISO 9660:1999)");
memset(&vol, 0, sizeof(struct ecma119_sup_vol_desc));
@ -700,7 +699,7 @@ int write_path_tables(Ecma119Image *t)
size_t i, j, cur;
Iso1999Node **pathlist;
iso_msg_debug(t->image->messenger, "Writing ISO 9660:1999 Path tables");
iso_msg_debug(t->image->id, "Writing ISO 9660:1999 Path tables");
/* allocate temporal pathlist */
pathlist = malloc(sizeof(void*) * t->iso1999_ndirs);
@ -783,7 +782,7 @@ int iso1999_writer_create(Ecma119Image *target)
writer->data = NULL;
writer->target = target;
iso_msg_debug(target->image->messenger,
iso_msg_debug(target->image->id,
"Creating low level ISO 9660:1999 tree...");
ret = iso1999_tree_create(target);
if (ret < 0) {

28
src/joliet.c

@ -32,7 +32,7 @@ int get_joliet_name(Ecma119Image *t, IsoNode *iso, uint16_t **name)
ret = str2ucs(t->input_charset, iso->name, &ucs_name);
if (ret < 0) {
iso_msg_debug(t->image->messenger, "Can't convert %s", iso->name);
iso_msg_debug(t->image->id, "Can't convert %s", iso->name);
return ret;
}
@ -112,7 +112,7 @@ int create_node(Ecma119Image *t, IsoNode *iso, JolietNode **node)
size = iso_stream_get_size(file->stream);
if (size > (off_t)0xffffffff) {
iso_msg_note(t->image->messenger, LIBISO_FILE_IGNORED,
iso_msg_note(t->image->id, LIBISO_FILE_IGNORED,
"File \"%s\" can't be added to image because is "
"greater than 4GB", iso->name);