Added copying of attributes from symbolic link into image

This commit is contained in:
Thomas Schmitt 2007-12-16 12:27:35 +00:00
parent 97dfff0371
commit 0b54206e71
2 changed files with 17 additions and 4 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2007.12.16.103456" #define Xorriso_timestamP "2007.12.16.122626"

View File

@ -721,6 +721,19 @@ int Xorriso_get_node_by_path(struct XorrisO *xorriso,
} }
int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf,
struct iso_tree_node *node, int flag)
{
iso_tree_node_set_permissions(node, stbuf->st_mode & 07777);
iso_tree_node_set_uid(node, stbuf->st_uid);
iso_tree_node_set_gid(node, stbuf->st_gid);
iso_tree_node_set_atime(node, stbuf->st_atime);
iso_tree_node_set_mtime(node, stbuf->st_mtime);
iso_tree_node_set_ctime(node, stbuf->st_ctime);
return(1);
}
/* @param flag bit0= recursion is active */ /* @param flag bit0= recursion is active */
int Xorriso_add_tree(struct XorrisO *xorriso, struct iso_tree_node_dir *dir, int Xorriso_add_tree(struct XorrisO *xorriso, struct iso_tree_node_dir *dir,
char *img_dir_path, char *disk_dir_path, char *img_dir_path, char *disk_dir_path,
@ -880,9 +893,9 @@ cannot_lstat:;
node= iso_tree_add_symlink(dir, img_name, link_target); node= iso_tree_add_symlink(dir, img_name, link_target);
if(node!=NULL) { if(node!=NULL) {
ret= Xorriso_transfer_properties(xorriso, &stbuf, node, 0);
/* >>> copy all file properties from disk_link to node */; if(ret<=0)
goto was_problem;
} }
} else } else
node= iso_tree_add_node(dir, srcpt); node= iso_tree_add_node(dir, srcpt);