New find action mkisofs_r and emulation -as mkisofs -r

master
Thomas Schmitt 13 years ago
parent cc0ddbeb10
commit 2bd7307dfa
  1. 18
      xorriso/xorriso.1
  2. 56
      xorriso/xorriso.c
  3. 136
      xorriso/xorriso.info
  4. 20
      xorriso/xorriso.texi
  5. 1
      xorriso/xorriso_private.h
  6. 2
      xorriso/xorriso_timestamp.h
  7. 34
      xorriso/xorrisoburn.c

@ -1632,6 +1632,13 @@ applies or removes filters.
.br
E.g.: -exec set_filter --zisofs --
.br
\fBmkisofs_r\fR
applies the rules of mkisofs -r to the file object:
.br
user id and group id become 0, all r-permissions get granted, all w denied.
If there is any x-permission, then all three x get granted.
s- and t-bits get removed.
.br
\fBshow_stream\fR
shows the content stream chain of a data file.
.br
@ -2000,7 +2007,7 @@ Available types are:
"uuid" sets a timestring that overrides "m" time literally.
.br
It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with
YYYY between 1970 and 2999.
YYYY between 1970 and 2999. Time zone is GMT.
It is supposed to match this GRUB line:
.br
search --fs-uuid --set YYYY-MM-DD-hh-mm-ss-cc
@ -3060,9 +3067,9 @@ Personality "\fBmkisofs\fR" accepts the options listed with:
.br
-as mkisofs -help --
.br
Among them: -R (always on), -J, -o, -M, -C, -path-list, -m, -exclude-list,
Among them: -R (always on), -r, -J, -o, -M, -C, -path-list, -m, -exclude-list,
-f, -print-size, -pad, -no-pad, -V, -v, -version, -graft-points, -z,
-no-emul-boot, -b, -c, -boot-info-table, -boot-load-size, -input-charset,
-no-emul-boot, -b, -c, -boot-info-table, -boot-load-size, -input-charset, -G,
-output-charset, pathspecs as with xorriso -add.
A lot of options are not supported and lead to failure of the mkisofs
emulation. Some are ignored, but better do not rely on this tolerance.
@ -3097,6 +3104,11 @@ same name and hardcoded argument "on", e.g. -acl "on".
Explicit arguments are expected by --stdio_sync
and --scdbackup_tag.
.br
Adopted from grub-mkisofs are --protective-msdos-label
(see -boot_image grub partition_table=on) and
--modification-date=YYYYMMDDhhmmsscc
(see -volume_date uuid).
.br
Personalites "\fBxorrisofs\fR", "\fBgenisoimage\fR",
and "\fBgenisofs\fR" are aliases for "mkisofs".
.br

@ -11106,7 +11106,7 @@ int Xorriso_genisofs_ignore(struct XorrisO *xorriso, char *whom,
"-allow-leading-dots", "-ldots", "-allow-lowercase", "-allow-multidot",
"-cache-inodes", "-no-cache-inodes", "-check-oldnames", "-d", "-D",
"-joliet-long", "-l", "-L", "-max-iso9660-filenames", "-N", "-nobak",
"-no-bak", "-force-rr", "-r", "-relaxed-filenames", "-T", "-U",
"-no-bak", "-force-rr", "-relaxed-filenames", "-T", "-U",
"-no-iso-translate",
""
};
@ -11139,7 +11139,7 @@ no_volunteer:;
int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
{
static char helptext[][80]= {
static char helptext[][160]= {
"Usage: xorriso -as mkisofs [options] file...",
"Note: This is not mkisofs. See xorriso -help, xorriso -version, man xorriso",
"Options:",
@ -11164,6 +11164,7 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" -print-size Print estimated filesystem size and exit",
" -quiet Run quietly",
" -R, -rock Generate Rock Ridge directory information",
" -r, -rational-rock Generate rationalized Rock Ridge directory information",
" --hardlinks Record eventual hard link relations of files",
" --acl Record eventual ACLs of files",
" --xattr Record eventual user space xattr of files",
@ -11217,9 +11218,10 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
{
int ret, i, 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;
int option_b= 0, was_failure= 0, fret, lower_r= 0, zero= 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;
static char *lower_r_args[3] = {"/", "-exec", "mkisofs_r"};
strcpy(ra_text, xorriso->report_about_text);
@ -11333,20 +11335,6 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
ret= Xorriso_option_boot_image(xorriso, "isolinux", sfe, 0);
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "--embedded-boot")==0 ||
strcmp(argv[i], "-G") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
ret= Xorriso_set_system_area_path(xorriso, argv[i], 0);
if(ret <= 0)
goto ex;
} else if(strcmp(argv[i], "--protective-msdos-label")==0) {
xorriso->system_area_options|= 1;
} else if(strncmp(argv[i], "--modification-date=", 20)==0) {
ret= Xorriso_option_volume_date(xorriso, "uuid", argv[i] + 20, 0);
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "-input-charset")==0) {
if(i+1>=argc)
goto not_enough_args;
@ -11494,6 +11482,8 @@ illegal_c:;
} else if(strcmp(argv[i], "-R")==0 || strcmp(argv[i], "-rock")==0) {
/* ok */;
} else if(strcmp(argv[i], "-r")==0 || strcmp(argv[i], "-rational-rock")==0){
lower_r= 1;
} else if(strcmp(argv[i], "-J")==0 || strcmp(argv[i], "-joliet")==0) {
xorriso->do_joliet= 1;
} else if(strcmp(argv[i], "-graft-points")==0) {
@ -11612,13 +11602,20 @@ not_enough_args:;
} else if(strncmp(argv[i], "isolinux_mbr=", 13)==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--embedded-boot")==0 ||
strcmp(argv[i], "-generic-boot")==0 ||
strcmp(argv[i], "-G") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
/* was already handled in first argument scan */;
ret= Xorriso_set_system_area_path(xorriso, argv[i], 0);
if(ret <= 0)
goto ex;
} else if(strcmp(argv[i], "--protective-msdos-label")==0) {
/* was already handled in first argument scan */;
xorriso->system_area_options|= 1;
} else if(strncmp(argv[i], "--modification-date=", 20)==0) {
/* was already handled in first argument scan */;
ret= Xorriso_option_volume_date(xorriso, "uuid", argv[i] + 20, 0);
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "-boot-load-size") == 0) {
i++;
/* was already handled in first argument scan */;
@ -11695,6 +11692,11 @@ problem_handler_2:;
if(ret<=0)
goto ex;
}
if(lower_r) {
ret= Xorriso_option_find(xorriso, 3, lower_r_args, &zero, 2);
if(ret<=0)
goto ex;
}
ret= !was_failure;
ex:;
@ -16071,6 +16073,8 @@ not_enough_exec_arguments:;
Xorriso_pacifier_reset(xorriso, 0);
mem_lut= xorriso->last_update_time;
}
} else if(strcmp(cpt, "mkisofs_r")==0) {
Findjob_set_action_target(job, 37, NULL, 0);
} else {
sprintf(xorriso->info_text, "-find -exec: unknown action %s",
Text_shellsafe(argv[i], sfe, 0));
@ -16605,7 +16609,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" rm, rm_r, compare, update, report_damage, report_lba,",
" getfacl, setfacl, getfattr, setfattr, get_any_xattr,",
" get_md5, check_md5, make_md5, set_filter, show_stream,",
" find.",
" mkisofs_r, find.",
" params are their arguments except iso_rr_path.",
" -mkdir iso_rr_path [...]",
" Create empty directories if they do not exist yet.",
@ -16818,9 +16822,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Preset options for runs of -check_media and -extract_cut.",
"",
"Compatibility emulation (argument list may be ended by list delimiter --):",
" -as mkisofs [-help|-version|-o|-R|-J|-V|-P|-f|-m|-exclude-list|-no-pad|",
" -M|-C|-graft-points|-path-list|pathspecs|-z|",
" -no-emul-boot|-b|-c|-boot-info-table|-boot-load-size]",
" -as mkisofs [-help|-version|-o|-R|-r|-J|-V|-P|-f|-m|-exclude-list|",
" -no-pad|-M|-C|-graft-points|-path-list|pathspecs|-z|",
" -no-emul-boot|-b|-c|-boot-info-table|-boot-load-size|-G]",
" Perform some mkisofs gestures, understand pathspecs as mkisofs",
" does. Commit happens outside emulation at usual occasions.",
" -as cdrecord [-help|-v|dev=|speed=|blank=|fs=|-eject|-atip|padsize=|-multi]",
@ -19704,7 +19708,9 @@ int Xorriso_option_volume_date(struct XorrisO *xorriso,
if(timestring[0] == 0 || strcmp(timestring, "default") == 0 ||
strcmp(timestring, "overridden") == 0 ){
t= 0;
} else if(strcmp(time_type, "uuid") != 0) {
} else if(strcmp(time_type, "uuid") == 0) {
t= time(NULL); /* Just to have some that is not 0 */
} else {
ret= Xorriso_convert_datestring(xorriso, "-volume_date",
"m", timestring, &t_type, &t, 0);
if(ret<=0)

@ -1,5 +1,5 @@
This is xorriso.info, produced by makeinfo version 4.8 from
./xorriso.texi.
This is xorriso/xorriso.info, produced by makeinfo version 4.8 from
./xorriso/xorriso.texi.
INFO-DIR-SECTION Archiving
START-INFO-DIR-ENTRY
@ -1473,6 +1473,11 @@ File: xorriso.info, Node: CmdFind, Next: Filter, Prev: Manip, Up: Options
set_filter
applies or removes filters.
E.g.: -exec set_filter --zisofs --
mkisofs_r
applies the rules of mkisofs -r to the file object:
user id and group id become 0, all r-permissions get granted,
all w denied. If there is any x-permission, then all three x
get granted. s- and t-bits get removed.
show_stream
shows the content stream chain of a data file.
find
@ -1795,8 +1800,8 @@ will be written according to the setting of option -acl.
"f" time since when the volume is effectively valid.
"uuid" sets a timestring that overrides "m" time literally.
It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc,
with YYYY between 1970 and 2999. It is supposed to match this
GRUB line:
with YYYY between 1970 and 2999. Time zone is GMT. It is supposed
to match this GRUB line:
search -fs-uuid -set YYYY-MM-DD-hh-mm-ss-cc
E.g. 2010040711405800 is 7 Apr 2010 11:40:58 (+0 centiseconds).
Timestrings for the other types may be given as with option
@ -2748,10 +2753,10 @@ programs trigger comparable actions.
Personality "*mkisofs*" accepts the options listed with:
-as mkisofs -help --
Among them: -R (always on), -J, -o, -M, -C, -path-list, -m,
Among them: -R (always on), -r, -J, -o, -M, -C, -path-list, -m,
-exclude-list, -f, -print-size, -pad, -no-pad, -V, -v, -version,
-graft-points, -z, -no-emul-boot, -b, -c, -boot-info-table,
-boot-load-size, -input-charset, -output-charset, pathspecs as
-boot-load-size, -input-charset, -G, -output-charset, pathspecs as
with xorriso -add. A lot of options are not supported and lead to
failure of the mkisofs emulation. Some are ignored, but better do
not rely on this tolerance.
@ -2780,6 +2785,9 @@ programs trigger comparable actions.
xorriso options with the same name and hardcoded argument "on",
e.g. -acl "on". Explicit arguments are expected by --stdio_sync
and --scdbackup_tag.
Adopted from grub-mkisofs are --protective-msdos-label (see
-boot_image grub partition_table=on) and
--modification-date=YYYYMMDDhhmmsscc (see -volume_date uuid).
Personalites "*xorrisofs*", "*genisoimage*", and "*genisofs*" are
aliases for "mkisofs".
If xorriso is started with one of the leafnames "xorrisofs",
@ -3665,7 +3673,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -out_charset sets output character set: SetWrite. (line 114)
* -outdev aquires a drive for output: AqDrive. (line 29)
* -overwrite enables overwriting in ISO: SetInsert. (line 127)
* -pacifier controls pacifier text form: Emulation. (line 92)
* -pacifier controls pacifier text form: Emulation. (line 95)
* -padding sets amount of image padding: SetWrite. (line 197)
* -page set terminal geometry: DialogCtl. (line 15)
* -paste_in copies file into disk file: Restore. (line 117)
@ -3692,7 +3700,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -rollback discards pending changes: Writing. (line 9)
* -rollback_end ends program without writing: Scripting. (line 125)
* -rom_toc_scan searches for sessions: Loading. (line 189)
* -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 102)
* -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 105)
* -scsi_log reports SCSI commands: Scripting. (line 113)
* -session_log logs written sessions: Scripting. (line 104)
* -session_string composes session info line: Inquiry. (line 56)
@ -3748,11 +3756,11 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Backslash Interpretation, _definition: Processing. (line 49)
* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 168)
* Backup, enable features, -for_backup: Loading. (line 163)
* Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 102)
* Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 105)
* Blank media, _definition: Media. (line 25)
* Blind growing, _definition: Methods. (line 40)
* Bootability, control, -boot_image: Bootable. (line 20)
* cdrecord, Emulation: Emulation. (line 59)
* cdrecord, Emulation: Emulation. (line 62)
* Character Set, _definition: Charset. (line 6)
* Character Set, for input, -in_charset: Loading. (line 73)
* Character Set, for input/output, -charset: Charset. (line 43)
@ -3787,9 +3795,9 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Drive, write and eject, -commit_eject: Writing. (line 40)
* El Torito, _definiton: Extras. (line 19)
* Emulation, -as: Emulation. (line 13)
* Emulation, cdrecord, -as: Emulation. (line 59)
* Emulation, cdrecord, -as: Emulation. (line 62)
* Emulation, mkisofs, -as: Emulation. (line 16)
* Emulation, pacifier form, -pacifier: Emulation. (line 92)
* Emulation, pacifier form, -pacifier: Emulation. (line 95)
* Examples: Examples. (line 6)
* Filter, _definition: Filter. (line 6)
* Filter, apply to file tree, -set_filter_r: Filter. (line 84)
@ -3958,57 +3966,57 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top

Tag Table:
Node: Top420
Node: Overview1324
Node: Model3201
Node: Media6081
Node: Methods8511
Node: Drives11058
Node: Extras14324
Node: Processing17455
Node: Dialog20951
Node: Options22608
Node: AqDrive24176
Node: Loading27082
Node: Insert39517
Node: SetInsert47874
Node: Manip56441
Node: CmdFind64317
Node: Filter72875
Node: Writing77224
Node: SetWrite83513
Node: Bootable93406
Node: Charset98533
Node: Exception101287
Node: DialogCtl105802
Node: Inquiry108147
Node: Navigate112287
Node: Verify119641
Node: Restore128061
Node: Emulation134717
Node: Scripting140743
Node: Frontend146305
Node: Examples147506
Node: ExDevices148675
Node: ExCreate149157
Node: ExDialog150431
Node: ExGrowing151693
Node: ExModifying152495
Node: ExBootable152996
Node: ExCharset153543
Node: ExPseudo154371
Node: ExCdrecord155265
Node: ExMkisofs155580
Node: ExGrowisofs156583
Node: ExException157707
Node: ExTime158161
Node: ExIncBackup158620
Node: ExRestore162092
Node: ExRecovery163061
Node: Files163626
Node: Seealso164213
Node: Legal164737
Node: CommandIdx165659
Node: ConceptIdx178960
Node: Top436
Node: Overview1340
Node: Model3217
Node: Media6097
Node: Methods8527
Node: Drives11074
Node: Extras14340
Node: Processing17471
Node: Dialog20967
Node: Options22624
Node: AqDrive24192
Node: Loading27098
Node: Insert39533
Node: SetInsert47890
Node: Manip56457
Node: CmdFind64333
Node: Filter73162
Node: Writing77511
Node: SetWrite83800
Node: Bootable93711
Node: Charset98838
Node: Exception101592
Node: DialogCtl106107
Node: Inquiry108452
Node: Navigate112592
Node: Verify119946
Node: Restore128366
Node: Emulation135022
Node: Scripting141234
Node: Frontend146796
Node: Examples147997
Node: ExDevices149166
Node: ExCreate149648
Node: ExDialog150922
Node: ExGrowing152184
Node: ExModifying152986
Node: ExBootable153487
Node: ExCharset154034
Node: ExPseudo154862
Node: ExCdrecord155756
Node: ExMkisofs156071
Node: ExGrowisofs157074
Node: ExException158198
Node: ExTime158652
Node: ExIncBackup159111
Node: ExRestore162583
Node: ExRecovery163552
Node: Files164117
Node: Seealso164704
Node: Legal165228
Node: CommandIdx166150
Node: ConceptIdx179451

End Tag Table

@ -44,7 +44,7 @@
@c man .\" First parameter, NAME, should be all caps
@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 .TH XORRISO 1 "Apr 07, 2010"
@c man .TH XORRISO 1 "Apr 08, 2010"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -1997,6 +1997,13 @@ applies or removes filters.
@*
E.g.: -exec set_filter @minus{}@minus{}zisofs @minus{}@minus{}
@*
@item mkisofs_r
applies the rules of mkisofs -r to the file object:
@*
user id and group id become 0, all r-permissions get granted, all w denied.
If there is any x-permission, then all three x get granted.
s- and t-bits get removed.
@*
@item show_stream
shows the content stream chain of a data file.
@*
@ -2425,7 +2432,7 @@ Available types are:
"uuid" sets a timestring that overrides "m" time literally.
@*
It must consist of 16 decimal digits which form YYYYMMDDhhmmsscc, with
YYYY between 1970 and 2999.
YYYY between 1970 and 2999. Time zone is GMT.
It is supposed to match this GRUB line:
@*
search --fs-uuid --set YYYY-MM-DD-hh-mm-ss-cc
@ -3694,9 +3701,9 @@ Personality "@strong{mkisofs}" accepts the options listed with:
@*
-as mkisofs -help @minus{}@minus{}
@*
Among them: -R (always on), -J, -o, -M, -C, -path-list, -m, -exclude-list,
Among them: -R (always on), -r, -J, -o, -M, -C, -path-list, -m, -exclude-list,
-f, -print-size, -pad, -no-pad, -V, -v, -version, -graft-points, -z,
-no-emul-boot, -b, -c, -boot-info-table, -boot-load-size, -input-charset,
-no-emul-boot, -b, -c, -boot-info-table, -boot-load-size, -input-charset, -G,
-output-charset, pathspecs as with xorriso -add.
A lot of options are not supported and lead to failure of the mkisofs
emulation. Some are ignored, but better do not rely on this tolerance.
@ -3731,6 +3738,11 @@ same name and hardcoded argument "on", e.g. -acl "on".
Explicit arguments are expected by @minus{}@minus{}stdio_sync
and @minus{}@minus{}scdbackup_tag.
@*
Adopted from grub-mkisofs are @minus{}@minus{}protective-msdos-label
(see -boot_image grub partition_table=on) and
@minus{}@minus{}modification-date=YYYYMMDDhhmmsscc
(see -volume_date uuid).
@*
@c Quite special is isolinux_mbr= (see -boot_image isolinux isohybrid=).
@c @*
Personalites "@strong{xorrisofs}", "@strong{genisoimage}",

@ -1005,6 +1005,7 @@ struct FindjoB {
34= get_md5
35= check_md5
36= make_md5
37= mkisofs_r
*/
int action;
int prune;

@ -1 +1 @@
#define Xorriso_timestamP "2010.04.07.202559"
#define Xorriso_timestamP "2010.04.08.185744"

@ -1695,10 +1695,10 @@ int Xorriso_set_system_area(struct XorrisO *xorriso,
{
int ret;
FILE *fp= NULL;
char buf[32768];
char buf[32768], *bufpt= NULL;
if(xorriso->system_area_disk_path[0] == 0)
return(1);
goto do_set;
ret= Xorriso_afile_fopen(xorriso, xorriso->system_area_disk_path,
"rb", &fp, 0);
@ -1715,7 +1715,11 @@ int Xorriso_set_system_area(struct XorrisO *xorriso,
{ret= 0; goto ex;}
}
}
ret= isoburn_igopt_set_system_area(sopts, buf, xorriso->system_area_options);
bufpt= buf;
do_set:;
ret= isoburn_igopt_set_system_area(sopts, bufpt,
xorriso->system_area_options);
if(ret != ISO_SUCCESS) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, "", ret,
@ -7828,6 +7832,26 @@ int Xorriso_widen_hardlink(struct XorrisO *xorriso, void * boss_iter,
}
/*
Apply the effect of mkisofs -r to a single node
*/
int Xorriso_mkisofs_lower_r(struct XorrisO *xorriso, IsoNode *node, int flag)
{
mode_t perms;
perms= iso_node_get_permissions(node);
iso_node_set_uid(node, (uid_t) 0);
iso_node_set_gid(node, (gid_t) 0);
perms|= S_IRUSR | S_IRGRP | S_IROTH;
perms&= ~(S_IWUSR | S_IWGRP | S_IWOTH);
if(perms & (S_IXUSR | S_IXGRP | S_IXOTH))
perms|= (S_IXUSR | S_IXGRP | S_IXOTH);
perms&= ~(S_ISUID | S_ISGID | S_ISVTX);
iso_node_set_permissions(node, perms);
return(1);
}
/* @param flag bit0= not a command parameter (directory iteration or recursion)
bit1= do not count deleted files with rm and rm_r
@return <=0 error,
@ -7950,9 +7974,11 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
if(ret >= 0)
ret= 1;
} else if(action == 36) { /* make_md5 */
ret = Xorriso_make_md5(xorriso, (void *) node, show_path, 0);
ret= Xorriso_make_md5(xorriso, (void *) node, show_path, 0);
if(ret >= 0)
ret= 1;
} else if(action == 37) { /* mkisofs_r */
ret= Xorriso_mkisofs_lower_r(xorriso, node, 0);
} else { /* includes : 15 in_iso */
sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
Xorriso_result(xorriso, 0);

Loading…
Cancel
Save