Trying to prevent usage of burn drive as track source

This commit is contained in:
Thomas Schmitt 2007-07-19 14:29:59 +00:00
parent f78da1be6c
commit 81996747a4
2 changed files with 49 additions and 1 deletions

View File

@ -1162,6 +1162,38 @@ int Cdrtrack_open_source_path(struct CdrtracK *track, int *fd, int flag)
*fd= atoi(track->source_path+1);
else {
*fd= -1;
#ifdef Cdrskin_libburn_has_convert_fs_adR
if(1) { char adr[BURN_DRIVE_ADR_LEN],*device_adr,*raw_adr;
int Cdrskin_get_device_adr(struct CdrskiN *skin,
char **device_adr, char **raw_adr, int flag);
if(burn_drive_convert_fs_adr(track->source_path,adr)>0) {
/*
fprintf(stderr,"cdrskin: DEBUG : track source '%s' -> adr='%s'\n",
track->source_path,adr);
*/
Cdrskin_get_device_adr(track->boss,&device_adr,&raw_adr,0);
/*
fprintf(stderr,"cdrskin: DEBUG : device_adr='%s' , raw_adr='%s'\n",
device_adr, raw_adr);
*/
if(strcmp(device_adr,adr)==0) {
fprintf(stderr,
"cdrskin: FATAL : track source address leads to burner drive\n");
fprintf(stderr,
"cdrskin: : dev='%s' -> '%s' , track source '%s'\n",
raw_adr, device_adr, track->source_path);
return(0);
}
}
/*
fprintf(stderr,"cdrskin: EXPERIMENTAL : Deliberate abort\n");
return(0);
*/
}
#endif
is_wav= Cdrtrack_extract_audio(track,fd,&xtr_size,0);
if(is_wav==-1)
return(-1);
@ -2688,6 +2720,8 @@ struct CdrskiN {
unsigned int n_drives;
/** The drive selected for operation by CdrskiN */
int driveno;
/** The persistent drive address of that drive */
char device_adr[Cdrskin_adrleN];
/** Progress state info: wether libburn is actually processing payload data */
@ -2797,6 +2831,7 @@ int Cdrskin_new(struct CdrskiN **skin, struct CdrpreskiN *preskin, int flag)
o->drives= NULL;
o->n_drives= 0;
o->driveno= 0;
o->device_adr[0]= 0;
o->is_writing= 0;
o->previous_drive_status = BURN_DRIVE_IDLE;
o->abort_max_wait= 74*60;
@ -2861,6 +2896,19 @@ int Cdrskin_set_msinfo_fd(struct CdrskiN *skin, int result_fd, int flag)
}
/** Return the addresses of the drive. device_adr is the libburn persistent
address of the drive, raw_adr is the address as given by the user.
*/
int Cdrskin_get_device_adr(struct CdrskiN *skin,
char **device_adr, char **raw_adr, int flag)
{
burn_drive_get_adr(&skin->drives[skin->driveno],skin->device_adr);
*device_adr= skin->device_adr;
*raw_adr= skin->preskin->raw_device_adr;
return(1);
}
/** Return information about current track source */
int Cdrskin_get_source(struct CdrskiN *skin, char *source_path,
double *fixed_size, double *tao_to_sao_tsize,

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2007.07.19.072434"
#define Cdrskin_timestamP "2007.07.19.143139"