Commit 90193998 authored by Thomas Schmitt's avatar Thomas Schmitt

New command -drive_access, new -as cdrecord option --drive_not_exclusive

parent 8828d6f4
...@@ -207,6 +207,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) ...@@ -207,6 +207,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->displacement_sign= 0; m->displacement_sign= 0;
m->read_fs= 0; m->read_fs= 0;
m->drives_exclusive= 1; m->drives_exclusive= 1;
m->drives_access= 1;
m->linux_scsi_dev_family= 0; m->linux_scsi_dev_family= 0;
m->early_stdio_test= 0; m->early_stdio_test= 0;
m->cache_num_tiles= 0; m->cache_num_tiles= 0;
...@@ -219,6 +220,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) ...@@ -219,6 +220,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->in_charset= NULL; m->in_charset= NULL;
m->isofs_st_out= time(0) - 1; m->isofs_st_out= time(0) - 1;
m->indev_is_exclusive= 1; m->indev_is_exclusive= 1;
m->indev_access= 1;
m->indev_off_adr[0]= 0; m->indev_off_adr[0]= 0;
m->isofs_st_in= 0; m->isofs_st_in= 0;
m->volset_change_pending= 0; m->volset_change_pending= 0;
...@@ -231,6 +233,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) ...@@ -231,6 +233,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->out_charset= NULL; m->out_charset= NULL;
m->dev_fd_1= -1; m->dev_fd_1= -1;
m->outdev_is_exclusive= 1; m->outdev_is_exclusive= 1;
m->outdev_access= 1;
m->outdev_off_adr[0]= 0; m->outdev_off_adr[0]= 0;
m->grow_blindly_msc2= -1; m->grow_blindly_msc2= -1;
m->ban_stdio_write= 0; m->ban_stdio_write= 0;
...@@ -475,6 +478,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) ...@@ -475,6 +478,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
if(strcmp(leafname, "osirrox")==0) { if(strcmp(leafname, "osirrox")==0) {
m->allow_restore= 1; m->allow_restore= 1;
m->drives_exclusive= 0; m->drives_exclusive= 0;
m->drives_access= 0;
} else if(strcmp(leafname, "xorrisofs")==0 || strcmp(leafname, "genisofs")==0 || } else if(strcmp(leafname, "xorrisofs")==0 || strcmp(leafname, "genisofs")==0 ||
strcmp(leafname, "mkisofs")==0 || strcmp(leafname, "genisoimage")==0) { strcmp(leafname, "mkisofs")==0 || strcmp(leafname, "genisoimage")==0) {
m->argument_emulation= 1; m->argument_emulation= 1;
......
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net> Copyright 2007-2019 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
...@@ -279,12 +279,16 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, ...@@ -279,12 +279,16 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
Xorriso_get_drive_handles(xorriso, &out_dinfo, &out_drive, "", 2 | 16); Xorriso_get_drive_handles(xorriso, &out_dinfo, &out_drive, "", 2 | 16);
if(in_dinfo != NULL && (out_dinfo == NULL || out_dinfo == in_dinfo)) { if(in_dinfo != NULL && (out_dinfo == NULL || out_dinfo == in_dinfo)) {
dinfo= in_dinfo; dinfo= in_dinfo;
if(flag & 2) if(flag & 2) {
xorriso->outdev_is_exclusive= xorriso->indev_is_exclusive; xorriso->outdev_is_exclusive= xorriso->indev_is_exclusive;
xorriso->outdev_access= xorriso->indev_access;
}
} else if(out_dinfo != NULL && in_dinfo == NULL) { } else if(out_dinfo != NULL && in_dinfo == NULL) {
dinfo= out_dinfo; dinfo= out_dinfo;
if(flag & 1) if(flag & 1) {
xorriso->indev_is_exclusive= xorriso->outdev_is_exclusive; xorriso->indev_is_exclusive= xorriso->outdev_is_exclusive;
xorriso->indev_access= xorriso->outdev_access;
}
} else if(out_dinfo != NULL || in_dinfo != NULL) { } else if(out_dinfo != NULL || in_dinfo != NULL) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"Two different drives shall be re-assed in one call"); "Two different drives shall be re-assed in one call");
...@@ -304,6 +308,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, ...@@ -304,6 +308,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
if(ret==1) { if(ret==1) {
dinfo= out_dinfo; dinfo= out_dinfo;
xorriso->indev_is_exclusive= xorriso->outdev_is_exclusive; xorriso->indev_is_exclusive= xorriso->outdev_is_exclusive;
xorriso->indev_access= xorriso->outdev_access;
} }
} else if((flag&3)==2 && xorriso->in_drive_handle!=NULL) { } else if((flag&3)==2 && xorriso->in_drive_handle!=NULL) {
ret= Xorriso_get_drive_handles(xorriso, &in_dinfo, &in_drive, ret= Xorriso_get_drive_handles(xorriso, &in_dinfo, &in_drive,
...@@ -314,6 +319,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, ...@@ -314,6 +319,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
if(ret==1) { if(ret==1) {
dinfo= in_dinfo; dinfo= in_dinfo;
xorriso->outdev_is_exclusive= xorriso->indev_is_exclusive; xorriso->outdev_is_exclusive= xorriso->indev_is_exclusive;
xorriso->outdev_access= xorriso->indev_access;
} }
} }
...@@ -362,10 +368,14 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, ...@@ -362,10 +368,14 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
if(flag&1) if(flag&1)
if(xorriso->image_start_mode&(1u<<31)) /* used up setting */ if(xorriso->image_start_mode&(1u<<31)) /* used up setting */
xorriso->image_start_mode= 0; /* no need to perform auto setting */ xorriso->image_start_mode= 0; /* no need to perform auto setting */
if(flag & 1) if(flag & 1) {
xorriso->indev_is_exclusive= xorriso->drives_exclusive; xorriso->indev_is_exclusive= xorriso->drives_exclusive;
if(flag & 2) xorriso->indev_access= xorriso->drives_access;
}
if(flag & 2) {
xorriso->outdev_is_exclusive= xorriso->drives_exclusive; xorriso->outdev_is_exclusive= xorriso->drives_exclusive;
xorriso->outdev_access= xorriso->drives_access;
}
} }
drive= dinfo[0].drive; drive= dinfo[0].drive;
volset= isoburn_get_attached_image(drive); volset= isoburn_get_attached_image(drive);
...@@ -727,9 +737,9 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag) ...@@ -727,9 +737,9 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
if(!in_is_out_too) { if(!in_is_out_too) {
do_eject= !!(flag&4); do_eject= !!(flag&4);
if((flag & 4) && !xorriso->indev_is_exclusive) { if((flag & 4) && xorriso->indev_access == 0) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"Will not eject medium in non-exclusively acquired input drive."); "Will not eject medium in readonly acquired input drive.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
do_eject= 0; do_eject= 0;
} }
...@@ -759,9 +769,9 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag) ...@@ -759,9 +769,9 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
} }
if((flag&2) && xorriso->out_drive_handle!=NULL) { if((flag&2) && xorriso->out_drive_handle!=NULL) {
do_eject= !!(flag&4); do_eject= !!(flag&4);
if((flag & 4) && !xorriso->outdev_is_exclusive) { if((flag & 4) && xorriso->outdev_access == 0) {
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"Will not eject medium in non-exclusively acquired drive."); "Will not eject medium in readonly acquired drive.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
do_eject= 0; do_eject= 0;
} }
...@@ -795,16 +805,17 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag) ...@@ -795,16 +805,17 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
int Xorriso_may_burn(struct XorrisO *xorriso, int flag) int Xorriso_may_burn(struct XorrisO *xorriso, int flag)
{ {
if(xorriso->outdev_is_exclusive) if(xorriso->outdev_access == 1)
return(1); return(1);
sprintf(xorriso->info_text, "The output drive was not acquired exclusively."); sprintf(xorriso->info_text, "The output drive was acquired readonly.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
sprintf(xorriso->info_text, "A possible remedy is: -osirrox 'o_excl_on'"); sprintf(xorriso->info_text, "Possible remedy: -drive_access \"exclusive:unrestricted\".");
if(xorriso->outdev[0]) { strcat(xorriso->info_text," Then give up and re-acquire the drive.");
strcat(xorriso->info_text," -outdev ");
Text_shellsafe(xorriso->outdev, xorriso->info_text, 1);
}
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
if(!xorriso->outdev_is_exclusive) {
sprintf(xorriso->info_text, "If you insist in -drive_access \"shared:unrestricted\", first read man xorriso about the risks.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
}
return(0); return(0);
} }
...@@ -1026,6 +1037,25 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag) ...@@ -1026,6 +1037,25 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
Xorriso_toc_line(xorriso, flag & 8); Xorriso_toc_line(xorriso, flag & 8);
if(flag & 128) if(flag & 128)
{ret= 1; goto ex;} {ret= 1; goto ex;}
/* Report -drive_access if non-default or if long form */
respt[0]= 0;
if(flag & 2) {
if(xorriso->outdev_is_exclusive == 0 || xorriso->outdev_access == 0 ||
!(flag & 33)) {
sprintf(respt, "Drive access : %s:%s\n",
xorriso->outdev_is_exclusive ? "exclusive" : "shared",
xorriso->outdev_access == 0 ? "readonly" : "unrestricted");
}
} else {
if(xorriso->indev_is_exclusive == 0 || xorriso->indev_access == 0 ||
!(flag & 33)) {
sprintf(respt, "Drive access : %s:%s\n",
xorriso->indev_is_exclusive ? "exclusive" : "shared",
xorriso->indev_access == 0 ? "readonly" : "unrestricted");
}
}
if(respt[0])
Xorriso_toc_line(xorriso, flag & 8);
sprintf(respt, "Drive type : vendor '%s' product '%s' revision '%s'\n", sprintf(respt, "Drive type : vendor '%s' product '%s' revision '%s'\n",
dinfo[0].vendor, dinfo[0].product, dinfo[0].revision); dinfo[0].vendor, dinfo[0].product, dinfo[0].revision);
if((flag & 32) || !(flag & 1)) if((flag & 32) || !(flag & 1))
...@@ -1417,11 +1447,11 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag) ...@@ -1417,11 +1447,11 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
} }
if (disc!=NULL)
isoburn_toc_disc_free(disc);
Xorriso_process_msg_queues(xorriso,0);
ret= 1; ret= 1;
ex:; ex:;
Xorriso_process_msg_queues(xorriso,0);
if (disc!=NULL)
isoburn_toc_disc_free(disc);
return(ret); return(ret);
} }
......
...@@ -55,6 +55,7 @@ int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag) ...@@ -55,6 +55,7 @@ int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag)
"\t--devices\tprint list of available MMC drives and exit emulation", "\t--devices\tprint list of available MMC drives and exit emulation",
"\tdev=target\tpseudo-SCSI target to use as CD-Recorder", "\tdev=target\tpseudo-SCSI target to use as CD-Recorder",
"\tdrive_scsi_dev_family=sr|scd|sg\t\tselect Linux device type", "\tdrive_scsi_dev_family=sr|scd|sg\t\tselect Linux device type",
"\t--drive_not_exclusive\tdo not try to prevent use of busy drive",
"\t-v\t\tincrement verbose level by one", "\t-v\t\tincrement verbose level by one",
"\t-V\t\tincrement SCSI command transport verbose level by one", "\t-V\t\tincrement SCSI command transport verbose level by one",
"\t-checkdrive\tcheck if a driver for the drive is present", "\t-checkdrive\tcheck if a driver for the drive is present",
...@@ -266,6 +267,8 @@ no_volunteer:; ...@@ -266,6 +267,8 @@ no_volunteer:;
strcpy(dev_adr, cpt); strcpy(dev_adr, cpt);
} else if(strcmp(argv[i], "--devices")==0) { /* intentional: argv[i] */ } else if(strcmp(argv[i], "--devices")==0) { /* intentional: argv[i] */
do_scanbus= 2; do_scanbus= 2;
} else if(strcmp(argv[i], "--drive_not_exclusive") == 0) { /* intentional */
Xorriso_option_drive_access(xorriso, "shared:unrestricted", 0);
} else if(strncmp(argpt,"driveropts=", 11)==0 || } else if(strncmp(argpt,"driveropts=", 11)==0 ||
strncmp(argpt,"-driveropts=", 12)==0) { strncmp(argpt,"-driveropts=", 12)==0) {
if(strcmp(argpt+11, "help")==0) { if(strcmp(argpt+11, "help")==0) {
......
...@@ -257,6 +257,43 @@ int Xorriso_option_displacement(struct XorrisO *xorriso, char *value, int flag) ...@@ -257,6 +257,43 @@ int Xorriso_option_displacement(struct XorrisO *xorriso, char *value, int flag)
} }
/* Command -drive_access "exclusive"|"shared":"readonly"|"unrestricted" */
int Xorriso_option_drive_access(struct XorrisO *xorriso, char *mode, int flag)
{
int l;
char *npt, *cpt;
npt= cpt= mode;
for(cpt= mode; npt != NULL; cpt= npt+1) {
npt= strchr(cpt, ':');
if(npt==NULL)
l= strlen(cpt);
else
l= npt - cpt;
if(l == 0 && mode[0] != 0)
goto unknown_mode;
if(strncmp(cpt, "shared", l) == 0 && l == 6) {
xorriso->drives_exclusive= 0;
} else if(strncmp(cpt, "exclusive", l) == 0 && l == 9) {
xorriso->drives_exclusive= 1;
} else if(strncmp(cpt, "readonly", l) == 0 && l == 8) {
xorriso->drives_access= 0;
} else if(strncmp(cpt, "unrestricted", l) == 0 && l == 12) {
xorriso->drives_access= 1;
} else {
unknown_mode:;
sprintf(xorriso->info_text, "-drive_access: unknown mode '");
if(l > 0 && l < SfileadrL)
strncat(xorriso->info_text, cpt, l);
strcat(xorriso->info_text, "'");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
}
return(1);
}
/* Option -drive_class */ /* Option -drive_class */
int Xorriso_option_drive_class(struct XorrisO *xorriso, int Xorriso_option_drive_class(struct XorrisO *xorriso,
char *d_class, char *pattern, int flag) char *d_class, char *pattern, int flag)
...@@ -1737,13 +1774,16 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag) ...@@ -1737,13 +1774,16 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -drive_class \"harmless\"|\"banned\"|\"risky\"|\"clear_list\" disk_pattern", " -drive_class \"harmless\"|\"banned\"|\"risky\"|\"clear_list\" disk_pattern",
" Add a drive path pattern to one of the safety lists or make", " Add a drive path pattern to one of the safety lists or make",
" those lists empty. Defaulty entry in \"risky\" is \"/dev\".", " those lists empty. Defaulty entry in \"risky\" is \"/dev\".",
" -grow_blindly \"off\"|predicted_nwa", " -drive_access \"exclusive\"|\"shared\":\"unrestricted\"|\"readonly\"",
" Switch between modifying and blind growing.", " Enable or disable device file locking mechanisms.",
" Enable or disable status and content changes of drive.",
" -scsi_dev_family \"default\"|\"sr\"|\"scd\"|\"sg\"", " -scsi_dev_family \"default\"|\"sr\"|\"scd\"|\"sg\"",
" Linux specific: Choose device file type.", " Linux specific: Choose device file type.",
" -read_speed number[\"k/s\"|\"m/s\"|\"[x]CD\"|\"[x]DVD\"|\"[x]BD\"]", " -read_speed number[\"k/s\"|\"m/s\"|\"[x]CD\"|\"[x]DVD\"|\"[x]BD\"]",
" Set the read speed. Default is \"none\" = do not set speed", " Set the read speed. Default is \"none\" = do not set speed",
" before reading.", " before reading.",
" -grow_blindly \"off\"|predicted_nwa",
" Switch between modifying and blind growing.",
" -load \"session\"|\"track\"|\"lba\"|\"sbsector\"|\"volid\"|\"auto\" id", " -load \"session\"|\"track\"|\"lba\"|\"sbsector\"|\"volid\"|\"auto\" id",
" Load a particular (outdated) ISO session from a -dev or", " Load a particular (outdated) ISO session from a -dev or",
" -indev which hosts more than one session.", " -indev which hosts more than one session.",
......
...@@ -541,7 +541,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv, ...@@ -541,7 +541,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"close","close_damaged", "close","close_damaged",
"commit_eject","compliance","copyright_file", "commit_eject","compliance","copyright_file",
"dev","dialog","disk_dev_ino","disk_pattern","displacement", "dev","dialog","disk_dev_ino","disk_pattern","displacement",
"dummy","dvd_obs","early_stdio_test","ecma119_map","eject", "drive_access","dummy","dvd_obs","early_stdio_test","ecma119_map","eject",
"iso_nowtime","iso_rr_pattern","file_name_limit","follow","format","fs", "iso_nowtime","iso_rr_pattern","file_name_limit","follow","format","fs",
"gid","grow_blindly","hardlinks", "gid","grow_blindly","hardlinks",
"hfsplus","history","indev","in_charset","joliet", "hfsplus","history","indev","in_charset","joliet",
...@@ -684,17 +684,20 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso, ...@@ -684,17 +684,20 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"print", "print_info", "print_mark", "prompt", "sleep", "print", "print_info", "print_mark", "prompt", "sleep",
"sh_style_result", "sh_style_result",
"* Influencing opening of drives:",
"drive_access","drive_class","early_stdio_test",
"* Drive and media related inquiry actions (1):", "* Drive and media related inquiry actions (1):",
"devices", "device_links", "devices", "device_links",
"mount_opts", "mount_cmd", "session_string", "mount_opts", "mount_cmd", "session_string",
"* Influencing the behavior of image loading:", "* Influencing the behavior of image loading:",
"read_speed", "load", "displacement", "read_fs", "read_speed", "load", "displacement", "read_fs",
"drive_class", "assert_volid", "in_charset", "assert_volid", "in_charset",
"auto_charset", "hardlinks", "acl", "xattr", "md5", "for_backup", "auto_charset", "hardlinks", "acl", "xattr", "md5", "for_backup",
"ecma119_map", "ecma119_map",
"disk_dev_ino", "rom_toc_scan", "calm_drive", "ban_stdio_write", "disk_dev_ino", "rom_toc_scan", "calm_drive", "ban_stdio_write",
"early_stdio_test", "data_cache_size", "data_cache_size",
"scsi_dev_family", "iso_nowtime", "scsi_dev_family", "iso_nowtime",
"* Character sets:", "* Character sets:",
...@@ -1255,6 +1258,10 @@ next_command:; ...@@ -1255,6 +1258,10 @@ next_command:;
(*idx)++; (*idx)++;
ret= Xorriso_option_disk_pattern(xorriso, arg1, 0); ret= Xorriso_option_disk_pattern(xorriso, arg1, 0);
} else if(strcmp(cmd,"drive_access")==0) {
(*idx)++;
ret= Xorriso_option_drive_access(xorriso, arg1, 0);
} else if(strcmp(cmd,"drive_class")==0) { } else if(strcmp(cmd,"drive_class")==0) {
(*idx)+= 2; (*idx)+= 2;
ret= Xorriso_option_drive_class(xorriso, arg1, arg2, 0); ret= Xorriso_option_drive_class(xorriso, arg1, arg2, 0);
......
...@@ -2058,6 +2058,8 @@ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag) ...@@ -2058,6 +2058,8 @@ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag)
1, 1}, 1, 1},
{"DVD obs 64 kB:", 3, "DVD obs 64 kB:", "", 1, { 0, -1, -1, -1, -1, -1}, {"DVD obs 64 kB:", 3, "DVD obs 64 kB:", "", 1, { 0, -1, -1, -1, -1, -1},
1, 0}, 1, 0},
{"Drive access :", 3, "Drive access : ", ": ", 2, { 0, 1, -1, -1, -1, -1},
2, 0},
{"Drive current:", 3, "Drive current:", "", 2, { 0, 1, -1, -1, -1, -1}, {"Drive current:", 3, "Drive current:", "", 2, { 0, 1, -1, -1, -1, -1},
2, 0}, 2, 0},
{"Drive id :", 3, "Drive id :", "", 1, { 0, -1, -1, -1, -1, -1}, {"Drive id :", 3, "Drive id :", "", 1, { 0, -1, -1, -1, -1, -1},
...@@ -2771,6 +2773,7 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) ...@@ -2771,6 +2773,7 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
{ {
int is_default, no_defaults, i, ret, adr_mode, do_single, behavior; int is_default, no_defaults, i, ret, adr_mode, do_single, behavior;
int show_indev= 1, show_outdev= 1, show_dev= 0; int show_indev= 1, show_outdev= 1, show_dev= 0;
int do_drive_access, did_drive_access;
int part_table_implicit= 0; int part_table_implicit= 0;
char *line, *sfe= NULL, mode[80], *form, *treatment; char *line, *sfe= NULL, mode[80], *form, *treatment;
char *in_pt, *out_pt, *nl_charset, *local_charset, *mode_pt; char *in_pt, *out_pt, *nl_charset, *local_charset, *mode_pt;
...@@ -3814,13 +3817,20 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) ...@@ -3814,13 +3817,20 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
} }
} }
is_default= (xorriso->drives_exclusive == 1 && xorriso->drives_access == 1);
sprintf(line, "-drive_access %s:%s\n",
xorriso->drives_exclusive ? "exclusive" : "shared",
xorriso->drives_access == 0 ? "readonly" : "unrestricted");
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso, filter, fp, flag & 2);
is_default= (xorriso->linux_scsi_dev_family == 0); is_default= (xorriso->linux_scsi_dev_family == 0);
sprintf(line, "-scsi_dev_family %s\n", sprintf(line, "-scsi_dev_family %s\n",
scsi_family[xorriso->linux_scsi_dev_family & 7]); scsi_family[xorriso->linux_scsi_dev_family & 7]);
if(!(is_default && no_defaults)) if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
do_single= 0; do_single= do_drive_access= 0;
dev_filter= filter; dev_filter= filter;
if(dev_filter != NULL) { if(dev_filter != NULL) {
show_dev= Xorriso_status_filter(xorriso, filter, "-dev", 0); show_dev= Xorriso_status_filter(xorriso, filter, "-dev", 0);
...@@ -3833,43 +3843,52 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) ...@@ -3833,43 +3843,52 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(show_outdev > 0 || show_indev > 0) if(show_outdev > 0 || show_indev > 0)
do_single= 1; do_single= 1;
} }
if(xorriso->drives_exclusive != xorriso->indev_is_exclusive && if((xorriso->drives_exclusive != xorriso->indev_is_exclusive ||
xorriso->indev[0]) xorriso->drives_access != xorriso->indev_access) && xorriso->indev[0]) {
do_single= 1; do_single= 1;
else if(xorriso->drives_exclusive != xorriso->outdev_is_exclusive && do_drive_access|= 1;
xorriso->outdev[0]) }
if((xorriso->drives_exclusive != xorriso->outdev_is_exclusive ||
xorriso->drives_access != xorriso->outdev_access) &&
xorriso->outdev[0]) {
do_single= 1; do_single= 1;
do_drive_access|= 2;
}
if(strcmp(xorriso->indev, xorriso->outdev) == 0 && !do_single) { if(strcmp(xorriso->indev, xorriso->outdev) == 0 && !do_single) {
sprintf(line,"-dev %s\n", Text_shellsafe(xorriso->indev,sfe,0)); sprintf(line,"-dev %s\n", Text_shellsafe(xorriso->indev,sfe,0));
Xorriso_status_result(xorriso, dev_filter, fp, flag & 2); Xorriso_status_result(xorriso, dev_filter, fp, flag & 2);
} else { } else {
if(xorriso->drives_exclusive != xorriso->indev_is_exclusive && did_drive_access= 0;
xorriso->indev[0] && show_indev) { if((do_drive_access & 1) && xorriso->indev[0] && show_indev) {
sprintf(line,"-osirrox o_excl_%s\n", sprintf(line,"-drive_access %s:%s\n",
xorriso->indev_is_exclusive ? "on" : "off"); xorriso->indev_is_exclusive ? "exclusive" : "shared",
xorriso->indev_access == 0 ? "readonly" : "unrestricted");
Xorriso_status_result(xorriso, NULL, fp, flag & 2); Xorriso_status_result(xorriso, NULL, fp, flag & 2);
did_drive_access= 1;
} }
sprintf(line,"-indev %s\n", Text_shellsafe(xorriso->indev,sfe,0)); sprintf(line,"-indev %s\n", Text_shellsafe(xorriso->indev,sfe,0));
Xorriso_status_result(xorriso, dev_filter, fp, flag & 2); Xorriso_status_result(xorriso, dev_filter, fp, flag & 2);
if(xorriso->drives_exclusive != xorriso->indev_is_exclusive && if(did_drive_access) {
xorriso->indev[0] && show_indev) { sprintf(line,"-drive_access %s:%s\n",
sprintf(line,"-osirrox o_excl_%s\n", xorriso->drives_exclusive ? "exclusive" : "shared",
xorriso->drives_exclusive ? "on" : "off"); xorriso->drives_access == 0 ? "readonly" : "unrestricted");
Xorriso_status_result(xorriso, NULL, fp, flag & 2); Xorriso_status_result(xorriso, NULL, fp, flag & 2);
} }
if(xorriso->drives_exclusive != xorriso->outdev_is_exclusive && did_drive_access= 0;
xorriso->outdev[0] && show_outdev) { if((do_drive_access & 2) && xorriso->outdev[0] && show_outdev) {
sprintf(line,"-osirrox o_excl_%s\n", sprintf(line,"-drive_access %s:%s\n",
xorriso->outdev_is_exclusive ? "on" : "off"); xorriso->outdev_is_exclusive ? "exclusive" : "shared",
xorriso->outdev_access == 0 ? "readonly" : "unrestricted");
Xorriso_status_result(xorriso, NULL, fp, flag & 2); Xorriso_status_result(xorriso, NULL, fp, flag & 2);
did_drive_access= 1;
} }
sprintf(line,"-outdev %s\n", Text_shellsafe(xorriso->outdev,sfe,0)); sprintf(line,"-outdev %s\n", Text_shellsafe(xorriso->outdev,sfe,0));
Xorriso_status_result(xorriso, dev_filter, fp, flag & 2); Xorriso_status_result(xorriso, dev_filter, fp, flag & 2);
if(xorriso->drives_exclusive != xorriso->outdev_is_exclusive && if(did_drive_access) {
xorriso->outdev[0] && show_outdev) { sprintf(line,"-drive_access %s:%s\n",
sprintf(line,"-osirrox o_excl_%s\n", xorriso->drives_exclusive ? "exclusive" : "shared",
xorriso->drives_exclusive ? "on" : "off"); xorriso->drives_access == 0 ? "readonly" : "unrestricted");
Xorriso_status_result(xorriso, NULL, fp, flag & 2); Xorriso_status_result(xorriso, NULL, fp, flag & 2);
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH XORRECORD 1 "Version 1.5.1, Nov 11, 2018" .TH XORRECORD 1 "Version 1.5.1, Sep 04, 2019"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
...@@ -531,6 +531,16 @@ Afterwards end emulation without performing any drive operation. ...@@ -531,6 +531,16 @@ Afterwards end emulation without performing any drive operation.
Only if used as first command line argument this option Only if used as first command line argument this option
prevents reading and interpretation of startup files. See section FILES below. prevents reading and interpretation of startup files. See section FILES below.
.TP .TP
\fB--drive_not_exclusive\fR
This option disables the use of device file locking mechanisms when acquiring
the drive. On GNU/Linux the locking is done by open(O_EXCL), on FreeBSD by
flock(LOCK_EX).
.br
Be aware that it can cause problems if you use a drive which is mounted,
or opened by some other process, or guarded by /dev/pktcdvd*.
Make sure that other users of the drive do not cause drive activities
while a xorrecord burn run is going on.
.TP
\fBdrive_scsi_dev_family=sr|scd|sg|default\fR \fBdrive_scsi_dev_family=sr|scd|sg|default\fR
GNU/Linux specific: GNU/Linux specific:
.br .br
...@@ -870,7 +880,7 @@ Thomas Schmitt <scdbackup@gmx.net> ...@@ -870,7 +880,7 @@ Thomas Schmitt <scdbackup@gmx.net>
.br .br
for libburnia\-project.org for libburnia\-project.org
.SH COPYRIGHT .SH COPYRIGHT
Copyright (c) 2011 \- 2018 Thomas Schmitt Copyright (c) 2011 \- 2019 Thomas Schmitt
.br .br
Permission is granted to distribute this text freely. It shall only be Permission is granted to distribute this text freely. It shall only be
modified in sync with the technical properties of xorriso. If you make use modified in sync with the technical properties of xorriso. If you make use
......
This diff is collapsed.
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps @c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1) @c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRECORD 1 "Version 1.5.1, Nov 11, 2018" @c man .TH XORRECORD 1 "Version 1.5.1, Sep 04, 2019"
@c man .\" Please adjust this date whenever revising the manpage. @c man .\" Please adjust this date whenever revising the manpage.
@c man .\" @c man .\"
@c man .\" Some roff macros, for reference: @c man .\" Some roff macros, for reference:
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
@copying @copying
xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso
Copyright @copyright{} 2011 - 2018 Thomas Schmitt Copyright @copyright{} 2011 - 2019 Thomas Schmitt
@quotation @quotation
Permission is granted to distrubute this text freely. Permission is granted to distrubute this text freely.
...@@ -736,6 +736,18 @@ Afterwards end emulation without performing any drive operation. ...@@ -736,6 +736,18 @@ Afterwards end emulation without performing any drive operation.
Only if used as first command line argument this option Only if used as first command line argument this option
prevents reading and interpretation of startup files. See section FILES below. prevents reading and interpretation of startup files. See section FILES below.
@c man .TP @c man .TP
@item @minus{}@minus{}drive_not_exclusive
@kindex @minus{}@minus{}drive_not_exclusive use drive even if busy
@cindex Drive, use even if busy, @minus{}@minus{}drive_not_exclusive
This option disables the use of device file locking mechanisms when acquiring
the drive. On GNU/Linux the locking is done by open(O_EXCL), on FreeBSD by
flock(LOCK_EX).
@*
Be aware that it can cause problems if you use a drive which is mounted,
or opened by some other process, or guarded by /dev/pktcdvd*.
Make sure that other users of the drive do not cause drive activities
while a xorrecord burn run is going on.
@c man .TP
@item drive_scsi_dev_family=sr|scd|sg|default @item drive_scsi_dev_family=sr|scd|sg|default
@kindex drive_scsi_dev_family= Linux device type to be used @kindex drive_scsi_dev_family= Linux device type to be used
@cindex Drive, Linux device type, drive_scsi_dev_family @cindex Drive, Linux device type, drive_scsi_dev_family
...@@ -1185,7 +1197,7 @@ Thomas Schmitt <scdbackup@@gmx.net> ...@@ -1185,7 +1197,7 @@ Thomas Schmitt <scdbackup@@gmx.net>
for libburnia-project.org for libburnia-project.org
@c man .SH COPYRIGHT @c man .SH COPYRIGHT
@section Copyright @section Copyright
Copyright (c) 2011 - 2018 Thomas Schmitt Copyright (c) 2011 - 2019 Thomas Schmitt
@* @*
Permission is granted to distribute this text freely. It shall only be Permission is granted to distribute this text freely. It shall only be
modified in sync with the technical properties of xorriso. If you make use modified in sync with the technical properties of xorriso. If you make use
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Version 1.5.1, Apr 15, 2019" .TH XORRISO 1 "Version 1.5.1, Sep 04, 2019"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
...@@ -690,6 +690,64 @@ apply. See above paragraph "Libburn drives". ...@@ -690,6 +690,64 @@ apply. See above paragraph "Libburn drives".
An empty address string "" gives up the current output drive An empty address string "" gives up the current output drive
without acquiring a new one. No writing is possible without an output drive. without acquiring a new one. No writing is possible without an output drive.
.TP .TP
\fB\-drive_class\fR "harmless"|"banned"|"caution"|"clear_list" disk_pattern
Add a drive path pattern to one of the safety lists or make those lists empty.
There are three lists defined which get tested in the following sequence:
.br
If a drive address path matches the "harmless" list then the drive will be
accepted. If it is not a MMC device then the prefix "stdio:" will be prepended
automatically. This list is empty by default.
.br
Else if the path matches the "banned" list then the drive will not be
accepted by \fBxorriso\fR but rather lead to a FAILURE event.
This list is empty by default.
.br