From 58ba5aeff630e6f1ec92635cca1e0b4dab5f87e5 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 17 Jul 2008 11:07:42 +0000 Subject: [PATCH] Ability to emulate a featured bug with mkisofs -C : read 16 block too early --- libisoburn/burn_wrap.c | 9 +++++++++ libisoburn/libisoburn.h | 15 +++++++++++---- xorriso/xorriso_timestamp.h | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/libisoburn/burn_wrap.c b/libisoburn/burn_wrap.c index 63ac142d..7a780596 100644 --- a/libisoburn/burn_wrap.c +++ b/libisoburn/burn_wrap.c @@ -1427,6 +1427,8 @@ int isoburn_drive_set_msgs_submit(struct burn_drive *d, } +/* @param flag bit0= with adr_mode 3: adr_value might be 16 blocks too high +*/ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value, int flag) { @@ -1498,7 +1500,14 @@ not_found:; } else if(adr_mode==3) { o->fabricated_msc1= adr_num; + if((flag & 1) && o->fabricated_msc1 >= 16) { + /* MULTI : adr_num is possibly 16 blocks too high */; + + ret= isoburn_read_iso_head(d, o->fabricated_msc1, &size,volid, 1|(1<<14)); + if(ret==2) + o->fabricated_msc1-= 16; + } } else if(adr_mode==4) { /* search for volume id that is equal to adr_value */ best_lba= -1; diff --git a/libisoburn/libisoburn.h b/libisoburn/libisoburn.h index 37a04d2c..fc8e76ab 100644 --- a/libisoburn/libisoburn.h +++ b/libisoburn/libisoburn.h @@ -433,7 +433,7 @@ int isoburn_disc_erasable(struct burn_drive *d); void isoburn_disc_erase(struct burn_drive *drive, int fast); -/** Program isoburn_disc_get_msc1() to return a fabricated value. +/** Set up isoburn_disc_get_msc1() to return a fabricated value. This makes only sense between aquiring the drive and reading the image. After isoburn_read_image() it will confuse the coordination of libisoburn and libisofs. @@ -450,7 +450,11 @@ void isoburn_disc_erase(struct burn_drive *drive, int fast); 4= start lba of last session with volume id given by adr_value @parm adr_value A string describing the value to be eventually used. - @param flag Bitfield for control purposes. Unused yet. Submit 0. + @param flag Bitfield for control purposes. + bit0= @since 0.2.2 + with adr_mode 3: adr_value might be 16 blocks too high + (e.g. -C stemming from growisofs). Probe for ISO head + at adr_value-16 and eventually adjust setting. */ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value, int flag); @@ -570,7 +574,7 @@ void isoburn_toc_track_get_entry(struct isoburn_toc_track *t, void isoburn_toc_disc_free(struct isoburn_toc_disc *disc); -/** Try whether at the data at the given address look like a ISO 9660 +/** Try whether the data at the given address look like a ISO 9660 image header and obtain its alleged size. Depending on the info mode one other string of text information can be retrieved too. @since 0.1.6 @@ -588,7 +592,7 @@ void isoburn_toc_disc_free(struct isoburn_toc_disc *disc); bit14= check both half buffers (not only second) return 2 if found in first block bit15= return-1 on read error - @return 1 seems to be a valid ISO image , 0 format not recognized, <0 error + @return >0 seems to be a valid ISO image, 0 format not recognized, <0 error */ int isoburn_read_iso_head(struct burn_drive *d, int lba, int *image_blocks, char *info, int flag); @@ -1050,6 +1054,9 @@ off_t isoburn_disc_available_space(struct burn_drive *d, case of random access media this will always be 0. Succesfull return is not a guarantee that there is a ISO-9660 image at all. The call will fail, nevertheless,if isoburn_disc_get_status() returns not BURN_DISC_APPENDABLE. + Note: The result of this call may be fabricated by a previous call of + isoburn_set_msc1() which can override the rule to load the most recent + session. Wrapper for: burn_disc_get_msc1() @since 0.1.0 @param d The drive to inquire diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 71368558..0065c248 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.07.16.140043" +#define Xorriso_timestamP "2008.07.17.110812"