From 9c9b82ae6112533948973df8c8a7883d5d4543ed Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 22 Mar 2011 08:59:43 +0000 Subject: [PATCH] Avoiding appendable role 5 if not explicitely enabled --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/drive.c | 4 +++- libburn/init.c | 2 +- libburn/libburn.h | 24 ++++++++++++++++-------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index c7c2281..4832355 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.03.21.092220" +#define Cdrskin_timestamP "2011.03.22.085956" diff --git a/libburn/drive.c b/libburn/drive.c index 3d431d7..7478d97 100644 --- a/libburn/drive.c +++ b/libburn/drive.c @@ -1562,7 +1562,8 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname) d->block_types[BURN_WRITE_SAO] = 0; } else { if (d->drive_role == 5 && stat_ret != -1 && - S_ISREG(stbuf.st_mode) && stbuf.st_size > 0) { + S_ISREG(stbuf.st_mode) && stbuf.st_size > 0 && + (burn_drive_role_4_allowed & 8)) { d->status = BURN_DISC_APPENDABLE; d->block_types[BURN_WRITE_SAO] = 0; d->role_5_nwa = stbuf.st_size / 2048 + @@ -1571,6 +1572,7 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname) d->status = BURN_DISC_BLANK; d->block_types[BURN_WRITE_SAO] = BURN_BLOCK_SAO; + d->role_5_nwa = 0; } d->block_types[BURN_WRITE_TAO] = BURN_BLOCK_MODE1; } diff --git a/libburn/init.c b/libburn/init.c index 9977842..d86ccd4 100644 --- a/libburn/init.c +++ b/libburn/init.c @@ -578,5 +578,5 @@ void burn_set_scsi_logging(int flag) /* ts B10312 API */ void burn_allow_drive_role_4(int allowed) { - burn_drive_role_4_allowed = (allowed & 7); + burn_drive_role_4_allowed = (allowed & 0xf); } diff --git a/libburn/libburn.h b/libburn/libburn.h index 9c22f20..414bb36 100644 --- a/libburn/libburn.h +++ b/libburn/libburn.h @@ -1448,6 +1448,8 @@ void burn_read_opts_free(struct burn_read_opts *opts); cancellable, as control of the operation is passed wholly to the drive and there is no way to interrupt it safely. @param drive The drive with which to erase a disc. + Only drive roles 1 (MMC) and 5 (stdio random write-only) + support erasing. @param fast Nonzero to do a fast erase, where only the disc's headers are erased; zero to erase the entire disc. With DVD-RW, fast blanking yields media capable only of DAO. @@ -3020,28 +3022,34 @@ int burn_drive_get_drive_role(struct burn_drive *d); /* ts B10312 */ -/** Allow drive role 4 "random access read-only" drive. +/** Allow drive role 4 "random access read-only" + and drive role 5 "random access write-only". By default a random access file assumes drive role 2 "read-write" regardless whether it is actually readable or writeable. If enabled, random-access file objects which recognizably allow no - writing will be classified as role 4. + writing will be classified as role 4 and those which allow no reading + will get role 5. Candidates are drive addresses of the form stdio:/dev/fd/# , where # is the integer number of an open file descriptor. If this descriptor was - opened read-only, then it gets role 4. + opened read-only resp. write-only, then it gets role 4 resp. role 5. Other paths may get tested by an attempt to open them for read-write - (role 2) resp. read-only (role 4) resp. write-only (role 3). See bit1. - read-only + (role 2) resp. read-only (role 4) resp. write-only (role 5). See bit1. @param allowed Bitfield for control purposes: - bit0= Enable role 4 for drives which get aquired - after this call + bit0= Enable roles 4 and 5 for drives which get + aquired after this call bit1= with bit0: Test whether the file can be opened for read-write resp. read-only resp. write-only. - Classify as roles 2 resp. 4 resp. 3. + Classify as roles 2 resp. 4 resp. 5. bit2= with bit0 and bit1: Classify files which cannot be opened at all as role 0 : useless dummy. Else classify as role 2. + bit3= Classify non-empty role 5 drives as + BURN_DISC_APPENDABLE with Next Writeable Address + after the end of the file. It is nevertheless + possible to change this address by call + burn_write_opts_set_start_byte(). @since 1.0.6 */ void burn_allow_drive_role_4(int allowed);