Disallowed -clone to overwrite existing nodes

This commit is contained in:
Thomas Schmitt 2011-02-02 17:41:52 +00:00
parent aae50b2d16
commit 435cd88e83
6 changed files with 69 additions and 65 deletions

View File

@ -1385,7 +1385,7 @@ int Xorriso_clone_tree(struct XorrisO *xorriso, void *boss_iter,
char *leafname;
IsoImage *volume;
IsoDir *new_parent;
IsoNode *origin_node, *dir_node, *new_node, *dest_node= NULL;
IsoNode *origin_node, *dir_node, *new_node;
ret= Xorriso_get_volume(xorriso, &volume, 0);
if(ret <= 0)
@ -1402,16 +1402,13 @@ int Xorriso_clone_tree(struct XorrisO *xorriso, void *boss_iter,
if(dest_ret<0)
return(dest_ret);
if(dest_ret > 0) {
ret= Xorriso_node_from_path(xorriso, volume, eff_dest, &dest_node, 0);
if(ret <= 0)
return(ret);
if(dest_node == origin_node) {
sprintf(xorriso->info_text,
"Cloning: Original and copy have the same iso_rr_path: ");
Text_shellsafe(eff_dest, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
if(eff_dest[0] == 0)
strcpy(eff_dest, "/");
sprintf(xorriso->info_text,
"Cloning: Copy address already exists : ");
Text_shellsafe(eff_dest, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
} else {
/* obtain eff_dest address despite it does not exist */
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, dest, eff_dest, 2);
@ -1419,11 +1416,6 @@ int Xorriso_clone_tree(struct XorrisO *xorriso, void *boss_iter,
return(ret);
}
ret= Xorriso_overwrite_dest(xorriso, boss_iter,
eff_dest, dest_ret, "Cloning", 0);
if(ret <= 0)
return(ret);
/* Obtain parent path and leaf name */
strcpy(dir_adr, eff_dest);
for(l= strlen(dir_adr); l > 0; ) {

View File

@ -9,7 +9,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 "Jan 29, 2011"
.TH XORRISO 1 "Feb 02, 2011"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -1053,12 +1053,15 @@ other file causes a FAILURE event.
\fB\-clone\fR iso_rr_path_original iso_rr_path_copy
Create a copy of the ISO file object iso_rr_path_original with the new
address iso_rr_path_copy. If the original is a directory then copy all
files and directories underneath. Boot catalog are not copied but
silently ignored.
files and directories underneath. An eventual boot catalog file gets
not copied but is silently ignored.
.br
The copied ISO file objects have the same attributes. Copied data files
refer to the same content source as their originals.
The copies may then be manipulated independendly of their originals.
.br
This command will refuse execution if the address iso_rr_path_copy
already exists in the ISO tree.
.TP
.B Settings for file insertion:
.TP

View File

@ -990,11 +990,13 @@ filesystem.
-clone iso_rr_path_original iso_rr_path_copy
Create a copy of the ISO file object iso_rr_path_original with the
new address iso_rr_path_copy. If the original is a directory then
copy all files and directories underneath. Boot catalog are not
copied but silently ignored.
copy all files and directories underneath. An eventual boot
catalog file gets not copied but is silently ignored.
The copied ISO file objects have the same attributes. Copied data
files refer to the same content source as their originals. The
copies may then be manipulated independendly of their originals.
This command will refuse execution if the address iso_rr_path_copy
already exists in the ISO tree.

File: xorriso.info, Node: SetInsert, Next: Manip, Prev: Insert, Up: Options
@ -4451,45 +4453,45 @@ Node: Options23227
Node: AqDrive24835
Node: Loading27741
Node: Insert40885
Node: SetInsert49744
Node: Manip58311
Node: CmdFind66992
Node: Filter77416
Node: Writing81765
Node: SetWrite88054
Node: Bootable101664
Node: Jigdo113971
Node: Charset118229
Node: Exception120980
Node: DialogCtl125495
Node: Inquiry128082
Node: Navigate132415
Node: Verify140310
Node: Restore148899
Node: Emulation155555
Node: Scripting164598
Node: Frontend170160
Node: Examples171455
Node: ExDevices172624
Node: ExCreate173258
Node: ExDialog174532
Node: ExGrowing175794
Node: ExModifying176596
Node: ExBootable177097
Node: ExCharset177644
Node: ExPseudo178472
Node: ExCdrecord179366
Node: ExMkisofs179681
Node: ExGrowisofs180684
Node: ExException181808
Node: ExTime182262
Node: ExIncBackup182721
Node: ExRestore186289
Node: ExRecovery187258
Node: Files187824
Node: Seealso189052
Node: Legal189576
Node: CommandIdx190498
Node: ConceptIdx204797
Node: SetInsert49874
Node: Manip58441
Node: CmdFind67122
Node: Filter77546
Node: Writing81895
Node: SetWrite88184
Node: Bootable101794
Node: Jigdo114101
Node: Charset118359
Node: Exception121110
Node: DialogCtl125625
Node: Inquiry128212
Node: Navigate132545
Node: Verify140440
Node: Restore149029
Node: Emulation155685
Node: Scripting164728
Node: Frontend170290
Node: Examples171585
Node: ExDevices172754
Node: ExCreate173388
Node: ExDialog174662
Node: ExGrowing175924
Node: ExModifying176726
Node: ExBootable177227
Node: ExCharset177774
Node: ExPseudo178602
Node: ExCdrecord179496
Node: ExMkisofs179811
Node: ExGrowisofs180814
Node: ExException181938
Node: ExTime182392
Node: ExIncBackup182851
Node: ExRestore186419
Node: ExRecovery187388
Node: Files187954
Node: Seealso189182
Node: Legal189706
Node: CommandIdx190628
Node: ConceptIdx204927

End Tag Table

View File

@ -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 "Jan 29, 2011"
@c man .TH XORRISO 1 "Feb 02, 2011"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -1317,12 +1317,15 @@ other file causes a FAILURE event.
@cindex Directory, copy, -clone
Create a copy of the ISO file object iso_rr_path_original with the new
address iso_rr_path_copy. If the original is a directory then copy all
files and directories underneath. Boot catalog are not copied but
silently ignored.
files and directories underneath. An eventual boot catalog file gets
not copied but is silently ignored.
@*
The copied ISO file objects have the same attributes. Copied data files
refer to the same content source as their originals.
The copies may then be manipulated independendly of their originals.
@*
This command will refuse execution if the address iso_rr_path_copy
already exists in the ISO tree.
@end table
@c man .TP
@c man .B Settings for file insertion:

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.02.01.185830"
#define Xorriso_timestamP "2011.02.02.174154"

View File

@ -112,6 +112,9 @@ int Xorriso_blank_as_needed(struct XorrisO *xorriso, int flag);
bit1= remove empty directory: rmdir
bit2= recursion: do not reassure in mode 2 "tree"
bit3= this is for overwriting and not for plain removal
bit4= count deleted files in xorriso->pacifier_count
bit5= with bit0 only remove directory content, not the directory
bit6= do not delete eventually existing node from di_array
@return <=0 = error
1 = removed simple node
2 = removed directory or tree
@ -120,6 +123,7 @@ int Xorriso_blank_as_needed(struct XorrisO *xorriso, int flag);
int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem,
char *path, int flag);
/* @param flag bit0= long format
bit1= do not print count of nodes
bit2= du format