New -as mkisofs option -dir-mode
This commit is contained in:
@ -582,12 +582,14 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
|
||||
" -o FILE, -output FILE Set output file name",
|
||||
" -m GLOBFILE, -exclude GLOBFILE",
|
||||
" Exclude file name",
|
||||
" -x FILE, -old-exclude FILE Exclude file name",
|
||||
" -exclude-list FILE File with list of file names to exclude",
|
||||
" -pad Pad output by 300k (default)",
|
||||
" -no-pad Do not pad output",
|
||||
" -M FILE, -prev-session FILE Set path to previous session to merge",
|
||||
" -C PARAMS, -cdrecord-params PARAMS",
|
||||
" Magic paramters from cdrecord",
|
||||
" -dir-mode mode Make the mode of all directories this mode.",
|
||||
" -path-list FILE File with list of pathnames to process",
|
||||
" --quoted_path_list FILE File with list of quoted pathnames to process",
|
||||
" -print-size Print estimated filesystem size and exit",
|
||||
@ -733,14 +735,14 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
|
||||
{
|
||||
int ret, i, j, was_path= 0, was_other_option= 0, mem_graft_points, mem;
|
||||
int do_print_size= 0, fd, idx, iso_level= 0, no_emul_boot= 0;
|
||||
int option_b= 0, was_failure= 0, fret, lower_r= 0, zero= 0;
|
||||
int option_b= 0, was_failure= 0, fret, lower_r= 0, zero= 0, dir_mode= -1;
|
||||
mode_t mode_and, mode_or;
|
||||
int with_boot_image= 0, with_cat_path= 0;
|
||||
int *weight_list= NULL, weight_count= 0;
|
||||
int *delay_opt_list= NULL, delay_opt_count= 0;
|
||||
char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL];
|
||||
char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt;
|
||||
char *boot_path;
|
||||
static char *lower_r_args[3]= {"/", "-exec", "mkisofs_r"};
|
||||
static char *sort_weight_args[4]= {"", "-exec", "sort_weight", ""};
|
||||
|
||||
strcpy(ra_text, xorriso->report_about_text);
|
||||
@ -1171,6 +1173,16 @@ not_enough_args:;
|
||||
goto not_enough_args;
|
||||
i++;
|
||||
/* was already handled in first argument scan */;
|
||||
} else if(strcmp(argv[i], "-dir-mode") == 0) {
|
||||
if(i+1>=argc)
|
||||
goto not_enough_args;
|
||||
i++;
|
||||
ret= Xorriso_convert_modstring(xorriso, "-as mkisofs -dir-mode",
|
||||
argv[i], &mode_and, &mode_or, 0);
|
||||
if(ret<=0)
|
||||
goto problem_handler_2;
|
||||
dir_mode= mode_or;
|
||||
|
||||
} else if(argv[i][0]=='-' && argv[i][1]!=0) {
|
||||
sprintf(xorriso->info_text, "-as %s: Unknown option %s",
|
||||
whom, Text_shellsafe(argv[i], sfe, 0));
|
||||
@ -1225,11 +1237,21 @@ problem_handler_2:;
|
||||
goto ex;
|
||||
}
|
||||
if(lower_r) {
|
||||
static char *lower_r_args[3]= {"/", "-exec", "mkisofs_r"};
|
||||
zero= 0;
|
||||
ret= Xorriso_option_find(xorriso, 3, lower_r_args, &zero, 2);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
}
|
||||
if(dir_mode >= 0) {
|
||||
static char *dir_mode_args[6]= {"/", "-type", "d", "-exec", "chmod", ""};
|
||||
zero= 0;
|
||||
sprintf(sfe, "0%o", (unsigned int) dir_mode);
|
||||
dir_mode_args[5]= sfe;
|
||||
ret= Xorriso_option_find(xorriso, 6, dir_mode_args, &zero, 2);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
}
|
||||
|
||||
for(j= 0; j < weight_count; j++) {
|
||||
i= weight_list[j];
|
||||
|
Reference in New Issue
Block a user