Allowed to perform -rm_r /

This commit is contained in:
Thomas Schmitt 2010-11-01 19:15:59 +00:00
parent 3d2154b31e
commit c4ccfda966
2 changed files with 6 additions and 3 deletions

View File

@ -994,7 +994,7 @@ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem,
if(ret<=0) if(ret<=0)
goto ex; goto ex;
root_dir= iso_image_get_root(volume); root_dir= iso_image_get_root(volume);
if(((void *) root_dir) == ((void *) victim_node)) { if(((void *) root_dir) == ((void *) victim_node) && !(flag & 1)) {
sprintf(xorriso->info_text, "May not delete root directory"); sprintf(xorriso->info_text, "May not delete root directory");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;} {ret= 0; goto ex;}
@ -1012,7 +1012,7 @@ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem,
} else { } else {
if(flag&1) { /* rm -r */ if(flag&1) { /* rm -r */
if((xorriso->do_reassure==1 && !xorriso->request_not_to_ask) || if((xorriso->do_reassure==1 && !xorriso->request_not_to_ask) ||
(flag&32)) { (flag&32) || ((void *) root_dir) == ((void *) victim_node)) {
/* Iterate over subordinates and delete them */ /* Iterate over subordinates and delete them */
mem= boss_mem; mem= boss_mem;
@ -1089,6 +1089,9 @@ dir_not_removed:;
} }
} }
if(((void *) root_dir) == ((void *) victim_node))
{ret= 2; goto ex;}
if(xorriso->request_to_abort) if(xorriso->request_to_abort)
{ret= 3; goto ex;} {ret= 3; goto ex;}
boss_node= iso_node_get_parent(victim_node); boss_node= iso_node_get_parent(victim_node);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.10.29.164503" #define Xorriso_timestamP "2010.11.01.191542"