New option -mount_opts
This commit is contained in:
@ -6832,7 +6832,12 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
|
||||
xorriso->do_restore_sort_lba ? "sort_lba_on" : "sort_lba_off",
|
||||
xorriso->drives_exclusive ? "o_excl_on" : "o_excl_off"
|
||||
);
|
||||
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
|
||||
is_default= (xorriso->mount_opts_flag == 0);
|
||||
sprintf(line,"-mount_opts %s\n",
|
||||
xorriso->mount_opts_flag & 1 ? "shared" : "exclusive");
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
|
||||
@ -12222,7 +12227,8 @@ too_long:;
|
||||
if(sys_code == 1) { /* Linux */
|
||||
sprintf(form,
|
||||
"%smount -t iso9660 -o %snodev,noexec,nosuid,ro,sbsector=%%sbsector%% %%device%% %s",
|
||||
(flag & 1 ? "/bin/" : ""), (reg_file ? "loop," : ""),
|
||||
(flag & 1 ? "/bin/" : ""),
|
||||
(reg_file || (xorriso->mount_opts_flag & 1) ? "loop," : ""),
|
||||
Text_shellsafe(cpt, sfe, 0));
|
||||
is_safe= 1;
|
||||
} else if(sys_code == 2) { /* FreeBSD */
|
||||
@ -15950,6 +15956,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
|
||||
" -mount_cmd drive entity id path",
|
||||
" Print to result channel a command suitable to mount the",
|
||||
" depicted entity (see -load) at the given directory path.",
|
||||
" -mount_opts \"exclusive\"|\"shared\"",
|
||||
" Set options for -mount and -mount_cmd.",
|
||||
" -session_string drive entity id \"linux:\"path|\"freebsd:\"path|form",
|
||||
" Print foreign OS command or custom line.",
|
||||
"",
|
||||
@ -17098,6 +17106,41 @@ int Xorriso_option_mount(struct XorrisO *xorriso, char *dev, char *adr_mode,
|
||||
}
|
||||
|
||||
|
||||
/* Option -mount_opts option[:...] */
|
||||
int Xorriso_option_mount_opts(struct XorrisO *xorriso, char *mode, int flag)
|
||||
{
|
||||
int was, l;
|
||||
char *cpt, *npt;
|
||||
|
||||
was= xorriso->mount_opts_flag;
|
||||
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)
|
||||
goto unknown_mode;
|
||||
if(strncmp(cpt, "shared", l)==0) {
|
||||
xorriso->mount_opts_flag|= 1;
|
||||
} else if(strncmp(cpt, "exclusive", l)==0) {
|
||||
xorriso->mount_opts_flag&= ~1;
|
||||
} else {
|
||||
unknown_mode:;
|
||||
if(l<SfileadrL)
|
||||
sprintf(xorriso->info_text, "-mount_opts: unknown option '%s'", cpt);
|
||||
else
|
||||
sprintf(xorriso->info_text, "-mount_opts: oversized parameter (%d)",l);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
xorriso->mount_opts_flag= was;
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/* Option -mv alias -mvi */
|
||||
int Xorriso_option_mvi(struct XorrisO *xorriso, int argc, char **argv,
|
||||
int *idx, int flag)
|
||||
@ -19209,7 +19252,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
|
||||
"iso_rr_pattern","follow","format","fs","gid","grow_blindly","hardlinks",
|
||||
"history","indev","in_charset","joliet",
|
||||
"list_delimiter","list_profiles","local_charset",
|
||||
"mark","md5","not_leaf","not_list","not_mgt",
|
||||
"mark","md5","mount_opts","not_leaf","not_list","not_mgt",
|
||||
"options_from_file","osirrox","outdev","out_charset","overwrite",
|
||||
"pacifier","padding","path_list","pathspecs","pkt_output","print","prompt",
|
||||
"prog","prog_help","publisher","quoted_not_list","quoted_path_list",
|
||||
@ -19746,6 +19789,10 @@ next_command:;
|
||||
argv[(*idx)-2], argv[(*idx)-1],
|
||||
(strcmp(cmd, "mount_cmd") == 0));
|
||||
|
||||
} else if(strcmp(cmd, "mount_opts")==0) {
|
||||
(*idx)++;
|
||||
ret= Xorriso_option_mount_opts(xorriso, arg1, 0);
|
||||
|
||||
} else if(strcmp(cmd,"mv")==0 || strcmp(cmd,"mvi")==0) {
|
||||
ret= Xorriso_option_mvi(xorriso, argc, argv, idx, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user