Fine tuning of directory attribute copying with -cp_rx

This commit is contained in:
2008-06-06 10:37:13 +00:00
parent cada9d4ba3
commit daa98e8008
3 changed files with 14 additions and 6 deletions

View File

@ -3147,7 +3147,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
char path[SfileadrL], *apt, *npt, sfe[5*SfileadrL];
IsoNode *node= NULL;
int done= 0, is_dir= 0, ret, target_is_dir, source_is_dir, stbuf_ret, hret;
int leaf_is_split= 0, source_is_split= 0;
int leaf_is_split= 0, source_is_split= 0, new_dir_made= 0;
struct stat stbuf, target_stbuf;
struct PermiteM *perm_stack_mem;
@ -3225,6 +3225,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
stbuf_ret= -1; /* now it is removed */
}
}
new_dir_made= 0;
if(stbuf_ret==-1 && (source_is_dir && !source_is_split)) {
/* make a directory */
ret= mkdir(path, 0777);
@ -3243,6 +3244,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
Xorriso_restore_implicit_properties(xorriso, disk_path, path,
img_path, 4);
}
new_dir_made= 1;
} else if(source_is_dir && !source_is_split) {
/* >>> If owner: eventually try to obtain rwx-permssions, stack path */;
@ -3255,13 +3257,15 @@ attach_source:;
/* directory was created above */;
} else if(is_dir && !source_is_split) {
Xorriso_restore_properties(xorriso, disk_path, node, 2 | !!(flag&64));
if(new_dir_made) /* keep open and push to Permstack */
Xorriso_restore_properties(xorriso, disk_path, node, 2 | !!(flag&64));
if(!(flag&32)) {
ret= Xorriso_restore_tree(xorriso, (IsoDir *) node, img_path, path,
(off_t) 0, NULL, flag&(2|64));
if(ret<=0)
goto ex;
if(!(flag&64)) /* set timestamps which Permstack_pop() will not set */
if(new_dir_made && !(flag&64))
/* set timestamps which Permstack_pop() will not set */
Xorriso_restore_properties(xorriso, disk_path, node, 2);
}
} else {