New option -md5, new -as mkisofs option --md5

This commit is contained in:
Thomas Schmitt 2009-08-10 19:37:47 +00:00
parent 1c3c8fa869
commit 6b1dac2161
5 changed files with 62 additions and 7 deletions

View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Aug 09, 2009"
.TH XORRISO 1 "Aug 10, 2009"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -750,6 +750,14 @@ same filesystems. Use this if mode "on" always sees all files changed.
The speed advantage appears only if the loaded session was produced with
-disk_dev_ino "on" too.
.TP
\fB\-md5\fR "on"|"off"
Enable or disable processing of MD5 checksums for the overall session and for
each single data file. If enabled then MD5 checksums get loaded from the image
if there are any. At image generation time they are computed for each file
which gets its data written into the new session. The checksums of files which
have their data in older sessions get copied into the new session.
For now checksums can be exploited only via find action get_md5.
.TP
\fB\-rom_toc_scan\fR "on"|"off"[:"emul_on"|"emul_off"]
Read-only drives do not tell the actual media type but show any media as
ROM (e.g. as DVD-ROM). The session history of MMC multi-session media might

View File

@ -5265,6 +5265,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->ino_behavior= 7;
m->do_joliet= 0;
m->do_aaip= 0;
m->do_md5= 0;
m->relax_compliance= 0;
m->do_follow_pattern= 1;
m->do_follow_param= 0;
@ -7664,6 +7665,11 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((xorriso->do_md5 & (1 | 2 | 4)) == 0);
sprintf(line,"-md5 %s\n", (xorriso->do_md5 & 1 ? "on" : "off"));
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (Xorriso_get_relax_text(xorriso, sfe, 0) == 2);
sprintf(line,"-compliance %s\n", sfe);
if(!(is_default && no_defaults))
@ -11226,6 +11232,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
" --hardlinks Record eventual hard link relations of files",
" --acl Record eventual ACLs of files",
" --xattr Record eventual user space xattr of files",
" --md5 Compute and record MD5 checksums of data files",
" -V ID, -volid ID Set Volume ID",
" -b FILE, -eltorito-boot FILE",
" Set El Torito boot image name",
@ -11387,6 +11394,8 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
Xorriso_option_acl(xorriso, "on", 0);
} else if(strcmp(argv[i], "--xattr")==0) {
Xorriso_option_xattr(xorriso, "on", 0);
} else if(strcmp(argv[i], "--md5")==0) {
Xorriso_option_md5(xorriso, "on", 0);
} else if(strcmp(argv[i], "-z")==0 ||
strcmp(argv[i], "-transparent-compression")==0) {
Xorriso_option_zisofs(xorriso, "by_magic=on", 0);
@ -11600,6 +11609,8 @@ not_enough_args:;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--xattr")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "--md5")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-z")==0 ||
strcmp(argv[i], "-transparent-compression")==0) {
/* was already handled in first argument scan */;
@ -15840,6 +15851,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -disk_dev_ino \"on\"|\"ino_only\"|\"off\"",
" Enable resp. disable recording of disk file dev_t and ino_t",
" and their use in file comparison.",
" -md5 \"on\"|\"off\"",
" Enable resp. disable processing of MD5 checksums.",
" -ban_stdio_write",
" Allow for writing only the usage of optical drives.",
" -blank \"fast\"|\"all\"|\"deformat\"|\"deformat_quickest\"",
@ -16885,6 +16898,22 @@ int Xorriso_option_mark(struct XorrisO *xorriso, char *mark, int flag)
}
/* Option -md5 "on"|"off" */
int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag)
{
if(strcmp(mode, "off")==0)
xorriso->do_md5&= ~7;
else if(strcmp(mode, "on")==0)
xorriso->do_md5|= (1 | 2 | 4);
else {
sprintf(xorriso->info_text, "-md5: unknown mode '%s'", mode);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
return(1);
}
/* Option -mkdir alias -mkdiri */
int Xorriso_option_mkdiri(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
@ -19014,7 +19043,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"dev","dialog","disk_dev_ino","disk_pattern","dummy","eject",
"iso_rr_pattern","follow","format","fs","gid","grow_blindly","hardlinks",
"history","indev","in_charset","joliet","list_delimiter","local_charset",
"mark","not_leaf","not_list","not_mgt",
"mark","md5","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",
@ -19518,6 +19547,10 @@ next_command:;
(*idx)++;
ret= Xorriso_option_mark(xorriso, arg1, 0);
} else if(strcmp(cmd, "md5")==0) {
(*idx)++;
ret= Xorriso_option_md5(xorriso, arg1, 0);
} else if(strcmp(cmd, "mount") == 0 || strcmp(cmd, "mount_cmd") == 0) {
(*idx)+= 4;
if((*idx)>argc) {

View File

@ -124,6 +124,11 @@ struct XorrisO { /* the global context of xorriso */
bit9= allow to set input charset from xattr "isofs.cs"
*/
int do_md5; /* bit0= read MD5 array
bit1= write session MD5
bit2= wite MD5 for each data file
*/
int relax_compliance; /* opaque bitfield to be set by xorrisoburn */
int do_follow_pattern;
int do_follow_param;
@ -835,6 +840,7 @@ struct ExprtesT {
11= -decision char *arg1 ("yes", "no")
12= -prune
13= -wholename char *arg1 (regex_t in *arg2)
14= -has_any_xattr
*/
int test_type;
@ -936,6 +942,8 @@ struct FindjoB {
30= internal: count by xorriso->node_counter
31= internal: register in xorriso->node_array
32= internal: widen_hardlinks disk_equiv: update nodes marked in di_do_widen
33= get_any_xattr
34= get_md5
*/
int action;
int prune;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.08.10.192240"
#define Xorriso_timestamP "2009.08.10.193843"

View File

@ -1122,10 +1122,12 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
ext|= isoburn_ropt_noacl;
if(!(xorriso->do_aaip & 4))
ext|= isoburn_ropt_noea;
#ifdef isoburn_ropt_noino
if (xorriso->ino_behavior & 1)
if(xorriso->ino_behavior & 1)
ext|= isoburn_ropt_noino;
#ifdef isoburn_ropt_nomd5
if(!(xorriso->do_md5 & 1))
ext|= isoburn_ropt_nomd5;
#endif
isoburn_ropt_set_extensions(ropts, ext);
@ -1787,7 +1789,11 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
((!!xorriso->do_joliet) * isoburn_igopt_joliet) |
(( !(xorriso->ino_behavior & 2)) * isoburn_igopt_hardlinks) |
(( (!(xorriso->ino_behavior & 2)) ||
(xorriso->do_aaip & (2 | 8 | 16 | 256))) * isoburn_igopt_aaip);
(xorriso->do_aaip & (2 | 8 | 16 | 256)) ||
(xorriso->do_md5 & (2 | 4))
) * isoburn_igopt_aaip) |
((!!(xorriso->do_md5 & 2)) * isoburn_igopt_session_md5) |
((!!(xorriso->do_md5 & 4)) * isoburn_igopt_file_md5);
isoburn_igopt_set_extensions(sopts, ext);
isoburn_igopt_set_relaxed(sopts, relax);
isoburn_igopt_set_sort_files(sopts, 1);